We want to automatically compute sample mass density based on sample composition, if user specified packing fraction.
See #278 for more discussions.
Proposed solution
We could offer other approaches:
given a composition, try and get density from COD or Materials Project. For different polymorphs the densities will be different for the same composition, so we would have to handle that ("material-density" not "sample-density").
Obtain material density from MP API, with the user's API key added to the global config.
Density = number of atoms/unit cell volume (from composition and cif files), then converted to mass density adjusted by the packing fraction.
as a fallback, use a "best effort" atomic density (most tightly packed materials are around 5x10^22 cm^-3)? This would be "magic" which we don't normally like, but if we use this fallback we could give a warning.
I was thinking more about this and something like:
if both density and packing fractions are set and raise errors (no change)
if packing fraction is None:
packing fraction = 1
get_density_from_material_structure(composition)
current workflow for the part when density is passed in.
changed the title [-]material density estimation based on sample composition[/-][+]materials project/COD workflow: implement `get_density_from_cloud()`[/+]on Dec 29, 2024
changed the title [-]materials project/COD workflow: implement `get_density_from_cloud()`[/-][+]feat: implement `get_density_from_cloud()` using MP/COD workflow[/+]on Dec 29, 2024
Activity
sbillinge commented on Dec 28, 2024
I was thinking more about this and something like:
if both density and packing fractions are set and raise errors (no change) if packing fraction is None: packing fraction = 1 get_density_from_material_structure(composition) current workflow for the part when density is passed in.