Skip to content

Commit

Permalink
conserve species order
Browse files Browse the repository at this point in the history
`get_species_symbols()` returns a sorted list, but
`species_translate_list` should follow the original order of
`Structure.species`.
  • Loading branch information
pmrv committed May 12, 2020
1 parent ee84a5f commit 2e3cdb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyiron/lammps/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,10 @@ def structure_full(self):
# extract electric charges from potential file
q_dict = {}
species_translate_list = []
for el in self.structure.get_species_symbols():
q_dict[el] = self.potential.get_charge(el)
species_translate_list.append(self.potential.get_element_id(el))
for species in self.structure.species:
species_name = species.Abbreviation
q_dict[species_name] = self.potential.get_charge(species_name)
species_translate_list.append(self.potential.get_element_id(species_name))
sorted_species_list = np.array(self._potential.get_element_lst())
molecule_lst, bonds_lst, angles_lst = [], [], []
bond_type_lst, angle_type_lst = [], []
Expand Down

0 comments on commit 2e3cdb1

Please sign in to comment.