The module "python-common/common/python/nomadcore/archive.py" provides functionality to access HDF5 Archive files with an easy, pythonic interface. Currently only reading the original files is supported. Writing can be implemented if necessary, but it was left out for now to prevent any accidental modification of the Archive files.
Here is a quick overview of the functionality:
* The ArchiveHDF5 class contains a 'calculations'-dictionary that contains all the separate calculations and their hashes. There is also a 'repositories'-dictionary for accessing calculations from a specific repository upload.
* The data inside calculations can be accessed with a dictionary-like interface that also allows recursive search and indexing. All datasets are returned as numpy-arrays. To get a specific dataset, provide an index for each section, e.g. calc["section_run:0/section_system:1/simulation_cell"]
* You can get a list of sections by leaving out the index, e.g. calc["section_run:0/section_system"] will return a list of section_systems that belong to the first section_run.
* The sections that are returned by queries are also searchable with the same syntax, e.g. section_run = calc["section_run:0"]["section_system:0"]["simulation_cell"]
Here is an example of using the interface:
```python
importnumpyasnp
fromnomadcore.archiveimportArchiveHDF5
path="./hdftest.h5"
archive=ArchiveHDF5(path)
# Access data from a specific calculation. All data is returned as numpy