Physical properties in NOMAD metainfo
We should implement a better mechanism for tracking which physical properties are being stored in the metainfo. Currently, the only way to know that e.g. a quantity is measuring a physical property is to check the description, or alternatively check the descriptions in the section inheritance hierarchy. This does not scale well when thinking about e.g. custom schemas where physical properties can be tracked in very heterogeneous forms.
To solve this problem, a new Quantity attribute property
is proposed, together with Python classes that represent the available physical properties in NOMAD. Example:
heat_capacity_1 = Quantity(
type: np.float64
property: HeatCapacity
)
class Property():
description: 'Base class for physical properties.'
iris: ['...']
class HeatCapacity(Property):
unit: 'joule/kelvin'
description: 'Heat Capacity characterizes…'
iris: [http://qudt.org/vocab/quantitykind/HeatCapacity]
This would allow "tagging" quantities with a Property
class, that would explicitly tell which physical property is being stored. This idea also plays nicely with the "NOMAD Properties Ontology" task force: the property classes would essentially be designed according to the ontology.
This design has several benefits:
- Backwards-compatible
- The property classes can be extended relatively independently: The properties implementation doesn't have to have any dependency on the
nomad-fair
package. - It becomes very easy to track down a physical property in different shapes: just change the
shape
attribute accordingly. This is especially important for ELN schemas, where the same property can be tracked in very heterogeneous ways:- Simple scalar values
- As dense numpy arrays
- Within repeated subsections, that are used to build a "sparse array". E.g. there may be a repeated subsection that simply tracks down a property value together with an index in some large array.
- Units can be implicitly determined from the
Property
, but can also be changed by overriding them in the quantity directly.