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

Update main, nexus, generate_eln READMEs #226

Merged
merged 3 commits into from
Jan 31, 2024
Merged
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ data into the NeXus standard and visualising the files content.

- [**dataconverter**](https://github.com/FAIRmat-NFDI/pynxtools/blob/master/pynxtools/dataconverter/README.md): Creates compliant instances of NeXus/HDF5 files to [NeXus schemas](https://nexusformat.org).
- [**read_nexus**](https://github.com/FAIRmat-NFDI/pynxtools/blob/master/pynxtools/nexus/README.md): Outputs a debug log for a given NeXus file.
- [**generate_eln**](https://github.com/FAIRmat-NFDI/pynxtools/blob/master/pynxtools/eln_mapper/README.md): Outputs ELN files that can be used to add metadata to the dataconverter routine.

# Documentation
Documentation for the different tools can be found [here](https://fairmat-nfdi.github.io/pynxtools/).

# Contributing

Expand Down
21 changes: 13 additions & 8 deletions pynxtools/eln_mapper/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# ELN generator
This is a helper tool for generating eln
- The simple eln generator that can be used in a console or jupyter-notebook
- Scheme based eln generator that can be used in NOMAD and the eln can be used as a custom scheme in NOMAD.
This is a helper tool for generating ELN files that can be used to add metadata to the dataconverter routine.
Two types of ELN are supported (by passing the flag `eln-type`):
- **eln**: The simple ELN generator that can be used in a console or jupyter-notebook.
- **scheme_eln**: Scheme based ELN generator that can be used in NOMAD and the ELN can be used as a custom scheme in NOMAD.

```
$ eln_generator --options <value>
user@box:~$ generate_eln --help
Usage: generate_eln [OPTIONS]

Helper tool for generating ELN files in YAML format.

Options:
--nxdl TEXT Name of NeXus definition without extension
(.nxdl.xml). [required]
--skip-top-levels INTEGER To skip upto a level of parent hierarchical structure.
--skip-top-levels INTEGER To skip the level of parent hierarchy level.
E.g. for default 1 the part Entry[ENTRY] from
/Entry[ENTRY]/Instrument[INSTRUMENT]/... will
be skiped. [default: 1]
--output-file TEXT Name of output file.
--eln-type [eln|scheme_eln] Choose a type from the eln or scheme_eln. [required]
--output-file TEXT Name of file that is neede to generated output
file.
--eln-type [eln|scheme_eln] Choose a type of ELN output (eln or
scheme_eln). [required]
--help Show this message and exit.
```
16 changes: 3 additions & 13 deletions pynxtools/eln_mapper/eln_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
type=int,
show_default=True,
help=(
"To skip the level of parent hierarchy level. E.g. for default 1 the part"
"To skip the level of parent hierarchy level. E.g. for default 1 the part "
"Entry[ENTRY] from /Entry[ENTRY]/Instrument[INSTRUMENT]/... will be skiped."
),
)
Expand All @@ -49,20 +49,10 @@
required=True,
type=click.Choice(["eln", "scheme_eln"], case_sensitive=False),
default="eln",
help=("Choose a type of ELN output (eln or scheme_eln)."),
)
def get_eln(nxdl: str, skip_top_levels: int, output_file: str, eln_type: str):
"""To generate ELN in yaml file format.

Parameters
----------

nxdl : str
Name of NeXus definition e.g. NXmpes
skip_top_levels : int
To skip hierarchical levels
output_file : str
Name of the output file.
"""
"""Helper tool for generating ELN files in YAML format."""
eln_type = eln_type.lower()
if eln_type == "eln":
generate_eln(nxdl, output_file, skip_top_levels)
Expand Down
2 changes: 1 addition & 1 deletion pynxtools/nexus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export 'NEXUS_DEF_PATH'=<folder_path_that_contains_nexus_defs>

Following example dataset can be used to test `read_nexus` module `tests/data/nexus/201805_WSe2_arpes.nxs`.
This is an angular-resolved photoelectron spectroscopy (ARPES) dataset and it is formatted according to
the [NXarpes application definition of NEXUS](https://manual.nexusformat.org/classes/applications/NXarpes.html#nxarpes).
the [NXarpes application definition of NeXus](https://manual.nexusformat.org/classes/applications/NXarpes.html#nxarpes).
Loading