pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

Improve useability of the `MaterialsProject2020Compatibility` Scheme

Open Andrew-S-Rosen opened this issue 3 years ago • 0 comments

Another one for @rkingsbury regarding MaterialsProject2020Compatibility.

Issue 1: Oxide Type

If the .data field is empty in a ComputedEntry, the compatibility scheme fails because of the bottom line. We should copy the section from the sulfide correction and call oxide_type() if a structure object is attached and switch the line below to .data.get("oxide_type") so it doesn't crash if empty.

https://github.com/materialsproject/pymatgen/blob/bb259c6bf3faabc3ab9fbd011b660a35cad469a8/pymatgen/entries/correction_calculator.py#L237-L241

Issue 2: Clarification on run_type

We should provide some documentation about the .parameters["run_type"] check, as the user may not know in advance that they need to specify "GGA" or "GGA+U" for this. Additionally, if it's not set at all, you get a CompatibilityError, which wasn't clear to me originally.

https://github.com/materialsproject/pymatgen/blob/bb259c6bf3faabc3ab9fbd011b660a35cad469a8/pymatgen/entries/compatibility.py#L474-L482

Andrew-S-Rosen avatar Apr 20 '22 09:04 Andrew-S-Rosen