Skip to content

Commit

Permalink
use generate_eln --help in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Jan 31, 2024
1 parent 1adef84 commit 5599c3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
14 changes: 9 additions & 5 deletions pynxtools/eln_mapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ Two types of ELN are supported (by passing the flag `eln-type`):
- **scheme_eln**: Scheme based ELN generator that can be used in NOMAD and the ELN can be used as a custom scheme in NOMAD.

```
$ generate_eln --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 of ELN output (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

0 comments on commit 5599c3d

Please sign in to comment.