diff --git a/pyscf/pbc/gto/cell.py b/pyscf/pbc/gto/cell.py index 614eff5748..79d74442a6 100644 --- a/pyscf/pbc/gto/cell.py +++ b/pyscf/pbc/gto/cell.py @@ -1331,7 +1331,8 @@ def build(self, dump_input=True, parse_arg=mole.ARGPARSE, if symmorphic is not None: self.symmorphic = symmorphic - mole.MoleBase.build(self, dump_input, parse_arg, *args, **kwargs) + _built = self._built + mole.MoleBase.build(self, False, parse_arg, *args, **kwargs) exp_min = np.array([self.bas_exp(ib).min() for ib in range(self.nbas)]) if self.exp_to_discard is None: @@ -1448,7 +1449,8 @@ def build(self, dump_input=True, parse_arg=mole.ARGPARSE, _check_mesh_symm = not self._mesh_from_build self.build_lattice_symmetry(check_mesh_symmetry=_check_mesh_symm) - if dump_input: + if dump_input and not _built and self.verbose > logger.NOTE: + self.dump_input() logger.info(self, 'lattice vectors a1 [%.9f, %.9f, %.9f]', *_a[0]) logger.info(self, ' a2 [%.9f, %.9f, %.9f]', *_a[1]) logger.info(self, ' a3 [%.9f, %.9f, %.9f]', *_a[2]) diff --git a/pyscf/pbc/gto/test/test_cell.py b/pyscf/pbc/gto/test/test_cell.py index fe7b850e64..12de96c739 100644 --- a/pyscf/pbc/gto/test/test_cell.py +++ b/pyscf/pbc/gto/test/test_cell.py @@ -177,7 +177,8 @@ def test_ewald_2d_inf_vacuum(self): cell.atom = 'He 0 0 0; He 0 1 1' cell.unit = 'B' cell.mesh = [9,9,60] - cell.verbose = 0 + cell.verbose = 5 + cell.output = '/dev/null' cell.dimension = 2 cell.low_dim_ft_type = 'inf_vacuum' cell.rcut = 3.6 @@ -191,7 +192,8 @@ def test_ewald_1d_inf_vacuum(self): cell.atom = 'He 0 0 0; He 0 1 1' cell.unit = 'B' cell.mesh = [9,60,60] - cell.verbose = 0 + cell.verbose = 5 + cell.output = '/dev/null' cell.dimension = 1 cell.low_dim_ft_type = 'inf_vacuum' cell.rcut = 3.6 @@ -204,7 +206,8 @@ def test_ewald_0d_inf_vacuum(self): cell.atom = 'He 0 0 0; He 0 1 1' cell.unit = 'B' cell.mesh = [60] * 3 - cell.verbose = 0 + cell.verbose = 5 + cell.output = '/dev/null' cell.dimension = 0 cell.low_dim_ft_type = 'inf_vacuum' cell.build() @@ -217,7 +220,8 @@ def test_ewald_2d(self): cell.atom = 'He 0 0 0; He 0 1 1' cell.unit = 'B' cell.mesh = [9,9,60] - cell.verbose = 0 + cell.verbose = 5 + cell.output = '/dev/null' cell.dimension = 2 cell.rcut = 3.6 cell.build()