From 5599c3dd9926818be59f755bdcaa0be15a7902e0 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:40:51 +0100 Subject: [PATCH] use generate_eln --help in readme --- pynxtools/eln_mapper/README.md | 14 +++++++++----- pynxtools/eln_mapper/eln_mapper.py | 16 +++------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/pynxtools/eln_mapper/README.md b/pynxtools/eln_mapper/README.md index e556ae45d..e5f9cefee 100644 --- a/pynxtools/eln_mapper/README.md +++ b/pynxtools/eln_mapper/README.md @@ -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 +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. -``` diff --git a/pynxtools/eln_mapper/eln_mapper.py b/pynxtools/eln_mapper/eln_mapper.py index b1b3cb5d0..983ed3627 100755 --- a/pynxtools/eln_mapper/eln_mapper.py +++ b/pynxtools/eln_mapper/eln_mapper.py @@ -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." ), ) @@ -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)