Skip to content

Commit

Permalink
Fix: XRF schema uses plugin category (#19)
Browse files Browse the repository at this point in the history
* Replaced measurements category with a plugin specific one.
  • Loading branch information
fabianschoeppach authored Oct 2, 2024
1 parent 26e1cdb commit 0332738
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/nomad_uibk_plugin/schema_packages/XRFschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@
StructuralProperties,
)
from nomad.metainfo import Datetime, Quantity, SchemaPackage, Section, SubSection
from nomad_measurements import (
NOMADMeasurementsCategory,
)
from nomad_measurements.utils import merge_sections

from nomad_uibk_plugin.schema_packages import XRFreader
from nomad_uibk_plugin.schema_packages import UIBKCategory, XRFreader

if TYPE_CHECKING:
from structlog.stdlib import BoundLogger
Expand Down Expand Up @@ -249,7 +246,7 @@ class ELNXRayFluorescence(XRayFluorescence, EntryData):
"""

m_def = Section(
categories=[NOMADMeasurementsCategory],
categories=[UIBKCategory],
label='X-Ray Fluorescence (XRF)',
a_eln=ELNAnnotation(
lane_width='600px',
Expand Down
9 changes: 9 additions & 0 deletions src/nomad_uibk_plugin/schema_packages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from nomad.config.models.plugins import SchemaPackageEntryPoint
from nomad.datamodel.data import EntryDataCategory
from nomad.metainfo.metainfo import Category
from pydantic import Field


class UIBKCategory(EntryDataCategory):
"""
A category for all measurements defined in the UIBK nomad plugin.
"""

m_def = Category(label='UIBK', categories=[EntryDataCategory])

class MySchemaPackageEntryPoint(SchemaPackageEntryPoint):
parameter: int = Field(0, description='Custom configuration parameter')

Expand Down
1 change: 1 addition & 0 deletions tests/parsers/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

from nomad.datamodel import EntryArchive

from nomad_uibk_plugin.parsers.myparser import MyParser


Expand Down

0 comments on commit 0332738

Please sign in to comment.