From f0a86064e681239844f97d33bdf7f1ffa2344e2e Mon Sep 17 00:00:00 2001 From: Rubel Date: Sat, 23 Nov 2024 20:36:13 +0100 Subject: [PATCH] Approach2 for putting NeXus section as reference to the NeXus file. --- src/nomad_measurements/xrd/schema.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/nomad_measurements/xrd/schema.py b/src/nomad_measurements/xrd/schema.py index 082f54c0..3fd0b7e4 100644 --- a/src/nomad_measurements/xrd/schema.py +++ b/src/nomad_measurements/xrd/schema.py @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from os import name from typing import ( TYPE_CHECKING, Any, @@ -45,7 +44,6 @@ Measurement, MeasurementResult, ReadableIdentifiers, - SectionReference, ) from nomad.datamodel.metainfo.plot import ( @@ -718,18 +716,8 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger'): if self.name is None: self.name = 'RSM Scan Result' -class NexusMeasurement(Measurement): - nexus_result = Quantity( - type=ArchiveSection, - description='A reference to a NOMAD archive section.', - a_eln=ELNAnnotation( - component='ReferenceEditQuantity', - label='NeXus reference', - ), - ) - -class XRayDiffraction(NexusMeasurement): +class XRayDiffraction(Measurement): """ Generic X-ray diffraction measurement. """ @@ -770,6 +758,15 @@ class XRayDiffraction(NexusMeasurement): results = Measurement.results.m_copy() results.section_def = XRDResult + nexus_result = Quantity( + type=ArchiveSection, + description='NeXus section containing results of the XRD scan.', + a_eln=ELNAnnotation( + component='ReferenceEditQuantity', + label='NeXus reference', + ), + ) + def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger'): """ The normalize function of the `XRayDiffraction` section.