Skip to content

Commit

Permalink
Merge pull request #296 from pyiron/dbacc
Browse files Browse the repository at this point in the history
Accelerate database check
  • Loading branch information
jan-janssen authored Apr 24, 2021
2 parents 1456d0a + 4df198f commit 576da49
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pyiron_base/database/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,11 @@ def _check_chem_formula_length(self, par_dict):
par_dict(dict): dictionary of the parameter
limit(int): the limit for the length of checmical formular
"""
for key, value in par_dict.items():
if key == 'chemicalformula' and not value is None:
if len(value) > self._chem_formula_lim_length:
par_dict[key] = "OVERFLOW_ERROR"
key_limited = 'chemicalformula'
if key_limited in par_dict.keys() and \
par_dict[key_limited] is not None and \
len(par_dict[key_limited]) > self._chem_formula_lim_length:
par_dict[key_limited] = "OVERFLOW_ERROR"
return par_dict

# Item functions
Expand Down

0 comments on commit 576da49

Please sign in to comment.