Skip to content

feat: get_density_from_cloud() COD workflow #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks
yucongalicechen opened this issue Apr 18, 2025 · 3 comments · May be fixed by #333
Open
4 tasks

feat: get_density_from_cloud() COD workflow #331

yucongalicechen opened this issue Apr 18, 2025 · 3 comments · May be fixed by #333
Milestone

Comments

@yucongalicechen
Copy link
Contributor

yucongalicechen commented Apr 18, 2025

Problem:
User enters a chemical formula (e.g. SiO2, Nacl) (and an optional phase) and the function returns the material density.

Proposed solution / tasks:

  • 1. Implement a function to convert a chemical formula into Hill notation
  • 2. Implement a function to retrive matching .cif filenames from COD
  • 3. For each .cif file, extract _cell_volume, _cell_formula_units_Z, etc, then compute mass density
  • 4. Implement a wrapper function that performs 1-3 sequantially and returns the average density (per phase, if applicable)
@yucongalicechen yucongalicechen added this to the 3.7.0 release milestone Apr 18, 2025
@yucongalicechen yucongalicechen linked a pull request Apr 18, 2025 that will close this issue
@sbillinge
Copy link
Contributor

@yucongalicechen this may be too complicated and not worth the effort. Let's decide whether we want to do it before going ahead.

@yucongalicechen
Copy link
Contributor Author

@yucongalicechen this may be too complicated and not worth the effort. Let's decide whether we want to do it before going ahead.

Okay yes I agree. I also found it's hard to pick a default density as the results are arranged differently between my local repo & github testing. Maybe a simpler solution here is to just reuse xraydb directly? It has a list of densities stored and user can manually input material density for unknown materials. We can differentiate material vs mass density if that makes things clearer.

@sbillinge
Copy link
Contributor

I think it only has it for a few materials though. Are you saying it is too complicated to compute the density from the cif file, or too complicated to know which phase of a particular material is the right one to choose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants