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
General HDF5 Reader #30
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ta according to recipes (dictionaries see `masci_tools/io/parsers/hdf5/recipes.py`). Based on the reader from the `studentproject18ws` branch. Simplified and stripped down to always return a dict Transformations are implemented with a decorator (equivalent to conversion_function decorator for the fleur outxml_parser)
janssenhenning
changed the title
Implemented basic general HDF5reader, which can read and transform da…
General HDF5 reader
Mar 19, 2021
Codecov Report
@@ Coverage Diff @@
## develop #30 +/- ##
===========================================
+ Coverage 68.43% 69.09% +0.65%
===========================================
Files 64 69 +5
Lines 10367 10699 +332
===========================================
+ Hits 7095 7392 +297
- Misses 3272 3307 +35 |
…eaders output. This makes it easier to create recipes which can just be plugged into a pandas dataframe for example Also fixed one wrong import in `transforms`
…om weights are missing atm) For this a couple of extensions had to be made to the transformation system. Added explicit and recursive move_to_memory and conversion to string entries in datasets can now call transformation functions using a value from the attributes (not datasets) At the moment there is only a multiply function for example for multiplying kpoints with the reciprocal_cell matrix More matrix manipulation was added: -multiplication (both orders) and multiply each element in list with matrix -calculating norm of list of vectors or distances between neighbours in the list -calculate the cumulative sum of an array Some entries will be in the form of a dict after processing (if for example you use the get_all_child_dataset transformation). Now there is an additional option to unpack the keys into the root dictionary after all transformations
…n pattern. Could make a fixed version of this. At the moment it is used to create the total atom sums and so is formatted according to the atom types
…sier to understand
…do not need to be converted to eV
…d them up This file contains: -Something similar to h5dump for seeing the structure of a hdf file -A simple hdf reader that just builds up a nested dictionary with numpy arrays, which mirrors the exact filestructure of the hdf file Also removed the really old hdf reading routine for the `banddos.hdf` file
…tion made some names of transformations more consistent and added errors for currently not implemented cases for transformations
For this I copied the PERIODIC_TABLE_ELEMENTS from the move_aiida_fleur_methods branch
…litting spin-up/down) and flattening arrays
…eds on namedtuples are a python 3.7+ feature
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR implements a generic
HDF5Reader
heavily inspired by the one on thestudenproject18ws
branch.It can be used with filepaths and file handles and reads and transformed the data according to a given recipe dictionary.
For an example see
masci_tools.io.parsers.hdf5.recipes.FleurDOS
.The data is always returned in a python dict. The possible transformations are implemented using the
masci_tools.io.parsers.hdf5.transforms.hdf5_transformation
decorator, which works in the exact same way as theconversion_function
decorator in theoutxml_parser
Basic Usage with filepath:
Basic Usage with file handle: