pyNexafs 0.1.0b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pynexafs-0.1.0b1/.github/workflows/linting.yml +47 -0
- pynexafs-0.1.0b1/.github/workflows/semver.yml +249 -0
- pynexafs-0.1.0b1/.github/workflows/test.yml +62 -0
- pynexafs-0.1.0b1/.gitignore +166 -0
- pynexafs-0.1.0b1/.pre-commit-config.yaml +67 -0
- pynexafs-0.1.0b1/.readthedocs.yaml +42 -0
- pynexafs-0.1.0b1/LICENSE +21 -0
- pynexafs-0.1.0b1/PKG-INFO +39 -0
- pynexafs-0.1.0b1/README.rst +69 -0
- pynexafs-0.1.0b1/docs/CHANGELOG.rst +50 -0
- pynexafs-0.1.0b1/docs/conf.py +158 -0
- pynexafs-0.1.0b1/docs/examples/example_MEX2.ipynb +724 -0
- pynexafs-0.1.0b1/docs/source/_static/index.css +8 -0
- pynexafs-0.1.0b1/docs/source/_templates/custom_class_template.rst +32 -0
- pynexafs-0.1.0b1/docs/source/_templates/custom_module_template.rst +66 -0
- pynexafs-0.1.0b1/docs/source/api.rst +13 -0
- pynexafs-0.1.0b1/docs/source/examples.rst +301 -0
- pynexafs-0.1.0b1/docs/source/index.rst +48 -0
- pynexafs-0.1.0b1/docs/source/install.rst +57 -0
- pynexafs-0.1.0b1/docs/source/support.rst +19 -0
- pynexafs-0.1.0b1/pyNexafs/__init__.py +15 -0
- pynexafs-0.1.0b1/pyNexafs/__main__.py +52 -0
- pynexafs-0.1.0b1/pyNexafs/gui/__init__.py +1 -0
- pynexafs-0.1.0b1/pyNexafs/gui/data_browser.py +92 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/flaticon/normalization.png +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/flaticon/normalization_b&w.png +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/normalisation.pdn +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/normalisation.png +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/normalisation2_dark.pdn +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/normalisation2_dark.png +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/normalisation2_light.pdn +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/icons/normalisation2_light.png +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/qant_converter.py +69 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/__init__.py +3 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/converter.py +931 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/fileloader.py +511 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/fitting/nexafs_fits.py +64 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/graphing/__init__.py +1 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/graphing/matplotlib/graphs.py +209 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/graphing/matplotlib/styling.py +176 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/graphing/matplotlib/widgets.py +1092 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/graphing/plotly_graphs.py +35 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/io/__init__.py +0 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/io/dir_selection.py +221 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/io/fileviewer.py +2227 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/normaliser.py.old +806 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/reducer.py +554 -0
- pynexafs-0.1.0b1/pyNexafs/gui/widgets/viewer.py +463 -0
- pynexafs-0.1.0b1/pyNexafs/nexafs/__init__.py +26 -0
- pynexafs-0.1.0b1/pyNexafs/nexafs/fitting/functions.py +108 -0
- pynexafs-0.1.0b1/pyNexafs/nexafs/normalisation/__init__.py +30 -0
- pynexafs-0.1.0b1/pyNexafs/nexafs/normalisation/norm_settings.py +1120 -0
- pynexafs-0.1.0b1/pyNexafs/nexafs/normalisation/scan_normalised.py +1598 -0
- pynexafs-0.1.0b1/pyNexafs/nexafs/scan.py +845 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/__init__.py +29 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/_base.py +2268 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/au/__init__.py +14 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/au/aus_sync/MEX1.py +786 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/au/aus_sync/MEX1_relabels.py +131 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/au/aus_sync/MEX2.py +1156 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/au/aus_sync/MEX2_relabels.py +300 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/au/aus_sync/SXR.py +461 -0
- pynexafs-0.1.0b1/pyNexafs/parsers/au/aus_sync/__init__.py +11 -0
- pynexafs-0.1.0b1/pyNexafs/resources.py +18 -0
- pynexafs-0.1.0b1/pyNexafs/utils/__init__.py +18 -0
- pynexafs-0.1.0b1/pyNexafs/utils/decorators.py +226 -0
- pynexafs-0.1.0b1/pyNexafs/utils/mda.py +1264 -0
- pynexafs-0.1.0b1/pyNexafs/utils/reduction.py +680 -0
- pynexafs-0.1.0b1/pyNexafs/utils/sizes.py +42 -0
- pynexafs-0.1.0b1/pyNexafs.egg-info/PKG-INFO +39 -0
- pynexafs-0.1.0b1/pyNexafs.egg-info/SOURCES.txt +106 -0
- pynexafs-0.1.0b1/pyNexafs.egg-info/dependency_links.txt +1 -0
- pynexafs-0.1.0b1/pyNexafs.egg-info/requires.txt +4 -0
- pynexafs-0.1.0b1/pyNexafs.egg-info/top_level.txt +2 -0
- pynexafs-0.1.0b1/pyproject.toml +229 -0
- pynexafs-0.1.0b1/setup.cfg +4 -0
- pynexafs-0.1.0b1/tests/parsers/au/test_parser_au-MEX1.py +0 -0
- pynexafs-0.1.0b1/tests/parsers/au/test_parser_au-MEX2.py +97 -0
- pynexafs-0.1.0b1/tests/parsers/au/test_parser_au-SXR.py +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX1/MEX1_40747.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX1/MEX1_40747_processed.asc +307 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX1/MEX1_40747_processed.xdi +229 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2024-03/MEX2_5640.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2024-03/MEX2_5640_processed.xdi +273 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2024-03/MEX2_5641.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2024-03/MEX2_5641_processed.xdi +273 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2024-03/MEX2_5642.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2024-03/MEX2_5642_processed.xdi +273 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2025-03/MEX2_13366.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2025-03/MEX2_13366_processed.xdi +557 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2025-03/MEX2_13385.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2025-03/MEX2_13385_processed.xdi +557 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2025-03/MEX2_13386.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/MEX2/2025-03/MEX2_13386_processed.xdi +557 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129598.asc +871 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129598.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129930.asc +571 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129930.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129931.asc +571 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129931.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129932.asc +571 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129932.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129933.asc +571 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129933.mda +0 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129934.asc +571 -0
- pynexafs-0.1.0b1/tests/test_data/au/SXR/sxr129934.mda +0 -0
- pynexafs-0.1.0b1/tests/test_parser_base.py +499 -0
- pynexafs-0.1.0b1/tests/test_scan.py +11 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Linting 📜 (NumpyDoc, Ruff & Black)
|
|
2
|
+
run-name: ${{ github.actor }} - Linting 📜 (NumpyDoc, Ruff & Black)
|
|
3
|
+
|
|
4
|
+
concurrency:
|
|
5
|
+
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}-linting
|
|
6
|
+
cancel-in-progress: true
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
runs-on: ${{ matrix.os }}-latest
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
os: [Ubuntu]
|
|
20
|
+
python-version: ["3.13", "3.12", "3.11"]
|
|
21
|
+
include:
|
|
22
|
+
- os: Windows
|
|
23
|
+
python-version: "3.13"
|
|
24
|
+
- os: macOS
|
|
25
|
+
python-version: "3.13"
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
29
|
+
uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: ${{ matrix.python-version }}
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: |
|
|
34
|
+
python -m pip install --upgrade pip
|
|
35
|
+
pip install numpydoc black ruff
|
|
36
|
+
|
|
37
|
+
- name: Analysing the code with Ruff
|
|
38
|
+
run: |
|
|
39
|
+
ruff check
|
|
40
|
+
|
|
41
|
+
- name: Analysing the code with black
|
|
42
|
+
run: |
|
|
43
|
+
black --check .
|
|
44
|
+
|
|
45
|
+
- name: Analysing the code with numpydoc
|
|
46
|
+
run: | # Exclude test and gui files.
|
|
47
|
+
numpydoc lint --config . $(git ls-files -- '*.py' ':!:*tests/*' ':!:*gui/*')
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# Based on Python Semantic Release (PSR) and PYPI (Python Package Index) as of July-2025
|
|
2
|
+
# [1] https://python-semantic-release.readthedocs.io/en/stable/configuration/automatic-releases/github-actions.html#examples
|
|
3
|
+
# [2] https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
|
|
4
|
+
|
|
5
|
+
name: Python 🐍 Semantic Versioning
|
|
6
|
+
run-name: ${{ github.actor }} - Python 🐍 Semantic Versioning
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.ref_name }}-release
|
|
10
|
+
cancel-in-progress: false
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
inputs:
|
|
15
|
+
prerelease:
|
|
16
|
+
description: 'Run as a prerelease?'
|
|
17
|
+
required: true
|
|
18
|
+
type: boolean
|
|
19
|
+
default: true
|
|
20
|
+
prerelease_token:
|
|
21
|
+
description: 'Token for prerelease'
|
|
22
|
+
required: false
|
|
23
|
+
type: choice
|
|
24
|
+
options:
|
|
25
|
+
- alpha
|
|
26
|
+
- beta
|
|
27
|
+
- rc
|
|
28
|
+
default: 'beta'
|
|
29
|
+
push:
|
|
30
|
+
|
|
31
|
+
permissions:
|
|
32
|
+
contents: read
|
|
33
|
+
|
|
34
|
+
jobs:
|
|
35
|
+
semver-release:
|
|
36
|
+
name: Run Python 🐍 Semantic Version to stamp distribution 📦
|
|
37
|
+
# Only run this job on the master account.
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
# defaults: # https://github.com/actions/upload-artifact/issues/232#issuecomment-1065422577
|
|
40
|
+
# run:
|
|
41
|
+
# working-directory: ./pyNexafs
|
|
42
|
+
permissions:
|
|
43
|
+
contents: write
|
|
44
|
+
outputs:
|
|
45
|
+
released: ${{ steps.is_released.outputs.released }}
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- name: Use workflow inputs for pre-release
|
|
49
|
+
shell: bash
|
|
50
|
+
if: ${{ github.event == 'workflow_dispatch' }}
|
|
51
|
+
run: |
|
|
52
|
+
echo "prerelease=${{ github.event.inputs.prerelease }}" >> $GITHUB_ENV
|
|
53
|
+
echo "prerelease_token=${{ github.event.inputs.prerelease_token }}" >> $GITHUB_ENV
|
|
54
|
+
- name: Set default value for pre-release
|
|
55
|
+
shell: bash
|
|
56
|
+
if: ${{ github.event != 'workflow_dispatch' }}
|
|
57
|
+
run: |
|
|
58
|
+
echo "prerelease=true" >> $GITHUB_ENV
|
|
59
|
+
echo "prerelease_token=beta" >> $GITHUB_ENV
|
|
60
|
+
- name: Display pre-release input
|
|
61
|
+
shell: bash
|
|
62
|
+
run: |
|
|
63
|
+
echo "Python SemVer pre-release?: $prerelease"
|
|
64
|
+
# Note: We checkout the repository at the branch that triggered the workflow
|
|
65
|
+
# with the entire history to ensure to match PSR's release branch detection
|
|
66
|
+
# and history evaluation.
|
|
67
|
+
# However, we forcefully reset the branch to the workflow sha because it is
|
|
68
|
+
# possible that the branch was updated while the workflow was running. This
|
|
69
|
+
# prevents accidentally releasing un-evaluated changes.
|
|
70
|
+
- name: Setup | Checkout Repository on Release Branch
|
|
71
|
+
uses: actions/checkout@v4
|
|
72
|
+
with:
|
|
73
|
+
ref: ${{ github.ref_name }}
|
|
74
|
+
fetch-depth: 0
|
|
75
|
+
|
|
76
|
+
- name: Setup | Force release branch to be at workflow sha
|
|
77
|
+
run: |
|
|
78
|
+
git reset --hard ${{ github.sha }}
|
|
79
|
+
|
|
80
|
+
- name: Evaluate | Verify upstream has NOT changed
|
|
81
|
+
# Last chance to abort before causing an error as another PR/push was applied to
|
|
82
|
+
# the upstream branch while this workflow was running. This is important
|
|
83
|
+
# because we are committing a version change (--commit). You may omit this step
|
|
84
|
+
# if you have 'commit: false' in your configuration.
|
|
85
|
+
#
|
|
86
|
+
# You may consider moving this to a repo script and call it from this step instead
|
|
87
|
+
# of writing it in-line.
|
|
88
|
+
shell: bash
|
|
89
|
+
run: |
|
|
90
|
+
set +o pipefail
|
|
91
|
+
|
|
92
|
+
UPSTREAM_BRANCH_NAME="$(git status -sb | head -n 1 | cut -d' ' -f2 | grep -E '\.{3}' | cut -d'.' -f4)"
|
|
93
|
+
printf '%s\n' "Upstream branch name: $UPSTREAM_BRANCH_NAME"
|
|
94
|
+
|
|
95
|
+
set -o pipefail
|
|
96
|
+
|
|
97
|
+
if [ -z "$UPSTREAM_BRANCH_NAME" ]; then
|
|
98
|
+
printf >&2 '%s\n' "::error::Unable to determine upstream branch name!"
|
|
99
|
+
exit 1
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
git fetch "${UPSTREAM_BRANCH_NAME%%/*}"
|
|
103
|
+
|
|
104
|
+
if ! UPSTREAM_SHA="$(git rev-parse "$UPSTREAM_BRANCH_NAME")"; then
|
|
105
|
+
printf >&2 '%s\n' "::error::Unable to determine upstream branch sha!"
|
|
106
|
+
exit 1
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
HEAD_SHA="$(git rev-parse HEAD)"
|
|
110
|
+
|
|
111
|
+
if [ "$HEAD_SHA" != "$UPSTREAM_SHA" ]; then
|
|
112
|
+
printf >&2 '%s\n' "[HEAD SHA] $HEAD_SHA != $UPSTREAM_SHA [UPSTREAM SHA]"
|
|
113
|
+
printf >&2 '%s\n' "::error::Upstream has changed, aborting release..."
|
|
114
|
+
exit 1
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
printf '%s\n' "Verified upstream branch has not changed, continuing with release..."
|
|
118
|
+
|
|
119
|
+
# - name: Delete Previous | Distribution Artifacts
|
|
120
|
+
# uses: actions/delete-artifact@v4 ???
|
|
121
|
+
# with:
|
|
122
|
+
# name: distribution-artifacts
|
|
123
|
+
# path: dist
|
|
124
|
+
- name: Action | Semantic Version Release
|
|
125
|
+
id: release
|
|
126
|
+
# Adjust tag with desired version if applicable.
|
|
127
|
+
# https://python-semantic-release.readthedocs.io/en/stable/configuration/automatic-releases/github-actions.html
|
|
128
|
+
uses: python-semantic-release/python-semantic-release@v10.2.0
|
|
129
|
+
with:
|
|
130
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
131
|
+
git_committer_name: "github-actions"
|
|
132
|
+
git_committer_email: "actions@users.noreply.github.com"
|
|
133
|
+
build: true
|
|
134
|
+
prerelease: ${{ env.prerelease == 'true' }}
|
|
135
|
+
prerelease_token: ${{ env.prerelease_token }}
|
|
136
|
+
changelog: true
|
|
137
|
+
verbosity: 2
|
|
138
|
+
no_operation_mode: ${{ github.repository_owner != 'xraysoftmat'}}
|
|
139
|
+
|
|
140
|
+
- name: Env | Check if released and log conditionals
|
|
141
|
+
id: is_released
|
|
142
|
+
run: |
|
|
143
|
+
echo "Success: ${{ steps.release.outcome }} ; ${{ steps.release.outcome == 'success' }}"
|
|
144
|
+
echo "Ownership: ${{ github.repository_owner }} ; ${{ github.repository_owner == 'xraysoftmat' }}"
|
|
145
|
+
echo "Released: ${{ steps.release.outputs.released }}"
|
|
146
|
+
echo "Branch: ${{ github.ref }}; ${{ github.ref == 'refs/heads/main' }}"
|
|
147
|
+
echo "released=${{ steps.release.outcome && github.ref == 'refs/heads/main' && steps.release.outputs.released && github.repository_owner == 'xraysoftmat' && steps.release.outcome == 'success' }}" >> "$GITHUB_OUTPUT"
|
|
148
|
+
|
|
149
|
+
- name: Display | Release Information
|
|
150
|
+
if: |
|
|
151
|
+
success() && steps.is_released.outputs.released
|
|
152
|
+
run: |
|
|
153
|
+
echo "Process Release: ${{ steps.is_released.outputs.released }}"
|
|
154
|
+
echo "Release Tag: ${{ steps.release.outputs.tag }}"
|
|
155
|
+
echo "Release Version: ${{ steps.release.outputs.version }}"
|
|
156
|
+
echo "Release Branch: ${{ github.ref_name }}"
|
|
157
|
+
echo "Release Prerelease: ${{ env.prerelease }}"
|
|
158
|
+
|
|
159
|
+
- name: Publish | Upload to GitHub Release Assets
|
|
160
|
+
uses: python-semantic-release/publish-action@v10.2.0
|
|
161
|
+
if: |
|
|
162
|
+
success() && steps.is_released.outputs.released == 'true'
|
|
163
|
+
with:
|
|
164
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
165
|
+
tag: ${{ steps.release.outputs.tag }}
|
|
166
|
+
|
|
167
|
+
- name: Upload | Distribution Artifacts
|
|
168
|
+
uses: actions/upload-artifact@v4
|
|
169
|
+
if: |
|
|
170
|
+
success() && steps.is_released.outputs.released == 'true'
|
|
171
|
+
with:
|
|
172
|
+
name: distribution-artifacts
|
|
173
|
+
path: ./dist
|
|
174
|
+
overwrite: true
|
|
175
|
+
if-no-files-found: error
|
|
176
|
+
|
|
177
|
+
- name: Publish | Upload to GitHub Release Assets
|
|
178
|
+
uses: python-semantic-release/publish-action@v10.2.0
|
|
179
|
+
if: |
|
|
180
|
+
success() && steps.is_released.outputs.released == 'true'
|
|
181
|
+
with:
|
|
182
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
183
|
+
tag: ${{ steps.release.outputs.tag }}
|
|
184
|
+
|
|
185
|
+
pypi-deploy:
|
|
186
|
+
# 1. Separate out the deploy step from the publish step to run each step at
|
|
187
|
+
# the least amount of token privilege
|
|
188
|
+
# 2. Also, deployments can fail, and its better to have a separate job if you need to retry
|
|
189
|
+
# and it won't require reversing the release.
|
|
190
|
+
name: Publish Python 🐍 distribution 📦 release to PyPI
|
|
191
|
+
runs-on: ubuntu-latest
|
|
192
|
+
needs: semver-release # match the job name above
|
|
193
|
+
if: |
|
|
194
|
+
success() && needs.semver-release.outputs.released == 'true'
|
|
195
|
+
defaults:
|
|
196
|
+
run:
|
|
197
|
+
working-directory: ./pyNexafs
|
|
198
|
+
# Only run this job on the master account, only publish to PyPI on tag pushes
|
|
199
|
+
permissions:
|
|
200
|
+
contents: read
|
|
201
|
+
id-token: write
|
|
202
|
+
|
|
203
|
+
environment:
|
|
204
|
+
name: pypi
|
|
205
|
+
url: https://pypi.org/p/pyNexafs
|
|
206
|
+
|
|
207
|
+
steps:
|
|
208
|
+
- name: Setup | Download Build Artifacts
|
|
209
|
+
uses: actions/download-artifact@v4
|
|
210
|
+
id: artifact-download
|
|
211
|
+
with:
|
|
212
|
+
name: distribution-artifacts # Match the name used in the upload step
|
|
213
|
+
path: pyNexafs/dist # Match the path used in the upload step
|
|
214
|
+
|
|
215
|
+
- name: Publish package distribution 📦 to PyPI
|
|
216
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
217
|
+
with:
|
|
218
|
+
packages-dir: pyNexafs/dist
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
### Not currently using TestPyPI, but can be enabled if needed.
|
|
222
|
+
# testpypi-deploy:
|
|
223
|
+
# name: Publish Python 🐍 distribution 📦 to TestPyPI
|
|
224
|
+
# runs-on: ubuntu-latest
|
|
225
|
+
# # Only run this job on the master account, only publish to TestPyPI on tag pushes
|
|
226
|
+
# needs: semver-release # match the job name above
|
|
227
|
+
# if: |
|
|
228
|
+
# success() && needs.semver-release.outputs.released == 'true'
|
|
229
|
+
# environment:
|
|
230
|
+
# name: testpypi
|
|
231
|
+
# url: https://test.pypi.org/p/pyNexafs
|
|
232
|
+
|
|
233
|
+
# permissions:
|
|
234
|
+
# contents: read
|
|
235
|
+
# id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
236
|
+
|
|
237
|
+
# steps:
|
|
238
|
+
# - name: Setup | Download Build Artifacts
|
|
239
|
+
# uses: actions/download-artifact@v4
|
|
240
|
+
# id: artifact-download
|
|
241
|
+
# with:
|
|
242
|
+
# name: distribution-artifacts # Match the name used in the upload step
|
|
243
|
+
# path: pyNexafs/dist # Match the path used in the upload step
|
|
244
|
+
|
|
245
|
+
# - name: Publish distribution 📦 to TestPyPI
|
|
246
|
+
# uses: pypa/gh-action-pypi-publish@release/v1
|
|
247
|
+
# with:
|
|
248
|
+
# repository-url: https://test.pypi.org/legacy/
|
|
249
|
+
# packages-dir: pyNexafs/dist
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: Tests 🔧 (PyTest, Coveralls)
|
|
2
|
+
run-name: ${{ github.actor }} - Tests 🔧 (PyTest, Coveralls)
|
|
3
|
+
|
|
4
|
+
concurrency:
|
|
5
|
+
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}-tests
|
|
6
|
+
cancel-in-progress: true
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ${{ matrix.os }}-latest
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
os: [Ubuntu]
|
|
20
|
+
python-version: ["3.13", "3.12", "3.11"]
|
|
21
|
+
# sphinx-version:
|
|
22
|
+
# ["sphinx==6.0", "sphinx==6.2", "sphinx==7.0", "sphinx>=7.3"]
|
|
23
|
+
include:
|
|
24
|
+
- os: Windows
|
|
25
|
+
python-version: "3.13"
|
|
26
|
+
- os: MacOS
|
|
27
|
+
python-version: "3.13"
|
|
28
|
+
# sphinx-version: "sphinx" # version shouldn't really matter here
|
|
29
|
+
defaults:
|
|
30
|
+
run:
|
|
31
|
+
shell: bash -eo pipefail {0} # Fail on any error (-e), fail on any failed command in a pipeline.
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Python setup
|
|
36
|
+
uses: actions/setup-python@v5
|
|
37
|
+
with:
|
|
38
|
+
python-version: ${{ matrix.python-version }}
|
|
39
|
+
|
|
40
|
+
- name: Setup environment
|
|
41
|
+
run: |
|
|
42
|
+
python -m pip install --upgrade pip wheel setuptools uv
|
|
43
|
+
python -m pip install coveralls
|
|
44
|
+
python -m pip list
|
|
45
|
+
# python -m pip install ${{ matrix.sphinx-version }}
|
|
46
|
+
|
|
47
|
+
- name: Install
|
|
48
|
+
run: |
|
|
49
|
+
uv pip install . --group dev --group docs --system
|
|
50
|
+
pip list
|
|
51
|
+
# system is used to install the package globally in the test environment.
|
|
52
|
+
|
|
53
|
+
- name: Run test suite
|
|
54
|
+
run: |
|
|
55
|
+
pytest -v --pyargs .
|
|
56
|
+
|
|
57
|
+
- name: Test coverage
|
|
58
|
+
run: |
|
|
59
|
+
coverage run --source=pyNexafs -m pytest tests/
|
|
60
|
+
coveralls
|
|
61
|
+
env:
|
|
62
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# PyCharm
|
|
156
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
158
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
159
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
160
|
+
#.idea/
|
|
161
|
+
|
|
162
|
+
# Datafiles
|
|
163
|
+
.asc
|
|
164
|
+
|
|
165
|
+
tests/archive*
|
|
166
|
+
.vscode*
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
### `Pre-commit` module configuration file
|
|
2
|
+
# Can be installed using `pip install pre-commit`
|
|
3
|
+
# The pre-commit hooks can then be installed using:
|
|
4
|
+
# >>> pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push
|
|
5
|
+
# All checks are run by default when `git <action>` is run for the given hook, i.e. commit.
|
|
6
|
+
|
|
7
|
+
repos:
|
|
8
|
+
# Pre-commit hooks for basic Python processing
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v5.0.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: check-added-large-files
|
|
13
|
+
exclude: '^tests/test_data/.*\.mda$'
|
|
14
|
+
- id: check-toml
|
|
15
|
+
- id: check-yaml
|
|
16
|
+
- id: end-of-file-fixer
|
|
17
|
+
- id: mixed-line-ending
|
|
18
|
+
- id: trailing-whitespace
|
|
19
|
+
exclude: '^tests/test_data/.*$'
|
|
20
|
+
|
|
21
|
+
# Ruff - for linting and formatting
|
|
22
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
23
|
+
# Ruff version.
|
|
24
|
+
rev: v0.12.7
|
|
25
|
+
hooks:
|
|
26
|
+
# Run the linter.
|
|
27
|
+
- id: ruff-check
|
|
28
|
+
args: [ --fix ]
|
|
29
|
+
# Run the formatter.
|
|
30
|
+
- id: ruff-format
|
|
31
|
+
|
|
32
|
+
# Black - for standard code formatting
|
|
33
|
+
- repo: https://github.com/psf/black
|
|
34
|
+
rev: 24.10.0
|
|
35
|
+
hooks:
|
|
36
|
+
- id: black
|
|
37
|
+
# extend-exclude: '^tests/test_data/.*$'
|
|
38
|
+
|
|
39
|
+
# NumPyDoc - for docstring validation
|
|
40
|
+
- repo: https://github.com/numpy/numpydoc
|
|
41
|
+
rev: v1.8.0
|
|
42
|
+
hooks:
|
|
43
|
+
- id: numpydoc-validation
|
|
44
|
+
exclude: '^test.*$'
|
|
45
|
+
|
|
46
|
+
# Python Semantic Release & commitizen - for automatic versioning
|
|
47
|
+
# NOTE: The `pre-commit install` has a default hook-type of [pre-commit], but not [pre-push] or [commit-msg].
|
|
48
|
+
# To install these hooks, you also need to run
|
|
49
|
+
# >>> pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push
|
|
50
|
+
- repo: https://github.com/commitizen-tools/commitizen
|
|
51
|
+
rev: v4.8.3
|
|
52
|
+
hooks:
|
|
53
|
+
- id: commitizen
|
|
54
|
+
stages: [commit-msg]
|
|
55
|
+
- id: commitizen-branch
|
|
56
|
+
stages: [pre-push]
|
|
57
|
+
|
|
58
|
+
# Use "pre-commit install --hook-type commit-msg" to install, pre-commit install doesn't work.
|
|
59
|
+
- repo: https://github.com/opensource-nepal/commitlint
|
|
60
|
+
rev: v1.3.0
|
|
61
|
+
hooks:
|
|
62
|
+
- id: commitlint
|
|
63
|
+
stages: [commit-msg]
|
|
64
|
+
# args: [--config-path, .github/commitlint.yml]
|
|
65
|
+
additional_dependencies:
|
|
66
|
+
- commitlint
|
|
67
|
+
- commitizen
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# .readthedocs.yaml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# python:
|
|
9
|
+
# install:
|
|
10
|
+
# - method: pip
|
|
11
|
+
# path: .
|
|
12
|
+
# extra_requirements:
|
|
13
|
+
# - docs
|
|
14
|
+
|
|
15
|
+
# Set the OS, Python version and other tools you might need
|
|
16
|
+
build:
|
|
17
|
+
os: ubuntu-lts-latest
|
|
18
|
+
tools:
|
|
19
|
+
python: "3.13"
|
|
20
|
+
# You can also specify other tool versions:
|
|
21
|
+
# nodejs: "19"
|
|
22
|
+
# rust: "1.64"
|
|
23
|
+
# golang: "1.19"
|
|
24
|
+
jobs:
|
|
25
|
+
install:
|
|
26
|
+
- pip install --group 'docs'
|
|
27
|
+
|
|
28
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
29
|
+
sphinx:
|
|
30
|
+
configuration: docs/conf.py
|
|
31
|
+
|
|
32
|
+
# Optionally build your docs in additional formats such as PDF and ePub
|
|
33
|
+
formats:
|
|
34
|
+
- pdf
|
|
35
|
+
# - epub
|
|
36
|
+
|
|
37
|
+
# Optional but recommended, declare the Python requirements required
|
|
38
|
+
# to build your documentation
|
|
39
|
+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
40
|
+
# python:
|
|
41
|
+
# install:
|
|
42
|
+
# - requirements: docs/requirements.txt
|
pynexafs-0.1.0b1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Matt Gebert
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyNexafs
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: A package for processing and analysing NEXAFS data.
|
|
5
|
+
Author-email: Matthew Gebert <matthew.gebert@monash.edu>
|
|
6
|
+
Maintainer-email: Matthew Gebert <matthew.gebert@monash.edu>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 Matt Gebert
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: code, https://github.com/xraysoftmat/pyNexafs
|
|
30
|
+
Project-URL: documentation, https://pyNexafs.readthedocs.io/en/latest/
|
|
31
|
+
Keywords: NEXAFS,XANES,Near,Edge,X-ray,Absorption,Fine,Structure,Spectroscopy,Optical Data,XAS,Synchrotron
|
|
32
|
+
Requires-Python: >=3.11
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
License-File: LICENSE
|
|
35
|
+
Requires-Dist: numpy
|
|
36
|
+
Requires-Dist: overrides
|
|
37
|
+
Requires-Dist: scipy
|
|
38
|
+
Requires-Dist: xdrlib3
|
|
39
|
+
Dynamic: license-file
|