Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use multiformat reader #6

Merged
merged 27 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
55e5ea0
Move dicts to mapping file
domna Feb 23, 2024
1d9201d
Import from multiformat reader
domna Feb 23, 2024
1c7e270
Update pynxtools dependency
domna Feb 23, 2024
bd29283
Merge branch 'main' into use-multiformat-reader
domna Jul 16, 2024
8a4abaa
Update mappings from main
domna Jul 17, 2024
7c15b8b
Adapt reader to multiformat reader
domna Jul 17, 2024
7dbb5ea
Adaptions for a working multi reader
domna Jul 17, 2024
c32786e
Merge branch 'main' into use-multiformat-reader
domna Jul 17, 2024
9bcfa51
Update example file with latest defs
domna Jul 17, 2024
75cfbcd
Remove pyyaml from dependencies (handled by pynx via the multi format…
domna Jul 17, 2024
6b52fba
Use uv for dependency installation
domna Jul 17, 2024
c28be04
Remove unecessary coveralls installation
domna Jul 17, 2024
8de4768
Change git install notation
domna Jul 17, 2024
880fe97
Try another notation
domna Jul 17, 2024
8c0f685
Remove unecessary functions
domna Jul 18, 2024
25983ba
Update get_data_dims
domna Jul 22, 2024
430255e
Add keys to callbacks
domna Jul 23, 2024
9f303d0
Add parent_key to parse_yml
domna Jul 25, 2024
2253039
Use ENTRY instead of ENTRY[entry]
domna Jul 25, 2024
700aa70
Update pynxtools_mpes/reader.py
domna Jul 26, 2024
1f52dea
Ruff format
domna Jul 26, 2024
6d396d9
Upgrade ruff to 0.5.5 and add pre-commit hook
domna Jul 26, 2024
1fefb4e
Upgrade workflows
domna Jul 26, 2024
740fc35
Use ruff check
domna Jul 26, 2024
5c25635
use pynxtools logger, and consistently use this logger
rettigl Jul 26, 2024
323463e
Remove mappings (#25)
rettigl Aug 12, 2024
edf2caa
Update pynx 0.6.0
domna Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
branches: [main]

env:
UV_SYSTEM_PYTHON: true

jobs:
pytest:
runs-on: ubuntu-latest
Expand All @@ -19,19 +22,14 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install package
run: |
pip install ".[dev]"
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install ".[dev]"
- name: Test with pytest
run: |
pytest tests
64 changes: 64 additions & 0 deletions pynxtools_mpes/mappings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""
Mapping dictionaries for the MPES conversion.
"""

DEFAULT_UNITS = {
"X": "step",
"Y": "step",
"t": "step",
"tofVoltage": "V",
"extractorVoltage": "V",
"extractorCurrent": "A",
"cryoTemperature": "K",
"sampleTemperature": "K",
"dldTimeBinSize": "ns",
"delay": "ps",
"timeStamp": "s",
"energy": "eV",
"kx": "1/A",
"ky": "1/A",
}
lukaspie marked this conversation as resolved.
Show resolved Hide resolved

CONVERT_DICT = {
"Instrument": "INSTRUMENT[instrument]",
"Analyzer": "ELECTRONANALYSER[electronanalyser]",
"Manipulator": "MANIPULATOR[manipulator]",
"Beam": "beamTYPE[beam]",
"unit": "@units",
"Sample": "SAMPLE[sample]",
"Source": "sourceTYPE[source]",
"User": "USER[user]",
"energy_resolution": "energy_resolution/resolution",
"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",
"drain_current": "drain_current_amperemeter/value",
"photon_energy": "energy",
}

REPLACE_NESTED = {
"SAMPLE[sample]/chemical_formula": "SAMPLE[sample]/SUBSTANCE[substance]/molecular_formula_hill",
"sourceTYPE[source]/Probe": "sourceTYPE[source_probe]",
"sourceTYPE[source]/Pump": "sourceTYPE[source_pump]",
"beamTYPE[beam]/Probe": "beamTYPE[beam_probe]",
"beamTYPE[beam]/Pump": "beamTYPE[beam_pump]",
"sample_history": "history/notes/description",
"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"
),
}
lukaspie marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading