Show default values in the archive browser

We do not show default values of quantities at the moment. Those quantities are treated as unset and only appear as greyed items once "all definitions" is checked.

There are use-cases in ELN, where users need to see default values as part of there workflow. We should show default values, if there are actually present in the schema. The fact that some value is a default vs is a set value, needs to be visually reflected in the browser.

-- original isse text:

Dear Nomad,

either i do not understand something correctly, but it seems that the default value functionality does not work as intended.

If I have such a class:

class Image(MSection):
    thresholds = Quantity(
        type=np.dtype(np.float64),
        unit='keV',
        a_eln=dict(component='NumberEditQuantity', defaultDisplayUnit='keV'))
    trigger_mode = Quantity(
        type=MEnum([
            'SOFTWARE', 'EXT_SEQUENCE', 'EXT_FRAMES']),
        a_eln=dict(component='EnumEditQuantity'))
    saturation_value = Quantity(
        type=np.dtype(np.int64),
        a_eln=dict(component='NumberEditQuantity'))
    sensor_material = Quantity(
        type=str, default="Si")
    ....

If I do img = Image(), the gui does not display the default values.

image

It works for editable quantities.

Best Micha

Edited Sep 09, 2022 by Markus Scheidgen
Assignee Loading
Time tracking Loading