From 9a9b0d99111ff4dfbe23d99df5db65c04c67fc46 Mon Sep 17 00:00:00 2001 From: Rubel Date: Tue, 26 Mar 2024 11:51:38 +0100 Subject: [PATCH] rebase on main. --- src/nomad_measurements/xrd/readers.py | 5 +++-- src/nomad_measurements/xrd/schema.py | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/nomad_measurements/xrd/readers.py b/src/nomad_measurements/xrd/readers.py index b5139ba8..370cb28e 100644 --- a/src/nomad_measurements/xrd/readers.py +++ b/src/nomad_measurements/xrd/readers.py @@ -20,6 +20,7 @@ from typing import Dict, Any, TYPE_CHECKING import numpy as np from nomad.units import ureg +from pynxtools.dataconverter.convert import transfer_data_into_template # from pynxtools.dataconverter.convert import transfer_data_into_template from nomad_measurements.utils import ( @@ -34,8 +35,8 @@ ) -def transfer_data_into_template(**kwargs): - raise NotImplementedError +# def transfer_data_into_template(**kwargs): +# raise NotImplementedError def read_panalytical_xrdml( diff --git a/src/nomad_measurements/xrd/schema.py b/src/nomad_measurements/xrd/schema.py index 3af7c6e3..b1fd489d 100644 --- a/src/nomad_measurements/xrd/schema.py +++ b/src/nomad_measurements/xrd/schema.py @@ -59,7 +59,7 @@ PlotSection, PlotlyFigure, ) -# from nomad.datamodel.metainfo.eln.nexus_data_converter import populate_nexus_subsection +from nomad.datamodel.metainfo.eln.nexus_data_converter import populate_nexus_subsection from nomad_measurements import ( NOMADMeasurementsCategory, ) @@ -79,8 +79,8 @@ m_package = Package(name='nomad_xrd') -def populate_nexus_subsection(**kwargs): - raise NotImplementedError +# def populate_nexus_subsection(**kwargs): +# raise NotImplementedError def handle_nexus_subsection( xrd_template: 'Template', @@ -702,6 +702,7 @@ class ELNXRayDiffraction(XRayDiffraction, EntryData, PlotSection): component=ELNComponentEnum.BoolEditQuantity, label='Generate NeXus file', ), + default=True ) def get_read_write_functions(self) -> tuple[Callable, Callable]: @@ -714,7 +715,8 @@ def get_read_write_functions(self) -> tuple[Callable, Callable]: if self.data_file.endswith('.rasx'): return readers.read_rigaku_rasx, self.write_xrd_data if self.data_file.endswith('.xrdml'): - return readers.read_panalytical_xrdml, self.write_xrd_data + return readers.read_nexus_xrd, self.write_nx_xrd + # return readers.read_panalytical_xrdml, self.write_xrd_data if self.data_file.endswith('.brml'): return readers.read_bruker_brml, self.write_xrd_data return None, None