Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for fetching crystal structures directly from the Materials Project database using their API. The main changes include a new
MaterialsProjectconfiguration class, integration of structure fetching via the Materials Project API in the input validation workflow, and an example YAML demonstrating usage. These changes make it easier to run calculations using Materials Project structures by specifying a material ID and API key.Materials Project integration:
MaterialsProjectclass tocalphy/input.pyto handle API key, structure type (conventional or primitive), and target atom count. Includes validation to resolve the API key from an environment variable and provide user-friendly error messages if missing._validate_allmethod ofcalphy/input.py. If the lattice string starts withmp-, the code fetches the structure using the provided API key, repeats it to reach the target atom count, and sets up the calculation accordingly. Includes error handling for missing API key and missingmp_apipackage.Configuration and usage:
materials_projectfield to the mainCalculationclass, allowing users to specify Materials Project options in their input files.examples/example_01/input-mp.yaml) demonstrating how to set up a calculation using a Materials Project structure, including how to specify the API key and related options.closes #188