Inheritance bug for yaml schemas
Inherited quantities are not able to be set in GUI when implementing an ELN schema in a YAML file. The field appears in the GUI and can be edited but when clicking save the field is reset to empty. The data is written in the .json
file but does not appear in the GUI. If the schema is implemented directly in Python the quantity is instead set when clicking "save".
For example, the quantity param
in the following yaml schema is not able to be set from the B class:
definitions:
name: InheritanceBug
sections:
A:
quantities:
param:
type: str
m_annotations:
eln:
component: StringEditQuantity
B:
base_sections: [A, nomad.datamodel.data.EntryData]
Whilst the equivalent quantity param
defined directly in python is:
class A(ArchiveSection):
param = Quantity(
type=str,
a_eln=dict(component='StringEditQuantity')
)
class B(A, EntryData):
pass
Edit: Clarified the meaning of "not able to set". 2nd Edit: Added the information that the data is saved to the json archive file but now shown in the GUI.