Reference in yaml schemes

I was trying a more articulated example in view of a real use case we have.

This is the schema:

  • Einwaage-test.schema.archive.yaml
definitions:
  name: 'Set your name here'
  sections:
    Process:
      quantities:
        comment:
          type: str
          m_annotations:
            eln:
              component: StringEditQuantity
      sub_sections:
        process_steps:
          repeats: true
          section:
            m_annotations:
              eln:
            quantities:
              step_number:
                type: int
                m_annotations:
                  eln:
                    component: NumberEditQuantity
    Substance:
      m_annotations:
        eln:
      base_section: nomad.datamodel.data.EntryData
      sub_sections:
        SampleID:
          section:
            base_sections:
              - 'nomad.datamodel.metainfo.eln.SampleID'
              - 'nomad.datamodel.data.EntryData'
            m_annotations:
              template: 
              eln: 
      quantities:
        comment:
          type: str
          m_annotations:
            eln:
              component: StringEditQuantity
    Sample:
      base_section: nomad.datamodel.data.EntryData
      sub_sections:
        sample_history:
          section: 
            base_section: Process
            m_annotations:
              eln:
            quantities:
              test:
                type: str
                description: test
                m_annotations:
                  eln:
                    component: StringEditQuantity
      quantities:
        name:
          type: str
          m_annotations:
            eln:
              component: StringEditQuantity
    Powder_mixture: # THIS is my main section
      base_section: Sample
      quantities:
        my_baseclass_extension:
          type: str
          m_annotations:
            eln:
              component: StringEditQuantity

This is the data file:

  • Einwaage-test.data.archive.yaml
data:
  m_def: ../upload/raw/Einwaage-test.schema.archive.yaml#definitions/section_definitions/Sample      #Powder_mixture
  name: a
  sample_history:
    comment: test_1
    method: test_2
    dose: 3
    test: test_extension_to_process_baseclass
    process_steps:
    - comment: my_step_comment_1
    - comment: my_step_comment_2
  my_baseclass_extension: test_extension_to_sample

The ELN entry is correctly filled if I use "Sample" in m_def (except my_baseclass_extension quantity, clearly).

It is not filled if I use "Powder_mixture", as I would like.

Edited Sep 13, 2022 by Andrea Albino
Assignee Loading
Time tracking Loading