From 1b412ce9c3508449fc450323cc68990850eee35f Mon Sep 17 00:00:00 2001 From: rettigl Date: Wed, 6 Mar 2024 11:52:37 +0100 Subject: [PATCH 1/3] add energy and angular resolution rewrite rules --- pynxtools_mpes/reader.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pynxtools_mpes/reader.py b/pynxtools_mpes/reader.py index 003fb77..3642146 100644 --- a/pynxtools_mpes/reader.py +++ b/pynxtools_mpes/reader.py @@ -181,6 +181,7 @@ def iterate_dictionary(dic, key_string): "momentum_resolution": "RESOLUTION[momentum_resolution]/resolution", "temporal_resolution": "RESOLUTION[temporal_resolution]/resolution", "spatial_resolution": "RESOLUTION[spatial_resolution]/resolution", + "angular_resolution": "RESOLUTION[angular_resolution]/resolution", "sample_temperature": "temperature_sensor/value", } @@ -191,12 +192,18 @@ def iterate_dictionary(dic, key_string): "beam_TYPE[beam]/Probe": "beam_TYPE[beam_probe]", "beam_TYPE[beam]/Pump": "beam_TYPE[beam_pump]", "sample_history": "sample_history/notes", + "ELECTRONANALYSER[electronanalyser]/RESOLUTION[energy_resolution]": ( + "ELECTRONANALYSER[electronanalyser]/energy_resolution" + ), "ELECTRONANALYSER[electronanalyser]/RESOLUTION[momentum_resolution]": ( "ELECTRONANALYSER[electronanalyser]/momentum_resolution" ), "ELECTRONANALYSER[electronanalyser]/RESOLUTION[spatial_resolution]": ( "ELECTRONANALYSER[electronanalyser]/spatial_resolution" ), + "ELECTRONANALYSER[electronanalyser]/RESOLUTION[angular_resolution]": ( + "ELECTRONANALYSER[electronanalyser]/angular_resolution" + ), "SAMPLE[sample]/gas_pressure": "INSTRUMENT[instrument]/pressure_gauge/value", "SAMPLE[sample]/temperature": ( "INSTRUMENT[instrument]/MANIPULATOR[manipulator]/temperature_sensor/value" From 7c624b3208795594d387cca11276b9ed8cc5d3be Mon Sep 17 00:00:00 2001 From: rettigl Date: Wed, 6 Mar 2024 12:37:27 +0100 Subject: [PATCH 2/3] add drain current --- pynxtools_mpes/reader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pynxtools_mpes/reader.py b/pynxtools_mpes/reader.py index 3642146..213df8f 100644 --- a/pynxtools_mpes/reader.py +++ b/pynxtools_mpes/reader.py @@ -183,6 +183,7 @@ def iterate_dictionary(dic, key_string): "spatial_resolution": "RESOLUTION[spatial_resolution]/resolution", "angular_resolution": "RESOLUTION[angular_resolution]/resolution", "sample_temperature": "temperature_sensor/value", + "drain_current": "drain_current_amperemeter/value", } REPLACE_NESTED = { From 9ff9d2fb3d73ff12500f05b307d1cd8179566db1 Mon Sep 17 00:00:00 2001 From: Florian Dobener Date: Mon, 15 Apr 2024 15:03:23 +0200 Subject: [PATCH 3/3] Align ruff settings with main pynx (#9) * Pins ruff==0.3.4 * Update ruff include line * Apply ruff reformatting --- dev-requirements.txt | 17 +++-------------- pynxtools_mpes/reader.py | 1 + pyproject.toml | 12 +++++++++++- tests/test_reader.py | 1 + 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 0c851ba..48ce72e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -36,9 +36,7 @@ click==8.1.7 # pip-tools # pynxtools cloudpickle==3.0.0 - # via - # dask - # hyperspy + # via dask comm==0.2.1 # via ipykernel contourpy==1.2.0 @@ -47,12 +45,10 @@ cycler==0.12.1 # via matplotlib dask[array]==2024.2.0 # via - # dask # hyperspy # kikuchipy # orix # pyxem - # rosettasciio debugpy==1.8.1 # via ipykernel decorator==5.1.1 @@ -112,7 +108,6 @@ h5py==3.10.0 # pynxtools # pynxtools-mpes (pyproject.toml) # pyxem - # rosettasciio # silx hdf5plugin==4.4.0 # via fabio @@ -280,7 +275,6 @@ numpy==1.26.4 # pynxtools # pyxem # radioactivedecay - # rosettasciio # scikit-image # scikit-learn # scipy @@ -330,9 +324,7 @@ pillow==10.0.1 # nionswift # scikit-image pint==0.23 - # via - # hyperspy - # rosettasciio + # via hyperspy pip-tools==7.4.0 # via pynxtools-mpes (pyproject.toml) platformdirs==4.2.0 @@ -346,7 +338,6 @@ ply==3.11 # via pycifrw pooch==1.8.0 # via - # hyperspy # kikuchipy # orix prettytable==3.10.0 @@ -390,7 +381,6 @@ python-dateutil==2.8.2 # jupyter-client # matplotlib # pandas - # rosettasciio pytz==2024.1 # via # nionswift @@ -407,7 +397,6 @@ pyyaml==6.0.1 # kikuchipy # pynxtools # pynxtools-mpes (pyproject.toml) - # rosettasciio pyzmq==25.1.2 # via # ipykernel @@ -423,7 +412,7 @@ requests==2.31.0 # requests-cache requests-cache==1.2.0 # via pynxtools -ruff==0.2.2 +ruff==0.3.4 # via pynxtools-mpes (pyproject.toml) scikit-image==0.22.0 # via diff --git a/pynxtools_mpes/reader.py b/pynxtools_mpes/reader.py index 213df8f..c13b783 100644 --- a/pynxtools_mpes/reader.py +++ b/pynxtools_mpes/reader.py @@ -16,6 +16,7 @@ # limitations under the License. # """MPES reader implementation for the DataConverter.""" + import errno import os from functools import reduce diff --git a/pyproject.toml b/pyproject.toml index 4da5418..8768e62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "mypy", - "ruff", + "ruff==0.3.4", "pytest", "types-pyyaml", "pip-tools", @@ -52,6 +52,10 @@ local_scheme = "node-and-date" [tool.ruff] include = ["pynxtools_mpes/*.py", "tests/*.py"] +line-length = 88 +indent-width = 4 + +[tool.ruff.lint] select = [ "E", # pycodestyle "W", # pycodestyle @@ -74,6 +78,12 @@ ignore = [ ] fixable = ["ALL"] +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" + [tool.mypy] strict = false ignore_missing_imports = true diff --git a/tests/test_reader.py b/tests/test_reader.py index f036282..59e235a 100644 --- a/tests/test_reader.py +++ b/tests/test_reader.py @@ -1,6 +1,7 @@ """ Basic example based test for the stm reader """ + import logging import os import xml.etree.ElementTree as ET