Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mendeleev' into delay_mendeleev
Browse files Browse the repository at this point in the history
# Conflicts:
#	pyiron_atomistics/atomistics/structure/periodic_table.py
  • Loading branch information
jan-janssen committed Feb 5, 2024
2 parents 584781d + b306108 commit 05e9c73
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pyiron_atomistics/atomistics/structure/periodic_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
pandas.options.mode.chained_assignment = None


@lru_cache(maxsize=118)
def element(*args):
import mendeleev
return mendeleev.element(*args)


class ChemicalElement(object):
"""
An Object which contains the element specific parameters
Expand Down Expand Up @@ -187,9 +193,7 @@ def __getitem__(self, item):
if item in self._mendeleev_translation_dict.keys():
item = self._mendeleev_translation_dict[item]
if item in self._mendeleev_property_lst:
import mendeleev

return getattr(mendeleev.element(self._element_str), item)
return getattr(element(self._element_str), item)
if item in self.sub.index:
return self.sub[item]

Expand Down

0 comments on commit 05e9c73

Please sign in to comment.