Rev curate class name #372
Merged
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.
Pull Request Summary
This is a very small PR that focuses on making minor changes to the function that allows you to read an HDF5 file back into a SourceDataset instance. This function now will take a "property_map" that maps the name of a property in the HDF5 file to a specific class (e.g., "dft_energy" to the Energies class in properties). Since the name of a property can be anything, we cannot necessarily infer it.
Previously, these were simply loaded into the PropertyBaseModel class; while that class has the same variables (name, units, value, property_type, classification), as it is the parent for all the actual properties we define, it does not contain any of the specific validation functions associated with a given property. Also, if writing the dataset to an hdf5 file, lots of warnings will be logged since I have a check that requires instances of
AtomicNumbers,PositionsandEnergiesto be in every record (as the minimum info required by modelforge).I also added a factory class that allows a user to generate an instance of a class based on its name as a string (so passing "positions" will return an instance of the
Positionsclass). I ended up not using this, but left the code (with tests) as it may ultimately be useful.Associated Issue(s)
Pull Request Checklist