Skip to content

Commit

Permalink
merging examples into subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbrock committed Mar 7, 2025
1 parent b4138fc commit 29d7b60
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 206 deletions.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ nexus_parser = "pynxtools.nomad.entrypoints:nexus_parser"
nexus_schema = "pynxtools.nomad.entrypoints:nexus_schema"
nexus_data_converter = "pynxtools.nomad.entrypoints:nexus_data_converter"
nexus_app = "pynxtools.nomad.entrypoints:nexus_app"
eln_export_example = "pynxtools.nomad.entrypoints:eln_export_example"
nexus_conversion_example = "pynxtools.nomad.entrypoints:nexus_conversion_example"
iv_temp_example = "pynxtools.nomad.entrypoints:iv_temp_example"
simple_nexus_example = "pynxtools.nomad.entrypoints:simple_nexus_example"

[project.scripts]
read_nexus = "pynxtools.nexus.nexus:main"
Expand Down
42 changes: 17 additions & 25 deletions src/pynxtools/nomad/entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,37 +200,29 @@ def load(self):
),
)

eln_export_example = ExampleUploadEntryPoint(
title="Simple ELN Export",
simple_nexus_example = ExampleUploadEntryPoint(
title="Simple NeXus Example",
category="NeXus Experiment Examples",
description="""
This example shows users how a simple ELN can be set up in NOMAD which can be then
This example show 3 use cases on how NeXus experiment data can be handled in NOMAD.
Example 1 - ELN Export
This example shows how a simple ELN can be set up in NOMAD which can be then
exported in to an RDM agnostic eln_data.yaml format. The example also shows how such
eln file can be used together with some experiment data to be converted by pynxtools
to a valid NeXus file.
""",
plugin_package="pynxtools",
resources=["nomad/examples/eln_export/*"],
)

nexus_conversion_example = ExampleUploadEntryPoint(
title="Data Conversion to NeXus Format",
category="NeXus Experiment Examples",
description="""
This example shows users how NOMAD GUI allows converting experiment data with
Example 2 - Interface for Data Conversion to NeXus Format
This example shows how NOMAD GUI allows converting experiment data with
attached eln notes to NeXus file.
Example 3 - Sensor Scan - IV Temperature Curve
This example shows how experimental data can be mapped to a Nexus application definition.
Here, data from an IV Temperature measurements as taken by a Python framework is
converted to [`NXiv_temp`](https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXiv_temp.html).
We also demonstrate the use of Nexus ELN features of NOMAD to add further details
which were not provided by the data acquisition software.
This example combines Example 1, and 2, and demonstrates how a NOMAD ELN can be built
to collect additional information, and combine it with experimental data to convert
them into exportable NeXus file, which is also directly searchable in NOMAD.
""",
plugin_package="pynxtools",
resources=["nomad/examples/nexus_conversion/*"],
)

iv_temp_example = ExampleUploadEntryPoint(
title="Sensor Scan - IV Temperature Curve",
category="NeXus Experiment Examples",
description="""
This example shows users how to take data from a Python framework and map it out to a Nexus application definition for IV Temperature measurements, [`NXiv_temp`](https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXiv_temp.html).
We use the Nexus ELN features of NOMAD to generate a Nexus file.
""",
plugin_package="pynxtools",
resources=["nomad/examples/iv_temp/*"],
resources=["nomad/examples/*"],
)
File renamed without changes.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"data": {
"m_def": "../upload/raw/eln_export.schema.archive.yaml#/definitions/section_definitions/0",
"m_def": "../upload/raw/eln_export/eln_export.schema.archive.yaml#/definitions/section_definitions/0",
"output": "eln_export/eln_data.yaml",
"notes": {
"author": "name",
"note": "example note"
Expand Down
8 changes: 4 additions & 4 deletions src/pynxtools/nomad/examples/iv_temp/IV_temp.archive.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"data": {
"m_def": "../upload/raw/IV_temp.schema.archive.yaml#/definitions/section_definitions/0",
"m_def": "../upload/raw/iv_temp/IV_temp.schema.archive.yaml#/definitions/section_definitions/0",
"reader": "json_map",
"nxdl": "NXiv_temp",
"input_files": [
"IV_temp.mapping.json",
"IV_temp.pickle"
"iv_temp/IV_temp.pickle"
],
"output": "IV_temp.nxs",
"nexus_view": "../upload/archive/mainfile/IV_temp.nxs#/data",
"output": "iv_temp/IV_temp.nxs",
"nexus_view": "../upload/archive/mainfile/iv_temp/IV_temp.nxs#/data",
"notes": {
"author": "name",
"note": "example note"
Expand Down
48 changes: 0 additions & 48 deletions src/pynxtools/nomad/examples/iv_temp/IV_temp.mapping.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ definitions:
nxdl: NXiv_temp
input_files": [
"IV_temp.mapping.json",
"IV_temp.pickle"
"iv_temp/IV_temp.pickle"
]
output: IV_temp.nxs
nexus_view: "../upload/archive/mainfile/IV_temp.nxs#/data"
output: iv_temp/IV_temp.nxs
nexus_view: "../upload/archive/mainfile/iv_temp/IV_temp.nxs#/data"
eln:
hide: []
sub_sections:
Expand Down
30 changes: 0 additions & 30 deletions src/pynxtools/nomad/examples/iv_temp/README.md

This file was deleted.

48 changes: 0 additions & 48 deletions src/pynxtools/nomad/examples/nexus_conversion/IV_temp.mapping.json

This file was deleted.

30 changes: 0 additions & 30 deletions src/pynxtools/nomad/examples/nexus_conversion/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"nxdl": "NXiv_temp",
"input_files": [
"IV_temp.mapping.json",
"IV_temp.pickle",
"external_eln_data.yaml"
"nexus_conversion/IV_temp.pickle",
"nexus_conversion/external_eln_data.yaml"
],
"output": "converted.nxs",
"nexus_view": "../upload/archive/mainfile/converted.nxs#/data"
"output": "nexus_conversion/converted.nxs",
"nexus_view": "../upload/archive/mainfile/nexus_conversion/converted.nxs#/data"
},
"m_ref_archives": {}
}
Loading

0 comments on commit 29d7b60

Please sign in to comment.