Skip to content

Commit

Permalink
remove env setting from code and just add to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Feb 2, 2024
1 parent 6d4d9de commit 884742e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 10 additions & 1 deletion pynxtools/nexus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@ 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).


A note to Windows users: if you run `read_nexus` from `git bash`, you need to set the environmental variable
`MSYS_NO_PATHCONV` to avoid the [path translation in Windows Git MSys](https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line#34386471).
The easiest way is to prefix the `read_nexus` call with `MSYS_NO_PATHCONV=1`:

```
MSYS_NO_PATHCONV=1 read_nexus -c /NXarpes/ENTRY/INSTRUMENT/analyser
```
4 changes: 0 additions & 4 deletions pynxtools/nexus/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,6 @@ def process_nexus_master_file(self, parser):
)
def main(nexus_file, documentation, concept):
"""The main function to call when used as a script."""
import platform

if platform.system() == "Windows" and "Git" in os.environ["SHELL"]:
os.environ["MSYS_NO_PATHCONV"] = "1"
logging_format = "%(levelname)s: %(message)s"
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setLevel(logging.DEBUG)
Expand Down

0 comments on commit 884742e

Please sign in to comment.