Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
c8c9cc4f
Commit
c8c9cc4f
authored
11 months ago
by
Amir Golparvar
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "HDF5 normalizer docs"
parent
11109f22
No related branches found
No related tags found
1 merge request
!1870
Resolve "HDF5 normalizer docs"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/howto/customization/hdf5.md
+33
-0
33 additions, 0 deletions
docs/howto/customization/hdf5.md
with
33 additions
and
0 deletions
docs/howto/customization/hdf5.md
+
33
−
0
View file @
c8c9cc4f
...
...
@@ -74,6 +74,39 @@ file in another upload, follow the same form for
To read a dataset, use
`read_dataset`
and provide a reference. This will return the value
cast in the type of the dataset.
## HDF5Normalizer
A different flavor of _
**reading**
_ HDF5 files into NOMAD quantities is through defining a
[
custom schema
](
../../tutorial/custom.md
)
and inheriting
`HDF5Normalizer`
into base-sections. Two essential components
of using
`HDF5Normalizer`
class is to first define a quantity that is annotated with
`FileEditQuantity`
field
to enable one to drop/upload the
`*.h5`
file, and to define relevant quantities annotated with
`path`
attribute under
`hdf5`
. These quantities are then picked up by the normalizer to extract the values to be found
denoted by the
`path`
.
A minimum example to import your hdf5 and map it to NOMAD quantities is by using the following custom schema:
```
yaml
definitions
:
name
:
'
hdf5'
sections
:
Test_HDF5
:
base_sections
:
-
'
nomad.datamodel.data.EntryData'
-
'
nomad.datamodel.metainfo.basesections.HDF5Normalizer'
quantities
:
datafile
:
type
:
str
m_annotations
:
eln
:
component
:
FileEditQuantity
charge_density
:
type
:
np.float32
shape
:
[
'
*'
,
'
*'
,
'
*'
]
m_annotations
:
hdf5
:
path
:
'
/path/to/charge_density'
```
## HDF5Dataset
To use HDF5 storage for archive quantities, one should use
`HDF5Dataset`
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment