You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The get_average_volume_from_database method returns ZeroDivisionError: division by zero when the composition is not found in the lookup table.
if (avg_vol := get_entry_from_dict(chem_env_key)) is not None:
vols.append(avg_vol["avg_vol"] * avg_vol["count"])
counts += avg_vol["count"]
This is because there is no fall back method when the composition isn't found and the counts and vol are both zero. A default would be using something like the Vegard's law where the volumes can be obtained with the single element structures.
Error when using the Composition("Ag50 Nb50"):
get_average_volume_from_database
return sum(vols) / counts
~~~~~~~~~~^~~~~~~~
ZeroDivisionError: division by zero
The text was updated successfully, but these errors were encountered:
If you take a look at get_average_volume_from_database, you can see that the default fallback is to use something like Vegard's law. We basically reweight the volume by composition / relative statistical count
For this method to fail, an element would have to be missing from the reference data entirely. What elements have you observed this behavior with?
Are you maybe using an out of date version of the reference data? When I run the following:
from atomate2.common.jobs.mpmorph import _get_average_volumes_file
avg_vols = _get_average_volumes_file()
print(avg_vols[[ce in ("Ag","Nb") for ce in avg_vols["chem_env"]]])
I get non-empty entries:
chem_env with_oxi avg_vol count source
56326 Nb False 18.022948 17 icsd
56830 Ag False 16.986225 25 icsd
66755 Nb False 18.592124 11 mp
92218 Ag False 17.766298 14 mp
The
get_average_volume_from_database
method returnsZeroDivisionError: division by zero
when the composition is not found in the lookup table.This is because there is no fall back method when the composition isn't found and the counts and vol are both zero. A default would be using something like the Vegard's law where the volumes can be obtained with the single element structures.
Error when using the
Composition("Ag50 Nb50")
:The text was updated successfully, but these errors were encountered: