Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise of pynxtools and nexus parser #89

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/nomad_measurements/xrd/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -34,8 +35,8 @@
)


def transfer_data_into_template(**kwargs):
raise NotImplementedError
# def transfer_data_into_template(**kwargs):
# raise NotImplementedError


def read_panalytical_xrdml(
Expand Down
10 changes: 6 additions & 4 deletions src/nomad_measurements/xrd/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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',
Expand Down Expand Up @@ -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]:
Expand All @@ -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
Expand Down
Loading