diff --git a/CHANGELOG.md b/CHANGELOG.md index d3d1a87..a51f7fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Unit conversion for (currenly unused) vdW radii from the original Fortran project - minor print output issues (no new line breaks, more consistent verbosity differentiation, ...) - bug in `postprocess_mol` which led to an unassigned return variable in the single-point case +- bug with all atom lists being initialized with a length of 102 instead of 103 ### Added - Support for the novel "g-xTB" method (working title: GP3-xTB) diff --git a/src/mindlessgen/molecules/generate_molecule.py b/src/mindlessgen/molecules/generate_molecule.py index 96d0e20..f66d3ce 100644 --- a/src/mindlessgen/molecules/generate_molecule.py +++ b/src/mindlessgen/molecules/generate_molecule.py @@ -73,8 +73,8 @@ def generate_atom_list(cfg: GenerateConfig, verbosity: int = 1) -> np.ndarray: valid_elems = set_all_elem natoms = np.zeros( - 102, dtype=int - ) # 102 is the number of accessible elements in the periodic table + 103, dtype=int + ) # 103 is the number of accessible elements in the periodic table # Some sanity checks: # - Check if the minimum number of atoms is smaller than the maximum number of atoms diff --git a/src/mindlessgen/molecules/molecule.py b/src/mindlessgen/molecules/molecule.py index ed63fa0..1c44f34 100644 --- a/src/mindlessgen/molecules/molecule.py +++ b/src/mindlessgen/molecules/molecule.py @@ -547,7 +547,7 @@ def read_xyz_from_file(self, filename: str | Path) -> None: # read the atomic coordinates self.xyz = np.zeros((self.num_atoms, 3)) self.ati = np.zeros(self.num_atoms, dtype=int) - self.atlist = np.zeros(102, dtype=int) + self.atlist = np.zeros(103, dtype=int) for i in range(self.num_atoms): line = lines[i + 2].split() self.ati[i] = PSE_NUMBERS[line[0].lower()] - 1 diff --git a/src/mindlessgen/molecules/refinement.py b/src/mindlessgen/molecules/refinement.py index 3f406de..cc8ad4d 100644 --- a/src/mindlessgen/molecules/refinement.py +++ b/src/mindlessgen/molecules/refinement.py @@ -197,7 +197,7 @@ def detect_fragments( # Remove the atoms that are not in the fragment from ati fragment_molecule.ati = np.array([mol.ati[i] for i in fragment]) # Update atlist by going through ati and add the occurences of each atom onto an empty array - fragment_molecule.atlist = np.zeros(102, dtype=int) + fragment_molecule.atlist = np.zeros(103, dtype=int) for atom in fragment_molecule.ati: fragment_molecule.atlist[atom] += 1 # Update the charge of the fragment molecule diff --git a/src/mindlessgen/prog/config.py b/src/mindlessgen/prog/config.py index 2fd3457..dc07c51 100644 --- a/src/mindlessgen/prog/config.py +++ b/src/mindlessgen/prog/config.py @@ -779,7 +779,9 @@ def check_config(self, verbosity: int = 1) -> None: for elem in self.generate.element_composition ): warnings.warn( - "f-block elements could be within the molecule. xTB does not treat f electrons explicitly. In this case UHF is set to 0." + "f-block elements could be within the molecule. " + + "xTB does not treat f electrons explicitly. " + + "UHF is temporarily set to 0." ) # Check for super heavy elements in forbidden elements diff --git a/test/test_generate/test_generate_molecule.py b/test/test_generate/test_generate_molecule.py index df96b3a..423e3c2 100644 --- a/test/test_generate/test_generate_molecule.py +++ b/test/test_generate/test_generate_molecule.py @@ -35,7 +35,7 @@ def test_generate_atom_list(min_atoms, max_atoms, default_generate_config): # Common assertions for atom count range assert isinstance(atom_list, np.ndarray) - assert atom_list.shape == (102,) + assert atom_list.shape == (103,) assert np.sum(atom_list) > 0 assert np.sum(atom_list) >= min_atoms assert np.sum(atom_list) <= max_atoms