Skip to content

Commit

Permalink
Fix density validator (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Oct 13, 2023
1 parent e05aec3 commit aad9f2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion emmet-core/emmet/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ def set_density_from_structure(cls, values):
# specified. This might happen when importing an older atomate2-format
# TaskDocument.
if not values.get("density", None):
values["density"] = values["structure"].density
if isinstance(values["structure"], dict):
values["density"] = values["structure"].get("density", None)
else:
values["density"] = values["structure"].density

return values

@classmethod
Expand Down

0 comments on commit aad9f2e

Please sign in to comment.