Skip to content

Commit

Permalink
Remove remaining --input-file arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
domna committed Feb 21, 2024
1 parent a664b8c commit f982c0e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions examples/json_map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ user@box:~$ dataconverter --nxdl NXmynxdl --generate-template > mynxdl.mapping.j

### Automatically merge partial NeXus files
```console
user@box:~$ dataconverter --nxdl NXiv_temp --input-file voltage_and_temperature.nxs --input-file current.nxs --output auto_merged.nxs
user@box:~$ dataconverter --nxdl NXiv_temp voltage_and_temperature.nxs current.nxs --output auto_merged.nxs
```

### Map and copy over data to new NeXus file
```console
user@box:~$ dataconverter --nxdl NXiv_temp --mapping merge_copied.mapping.json --input-file voltage_and_temperature.nxs --input-file current.nxs --output merged_copied.nxs
user@box:~$ dataconverter --nxdl NXiv_temp --mapping merge_copied.mapping.json voltage_and_temperature.nxs current.nxs --output merged_copied.nxs
```

### Map and link over data to new NeXus file
```console
user@box:~$ dataconverter --nxdl NXiv_temp --mapping merge_linked.mapping.json --input-file voltage_and_temperature.nxs --input-file current.nxs --output merged_linked.nxs
user@box:~$ dataconverter --nxdl NXiv_temp --mapping merge_linked.mapping.json voltage_and_temperature.nxs current.nxs --output merged_linked.nxs
```

## Contact person in FAIRmat for this reader
Expand Down
4 changes: 2 additions & 2 deletions examples/mpes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ For XPS data you may use the data in [`tests/data/dataconverter/readers/xps`](ht
```shell
dataconverter --reader xps \\
--nxdl NXmpes \\
--input-file eln_data.yaml \\
--input-file In-situ_PBTTT_XPS_SPECS.xml \\
eln_data.yaml \\
In-situ_PBTTT_XPS_SPECS.xml \\
--output xps_example.nxs
```

Expand Down
8 changes: 5 additions & 3 deletions pynxtools/dataconverter/readers/json_map/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
# limitations under the License.
#
"""An example reader implementation for the DataConverter."""
from typing import Tuple, Any
import json
import pickle
from typing import Any, Tuple

import numpy as np
import xarray
from mergedeep import merge

from pynxtools.dataconverter import hdfdict
from pynxtools.dataconverter.readers.base.reader import BaseReader
from pynxtools.dataconverter.template import Template
from pynxtools.dataconverter import hdfdict


def parse_slice(slice_string):
Expand Down Expand Up @@ -211,7 +212,7 @@ def read(
{x: "/hierarchical/path/in/your/datafile" for x in template}
)
raise IOError(
"Please supply a JSON mapping file: --input-file"
"Please supply a JSON mapping file: "
" my_nxdl_map.mapping.json\n\n You can use this "
"template for the required fields: \n" + str(template)
)
Expand All @@ -228,3 +229,4 @@ def read(

# This has to be set to allow the convert script to use this reader. Set it to "MyDataReader".
READER = JsonMapReader
READER = JsonMapReader
1 change: 0 additions & 1 deletion tests/dataconverter/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def test_links_and_virtual_datasets(tmp_path):
"NXtest",
"--reader",
"example",
"--input-file",
os.path.join(dirpath, "testdata.json"),
"--output",
os.path.join(tmp_path, "test_output.h5"),
Expand Down

0 comments on commit f982c0e

Please sign in to comment.