Skip to content

Commit 8ab3e11

Browse files
Follow pynxtools-plugin-template (#63)
* Follow file structre from pynxtools-plugin-template and bring non-tracked file. * Update Readme file. * Fix spellchecker and linting. * comments out test_nomad_apps.py * Fix zenodo doi in READNME.md file according to the cruft. * Change from PR review.
1 parent e283569 commit 8ab3e11

79 files changed

Lines changed: 721 additions & 481 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cruft.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"template": "git@github.com:FAIRmat-NFDI/pynxtools-plugin-template.git",
3+
"commit": "519f503945368a21d0c44125c0f34cf0d5f46e10",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"reader_name": "spm",
8+
"supported_nxdl": "NXspm",
9+
"short_description": "NeXus data converter from SPM (Scanning Probe Microscopy).",
10+
"technique": "SPM,STS,STM,AFM",
11+
"reader_class": "SPMReader",
12+
"author_name": "The NOMAD authors",
13+
"author_email": "fairmat@physik.hu-berlin.de",
14+
"license": "Apache Software License 2.0",
15+
"zenodo_record": "17390485",
16+
"vscode_settings": false,
17+
"include_nomad_app": true,
18+
"include_nomad_example_upload": true,
19+
"__package_name": "pynxtools-spm",
20+
"__module_name": "pynxtools_spm",
21+
"__nomad_example": "spm_example_upload_entry_point",
22+
"__nomad_app": "",
23+
"_copy_without_render": ["*.html"],
24+
"_template": "git@github.com:FAIRmat-NFDI/pynxtools-plugin-template.git",
25+
"_commit": "519f503945368a21d0c44125c0f34cf0d5f46e10"
26+
}
27+
},
28+
"directory": null
29+
}

.cspell/custom-dictionary.txt

Lines changed: 81 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,106 @@
1-
# Custom Dictionary Words
1+
actv
2+
Alingment
3+
Alphabat
4+
arange
5+
AXISNAME
6+
backw
7+
bais
28
Brockhauser
9+
bruker
10+
Bruker
11+
Calib
12+
caplog
13+
chann
14+
channs
15+
chnl
316
Cojal
17+
cryo
18+
curnt
19+
dataconverter
20+
datamodel
21+
Demod
422
Dobener
523
Draxl
6-
Finishup
24+
filt
25+
findiff
26+
fliplr
27+
flipud
728
Florian
829
Forschungsgemeinschaft
30+
forw
31+
genfromtxt
932
Ginzburg
33+
González
34+
gradient
35+
griddata
36+
grps
1037
Haraszti
1138
Heiko
39+
imshow
40+
Incorrect
41+
infinitiy
42+
input
43+
inted
44+
iupac
45+
José
46+
keywith
47+
Kpage
1248
Kühbach
49+
levelname
50+
localzone
51+
lockin
52+
Lockin
1353
Lukas
54+
mainfile
1455
Markus
56+
metadata
1557
Mformatter
58+
miscellaneous
1659
Mozumder
17-
NFDI
18-
Nanonis
19-
PAMY
20-
Pielsticker
21-
Piezo
22-
Sandor
23-
Setpoint
24-
Shabih
25-
Sherjeel
26-
Tamás
27-
Yichen
28-
dataconverter
29-
filt
30-
lockin
60+
MPES
61+
multilines
3162
nanonis
63+
Nanonis
64+
NANONIS
3265
nanonispy
66+
nbins
67+
nbsp
68+
nchanns
69+
ndarray
70+
ndir
71+
nested
72+
NFDI
73+
nxdata
3374
nxdl
75+
nxdls
3476
nxformatted
3577
nxscan
3678
orcid
79+
organized
80+
PAMY
81+
Pielsticker
3782
piezo
83+
Piezo
3884
plottable
3985
pynxtools
86+
regrex
87+
rhksm
88+
Sandor
89+
scandata
90+
Scanfield
91+
SCANIT
92+
sctype
93+
Setpoint
94+
Shabih
95+
Sherjeel
96+
specdata
97+
spect
4098
spym
4199
subpackages
100+
Subpackages
101+
Tamás
102+
topo
103+
ureg
104+
valinit
105+
valtext
106+
Yichen
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Compatibility with pynxtools
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
python-version: 3.12
11+
12+
jobs:
13+
pynx_compatibility:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
pynxtools-version: ["latest"]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
submodules: recursive
25+
- name: Install uv and set the python version to ${{ env.python-version }}
26+
uses: astral-sh/setup-uv@v5
27+
with:
28+
python-version: ${{ env.python-version }}
29+
- name: Install pynxtools-spm
30+
run: |
31+
uv pip install ".[dev]"
32+
uv pip install coverage coveralls
33+
- name: Install nomad
34+
run: |
35+
uv pip install nomad-lab[infrastructure]@git+https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR.git
36+
- name: Install pynxtools release version ${{ matrix.pynxtools-version }}
37+
run: |
38+
if [ "${{ matrix.pynxtools-version }}" == "latest" ]; then
39+
uv pip install pynxtools
40+
else
41+
uv pip install pynxtools==${{ matrix.pynxtools-version }}
42+
fi
43+
- name: Run tests
44+
run: |
45+
pytest tests/.

.github/workflows/cruft_update.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Update repository with Cruft
2+
3+
permissions:
4+
contents: write
5+
pull-requests: write
6+
7+
on:
8+
schedule:
9+
- cron: "0 4 * * 1" # Every Monday at 4am
10+
workflow_dispatch: # manually
11+
12+
env:
13+
python-version: 3.12
14+
15+
jobs:
16+
update:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
include:
22+
- add-paths: .
23+
body: Use this to merge the changes to this repository.
24+
branch: cruft/update
25+
commit-message: "chore: accept new Cruft update"
26+
title: New updates detected with Cruft
27+
- add-paths: .cruft.json
28+
body: Use this to reject the changes in this repository.
29+
branch: cruft/reject
30+
commit-message: "chore: reject new Cruft update"
31+
title: Reject new updates detected with Cruft
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Install uv and set the python version to ${{ env.python-version }}
36+
uses: astral-sh/setup-uv@v5
37+
with:
38+
python-version: ${{ env.python-version }}
39+
40+
- name: Install Cruft
41+
run: uv pip install cruft
42+
43+
- name: Check if update is available
44+
continue-on-error: false
45+
id: check
46+
run: |
47+
CHANGES=0
48+
if [ -f .cruft.json ]; then
49+
if ! cruft check; then
50+
CHANGES=1
51+
fi
52+
else
53+
echo "No .cruft.json file"
54+
fi
55+
56+
echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT"
57+
58+
- name: Run update if available
59+
if: steps.check.outputs.has_changes == '1'
60+
run: |
61+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
62+
git config --global user.name "GitHub"
63+
64+
cruft update --skip-apply-ask --refresh-private-variables
65+
# git restore --staged .
66+
67+
- name: Create pull request
68+
if: steps.check.outputs.has_changes == '1'
69+
uses: peter-evans/create-pull-request@v4
70+
with:
71+
token: ${{ secrets.GITHUB_TOKEN }}
72+
add-paths: ${{ matrix.add-paths }}
73+
commit-message: ${{ matrix.commit-message }}
74+
branch: ${{ matrix.branch }}
75+
delete-branch: true
76+
branch-suffix: timestamp
77+
title: ${{ matrix.title }}
78+
body: |
79+
This is an autogenerated PR. ${{ matrix.body }}
80+
81+
[Cruft](https://cruft.github.io/cruft/) has detected updates from the Cookiecutter repository.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
python-version: 3.12
1010

1111
permissions:
12-
contents: write
12+
contents: write
1313
jobs:
1414
deploy:
1515
runs-on: ubuntu-latest
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
git config user.name github-actions[bot]
2424
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
25-
25+
2626
- name: Install uv and set the python version to ${{ env.python-version }}
2727
uses: astral-sh/setup-uv@v5
2828
with:
@@ -42,4 +42,4 @@ jobs:
4242
4343
- name: Build and Deploy
4444
run: |
45-
mkdocs gh-deploy --force --remote-branch gh-pages
45+
mkdocs gh-deploy --force --remote-branch gh-pages
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: NOMAD dependencies compatibility
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
# Run workflow only when there are changes in pyproject.toml or dev-requirements.txt
11+
# paths:
12+
# - 'pyproject.toml'
13+
# - 'dev-requirements.txt'
14+
15+
env:
16+
python-version: 3.12
17+
18+
jobs:
19+
validate_dependencies:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout pynxtools-spm
24+
uses: actions/checkout@v4
25+
26+
- name: Checkout NOMAD from GitLab
27+
run: |
28+
git clone --depth 1 --branch develop --recurse-submodules https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR.git nomad
29+
git submodule update --init --recursive --depth 1
30+
- name: Add pynxtools-spm dependency in NOMAD test_plugins.txt
31+
working-directory: ./nomad
32+
run: |
33+
echo "" >> test_plugins.txt
34+
echo "pynxtools-spm@git+https://github.com/FAIRmat-NFDI/pynxtools-spm.git@${{ github.head_ref || github.ref_name }}" >> test_plugins.txt
35+
- name: Install uv and set the python version to ${{ env.python-version }}
36+
uses: astral-sh/setup-uv@v5
37+
with:
38+
python-version: ${{ env.python-version }}
39+
- name: Generate (dev-)requirements.txt from modified pyproject.toml
40+
working-directory: ./nomad
41+
run: |
42+
uv pip compile --universal -p ${{ env.python-version }} --annotation-style=line --extra=infrastructure --extra=parsing --output-file=requirements.txt pyproject.toml
43+
uv pip compile --universal -p ${{ env.python-version }} --annotation-style=line --extra=dev --extra=infrastructure --extra=parsing --output-file=requirements-dev.txt requirements.txt pyproject.toml
44+
uv pip compile --universal -p ${{ env.python-version }} --annotation-style=line --output-file=requirements-plugins.txt --unsafe-package nomad-lab -c requirements-dev.txt test_plugins.txt
45+
- name: Install NOMAD dependencies with pynxtools from current branch
46+
working-directory: ./nomad
47+
run: |
48+
uv pip install -r requirements-plugins.txt -c requirements-dev.txt --prerelease=allow
49+
env:
50+
PYTHONPATH: "" # Ensure no pre-installed packages interfere with the test

0 commit comments

Comments
 (0)