pykmclib 0.0.1__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.
- pykmclib-0.0.1/.github/workflows/ci.yml +125 -0
- pykmclib-0.0.1/.github/workflows/wheels.yml +137 -0
- pykmclib-0.0.1/.gitignore +231 -0
- pykmclib-0.0.1/.python-version +1 -0
- pykmclib-0.0.1/CMakeLists.txt +24 -0
- pykmclib-0.0.1/LICENSE +674 -0
- pykmclib-0.0.1/PKG-INFO +254 -0
- pykmclib-0.0.1/README.md +213 -0
- pykmclib-0.0.1/conda/README.md +37 -0
- pykmclib-0.0.1/conda/recipe/meta.yaml +73 -0
- pykmclib-0.0.1/cxx/CMakeLists.txt +170 -0
- pykmclib-0.0.1/cxx/bindings/common.h +43 -0
- pykmclib-0.0.1/cxx/bindings/configuration.cpp +29 -0
- pykmclib-0.0.1/cxx/bindings/coordinate.cpp +56 -0
- pykmclib-0.0.1/cxx/bindings/custom.cpp +21 -0
- pykmclib-0.0.1/cxx/bindings/interactions.cpp +44 -0
- pykmclib-0.0.1/cxx/bindings/latticemap.cpp +50 -0
- pykmclib-0.0.1/cxx/bindings/latticemodel.cpp +22 -0
- pykmclib-0.0.1/cxx/bindings/module.cpp +21 -0
- pykmclib-0.0.1/cxx/bindings/mpicommons.cpp +13 -0
- pykmclib-0.0.1/cxx/bindings/ontheflymsd.cpp +19 -0
- pykmclib-0.0.1/cxx/bindings/process.cpp +66 -0
- pykmclib-0.0.1/cxx/bindings/random.cpp +19 -0
- pykmclib-0.0.1/cxx/bindings/ratecalculator.cpp +63 -0
- pykmclib-0.0.1/cxx/bindings/timer.cpp +10 -0
- pykmclib-0.0.1/cxx/bindings/typebucket.cpp +51 -0
- pykmclib-0.0.1/cxx/compat/random_device_entropy.cpp +25 -0
- pykmclib-0.0.1/cxx/mpiflag.h.in +10 -0
- pykmclib-0.0.1/docs/build-and-release.md +152 -0
- pykmclib-0.0.1/docs/porting-notes.md +140 -0
- pykmclib-0.0.1/docs/upstream-notes.md +103 -0
- pykmclib-0.0.1/pyproject.toml +161 -0
- pykmclib-0.0.1/scripts/gen_python_layer.py +122 -0
- pykmclib-0.0.1/scripts/gen_stubs.py +71 -0
- pykmclib-0.0.1/scripts/run_upstream_tests.py +212 -0
- pykmclib-0.0.1/scripts/upstream_info.py +73 -0
- pykmclib-0.0.1/src/pykmclib/Analysis/Composition.py +125 -0
- pykmclib-0.0.1/src/pykmclib/Analysis/OnTheFlyMSD.py +291 -0
- pykmclib-0.0.1/src/pykmclib/Analysis/ProcessStatistics.py +121 -0
- pykmclib-0.0.1/src/pykmclib/Analysis/TimeStepDistribution.py +108 -0
- pykmclib-0.0.1/src/pykmclib/Analysis/__init__.py +0 -0
- pykmclib-0.0.1/src/pykmclib/Backend/Backend.py +216 -0
- pykmclib-0.0.1/src/pykmclib/Backend/Custom.py +11 -0
- pykmclib-0.0.1/src/pykmclib/Backend/__init__.py +0 -0
- pykmclib-0.0.1/src/pykmclib/Backend/_backend.pyi +356 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCBaseProcess.py +109 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCBucketProcess.py +126 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCConfiguration.py +486 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCControlParameters.py +186 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCInteractions.py +329 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCLattice.py +242 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCLatticeModel.py +332 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCLocalConfiguration.py +178 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCProcess.py +487 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/KMCUnitCell.py +126 -0
- pykmclib-0.0.1/src/pykmclib/CoreComponents/__init__.py +0 -0
- pykmclib-0.0.1/src/pykmclib/Exceptions/Error.py +31 -0
- pykmclib-0.0.1/src/pykmclib/Exceptions/__init__.py +0 -0
- pykmclib-0.0.1/src/pykmclib/PluginInterfaces/KMCAnalysisPlugin.py +59 -0
- pykmclib-0.0.1/src/pykmclib/PluginInterfaces/KMCBreakerPlugin.py +66 -0
- pykmclib-0.0.1/src/pykmclib/PluginInterfaces/KMCRateCalculatorPlugin.py +174 -0
- pykmclib-0.0.1/src/pykmclib/PluginInterfaces/__init__.py +0 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/CheckUtilities.py +348 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/ConversionUtilities.py +280 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/CoordinateUtilities.py +146 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/PrintUtilities.py +61 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/SaveAndReadUtilities.py +81 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/Trajectory/LatticeTrajectory.py +207 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/Trajectory/Trajectory.py +86 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/Trajectory/XYZTrajectory.py +157 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/Trajectory/__init__.py +0 -0
- pykmclib-0.0.1/src/pykmclib/Utilities/__init__.py +0 -0
- pykmclib-0.0.1/src/pykmclib/__init__.py +81 -0
- pykmclib-0.0.1/src/pykmclib/cli.py +160 -0
- pykmclib-0.0.1/src/pykmclib/conf/__init__.py +1 -0
- pykmclib-0.0.1/src/pykmclib/conf/config.yaml +30 -0
- pykmclib-0.0.1/src/pykmclib/conf/model/diffusion1d.yaml +57 -0
- pykmclib-0.0.1/src/pykmclib/conf/model/script.yaml +20 -0
- pykmclib-0.0.1/src/pykmclib/py.typed +0 -0
- pykmclib-0.0.1/tests/test_cli.py +124 -0
- pykmclib-0.0.1/tests/test_containers.py +76 -0
- pykmclib-0.0.1/tests/test_custom_rate.py +87 -0
- pykmclib-0.0.1/tests/test_lifetimes.py +43 -0
- pykmclib-0.0.1/tests/test_package.py +81 -0
- pykmclib-0.0.1/tests/test_scripts.py +40 -0
- pykmclib-0.0.1/tests/test_simulation.py +76 -0
- pykmclib-0.0.1/third_party/KMCLib/LICENSE.txt +674 -0
- pykmclib-0.0.1/third_party/KMCLib/README.md +69 -0
- pykmclib-0.0.1/third_party/KMCLib/RELEASE_NOTES.md +42 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/CMakeLists.txt +144 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/INSTALL.md +87 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/custom/CMakeLists.txt +11 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/custom/bucketstestcalculator.cpp +132 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/custom/bucketstestcalculator.h +89 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/custom/isingtestcalculator.cpp +83 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/custom/isingtestcalculator.h +89 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/externals/Makefile +117 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/externals/README.md +21 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/externals/zip/README +1 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/externals/zip/md5.tar.gz +0 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/CMakeLists.txt +11 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/blocker.cpp +124 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/blocker.h +78 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/configuration.cpp +424 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/configuration.h +258 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/coordinate.cpp +46 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/coordinate.h +374 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/customrateprocess.cpp +119 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/customrateprocess.h +92 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/hash.cpp +145 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/hash.h +87 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/interactions.cpp +280 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/interactions.h +154 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/latticemap.cpp +303 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/latticemap.h +199 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/latticemodel.cpp +100 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/latticemodel.h +96 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/matcher.cpp +642 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/matcher.h +170 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/matchlist.cpp +201 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/matchlist.h +96 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/matchlistentry.cpp +197 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/matchlistentry.h +160 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/mpicommons.cpp +95 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/mpicommons.h +58 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/mpih.h +30 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/mpiroutines.cpp +136 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/mpiroutines.h +177 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/ontheflymsd.cpp +145 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/ontheflymsd.h +175 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/process.cpp +203 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/process.h +237 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/random.cpp +157 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/random.h +42 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/ratecalculator.cpp +74 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/ratecalculator.h +147 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/ratetable.cpp +79 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/ratetable.h +75 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/simulationtimer.cpp +40 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/simulationtimer.h +47 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/typebucket.cpp +87 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/src/typebucket.h +284 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/wrap/CMakeLists.txt +107 -0
- pykmclib-0.0.1/third_party/KMCLib/c++/wrap/backend.i +146 -0
- pykmclib-0.0.1/uv.lock +1651 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint:
|
|
15
|
+
name: ruff
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: astral-sh/setup-uv@v6
|
|
20
|
+
with:
|
|
21
|
+
enable-cache: true
|
|
22
|
+
# Only the linter is needed here, so the C++ extension is not built.
|
|
23
|
+
- run: uv sync --only-group dev --no-install-project
|
|
24
|
+
- run: uv run --no-sync ruff check .
|
|
25
|
+
- run: uv run --no-sync ruff format --check .
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
name: build + test (${{ matrix.os }}, cp${{ matrix.python }})
|
|
29
|
+
runs-on: ${{ matrix.os }}
|
|
30
|
+
strategy:
|
|
31
|
+
fail-fast: false
|
|
32
|
+
matrix:
|
|
33
|
+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, windows-latest]
|
|
34
|
+
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
- uses: astral-sh/setup-uv@v6
|
|
39
|
+
with:
|
|
40
|
+
enable-cache: true
|
|
41
|
+
|
|
42
|
+
- name: Install the toolchain (Linux)
|
|
43
|
+
run: sudo apt-get update && sudo apt-get install -y ninja-build
|
|
44
|
+
if: runner.os == 'Linux'
|
|
45
|
+
|
|
46
|
+
- name: Install the toolchain (macOS)
|
|
47
|
+
run: brew install ninja
|
|
48
|
+
if: runner.os == 'macOS'
|
|
49
|
+
|
|
50
|
+
- name: Install the toolchain (Windows)
|
|
51
|
+
run: choco install ninja -y
|
|
52
|
+
if: runner.os == 'Windows'
|
|
53
|
+
|
|
54
|
+
- name: Sync the environment
|
|
55
|
+
run: uv sync --all-groups --python ${{ matrix.python }}
|
|
56
|
+
|
|
57
|
+
- name: Run the test suite
|
|
58
|
+
run: uv run --python ${{ matrix.python }} pytest -q
|
|
59
|
+
|
|
60
|
+
- name: Run the upstream KMCLib unit tests
|
|
61
|
+
run: uv run --python ${{ matrix.python }} python scripts/run_upstream_tests.py --units
|
|
62
|
+
|
|
63
|
+
# Build for the interpreter of this job, not for the one in .python-version.
|
|
64
|
+
- name: Build wheel and sdist
|
|
65
|
+
run: uv build --python ${{ matrix.python }}
|
|
66
|
+
|
|
67
|
+
- name: Install the built wheel in a clean environment
|
|
68
|
+
if: runner.os != 'Windows'
|
|
69
|
+
shell: bash
|
|
70
|
+
run: |
|
|
71
|
+
uv venv "$RUNNER_TEMP/verify" --python ${{ matrix.python }}
|
|
72
|
+
uv pip install --python "$RUNNER_TEMP/verify/bin/python" dist/*.whl
|
|
73
|
+
"$RUNNER_TEMP/verify/bin/python" -c "import pykmclib; print(pykmclib.__version__)"
|
|
74
|
+
|
|
75
|
+
- name: Install the built wheel in a clean environment (Windows)
|
|
76
|
+
if: runner.os == 'Windows'
|
|
77
|
+
shell: pwsh
|
|
78
|
+
run: |
|
|
79
|
+
$venv = Join-Path $env:RUNNER_TEMP "verify"
|
|
80
|
+
uv venv $venv --python ${{ matrix.python }}
|
|
81
|
+
$python = Join-Path $venv "Scripts/python.exe"
|
|
82
|
+
$wheel = (Get-ChildItem dist/*.whl | Select-Object -First 1).FullName
|
|
83
|
+
uv pip install --python $python $wheel
|
|
84
|
+
& $python -c "import pykmclib; print(pykmclib.__version__)"
|
|
85
|
+
|
|
86
|
+
upstream:
|
|
87
|
+
name: vendored snapshot + upstream functional tests
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
steps:
|
|
90
|
+
# Full history: upstream_info.py reads the subtree sync commits.
|
|
91
|
+
- uses: actions/checkout@v4
|
|
92
|
+
with:
|
|
93
|
+
fetch-depth: 0
|
|
94
|
+
- uses: astral-sh/setup-uv@v6
|
|
95
|
+
with:
|
|
96
|
+
enable-cache: true
|
|
97
|
+
|
|
98
|
+
- name: Install the toolchain
|
|
99
|
+
run: sudo apt-get update && sudo apt-get install -y ninja-build
|
|
100
|
+
|
|
101
|
+
- run: uv sync --all-groups
|
|
102
|
+
|
|
103
|
+
# Nobody is supposed to edit third_party/KMCLib: it is a git subtree.
|
|
104
|
+
- name: The vendored snapshot must be untouched
|
|
105
|
+
run: |
|
|
106
|
+
if [ -n "$(git status --porcelain third_party/KMCLib)" ]; then
|
|
107
|
+
echo "third_party/KMCLib has local modifications - see docs/upstream-notes.md"
|
|
108
|
+
git status --porcelain third_party/KMCLib
|
|
109
|
+
exit 1
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
- name: Which upstream commit is vendored
|
|
113
|
+
run: uv run python scripts/upstream_info.py
|
|
114
|
+
|
|
115
|
+
# The Python front end is generated from the vendored sources.
|
|
116
|
+
- name: The generated Python layer must match the snapshot
|
|
117
|
+
run: uv run python scripts/gen_python_layer.py --check
|
|
118
|
+
|
|
119
|
+
# The type stub of the compiled backend is generated from the bindings.
|
|
120
|
+
- name: The committed backend stub must match the bindings
|
|
121
|
+
run: uv run python scripts/gen_stubs.py --check
|
|
122
|
+
|
|
123
|
+
# End-to-end runs (diffusion, buckets, Ising, on-the-fly rates). Slow.
|
|
124
|
+
- name: Upstream functional tests
|
|
125
|
+
run: uv run python scripts/run_upstream_tests.py --functests
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
name: Wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
paths:
|
|
7
|
+
- ".github/workflows/wheels.yml"
|
|
8
|
+
- "pyproject.toml"
|
|
9
|
+
- "cxx/**"
|
|
10
|
+
- "third_party/KMCLib/**"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
CIBUILDWHEEL_VERSION: "4.3.5"
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build_wheels:
|
|
18
|
+
name: wheels (${{ matrix.name }})
|
|
19
|
+
runs-on: ${{ matrix.os }}
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
include:
|
|
24
|
+
# Linux: both manylinux flavours for both architectures. The arm64
|
|
25
|
+
# builds run on native runners, not under QEMU.
|
|
26
|
+
- { name: linux-x86_64-manylinux2014, os: ubuntu-latest, arch: x86_64, manylinux: manylinux2014 }
|
|
27
|
+
- { name: linux-x86_64-manylinux_2_28, os: ubuntu-latest, arch: x86_64, manylinux: manylinux_2_28 }
|
|
28
|
+
- { name: linux-aarch64-manylinux2014, os: ubuntu-24.04-arm, arch: aarch64, manylinux: manylinux2014 }
|
|
29
|
+
- { name: linux-aarch64-manylinux_2_28, os: ubuntu-24.04-arm, arch: aarch64, manylinux: manylinux_2_28 }
|
|
30
|
+
# macOS: one native runner per architecture. The deployment target
|
|
31
|
+
# is pinned so that the C++17 standard library is fully available.
|
|
32
|
+
- { name: macos-x86_64, os: macos-15-intel, arch: x86_64, macos_target: "10.15" }
|
|
33
|
+
- { name: macos-arm64, os: macos-15, arch: arm64, macos_target: "11.0" }
|
|
34
|
+
- { name: windows-x86_64, os: windows-latest, arch: AMD64 }
|
|
35
|
+
env:
|
|
36
|
+
CIBW_ARCHS: ${{ matrix.arch }}
|
|
37
|
+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux || 'manylinux_2_28' }}
|
|
38
|
+
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux || 'manylinux_2_28' }}
|
|
39
|
+
# numpy publishes no manylinux2014 wheel for CPython 3.14, so that wheel
|
|
40
|
+
# is built but cannot be tested inside the manylinux2014 image.
|
|
41
|
+
CIBW_TEST_SKIP: ${{ matrix.manylinux == 'manylinux2014' && 'cp314-*' || '' }}
|
|
42
|
+
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_target }}
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
- uses: astral-sh/setup-uv@v6
|
|
46
|
+
with:
|
|
47
|
+
enable-cache: true
|
|
48
|
+
|
|
49
|
+
- name: Build the wheels
|
|
50
|
+
run: uvx cibuildwheel==${{ env.CIBUILDWHEEL_VERSION }} --output-dir wheelhouse
|
|
51
|
+
|
|
52
|
+
- uses: actions/upload-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: wheels-${{ matrix.name }}
|
|
55
|
+
path: wheelhouse/*.whl
|
|
56
|
+
|
|
57
|
+
build_sdist:
|
|
58
|
+
name: sdist
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
- uses: astral-sh/setup-uv@v6
|
|
63
|
+
- run: uv build --sdist
|
|
64
|
+
- uses: actions/upload-artifact@v4
|
|
65
|
+
with:
|
|
66
|
+
name: sdist
|
|
67
|
+
path: dist/*.tar.gz
|
|
68
|
+
|
|
69
|
+
# Release jobs (tags only). Both wait for every wheel and the sdist, and
|
|
70
|
+
# neither runs unless the tag matches the version in the package.
|
|
71
|
+
check_tag:
|
|
72
|
+
name: tag matches __version__
|
|
73
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v4
|
|
77
|
+
- run: |
|
|
78
|
+
version=$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' src/pykmclib/__init__.py)
|
|
79
|
+
if [ "v${version}" != "${GITHUB_REF_NAME}" ]; then
|
|
80
|
+
echo "tag ${GITHUB_REF_NAME} does not match __version__ = \"${version}\""
|
|
81
|
+
exit 1
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
publish:
|
|
85
|
+
name: publish to PyPI
|
|
86
|
+
needs: [check_tag, build_wheels, build_sdist]
|
|
87
|
+
runs-on: ubuntu-latest
|
|
88
|
+
environment: pypi
|
|
89
|
+
permissions:
|
|
90
|
+
id-token: write # trusted publishing, no API token needed
|
|
91
|
+
steps:
|
|
92
|
+
- uses: actions/download-artifact@v4
|
|
93
|
+
with:
|
|
94
|
+
pattern: wheels-*
|
|
95
|
+
merge-multiple: true
|
|
96
|
+
path: dist
|
|
97
|
+
- uses: actions/download-artifact@v4
|
|
98
|
+
with:
|
|
99
|
+
name: sdist
|
|
100
|
+
path: dist
|
|
101
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
102
|
+
|
|
103
|
+
github_release:
|
|
104
|
+
name: upload to the GitHub release
|
|
105
|
+
needs: [check_tag, build_wheels, build_sdist]
|
|
106
|
+
runs-on: ubuntu-latest
|
|
107
|
+
permissions:
|
|
108
|
+
contents: write # create the release and attach files to it
|
|
109
|
+
env:
|
|
110
|
+
GH_TOKEN: ${{ github.token }}
|
|
111
|
+
GH_REPO: ${{ github.repository }}
|
|
112
|
+
steps:
|
|
113
|
+
- uses: actions/download-artifact@v4
|
|
114
|
+
with:
|
|
115
|
+
pattern: wheels-*
|
|
116
|
+
merge-multiple: true
|
|
117
|
+
path: dist
|
|
118
|
+
- uses: actions/download-artifact@v4
|
|
119
|
+
with:
|
|
120
|
+
name: sdist
|
|
121
|
+
path: dist
|
|
122
|
+
|
|
123
|
+
- name: Create the release, or reuse the one that already exists
|
|
124
|
+
run: |
|
|
125
|
+
if gh release view "${GITHUB_REF_NAME}" > /dev/null 2>&1; then
|
|
126
|
+
echo "release ${GITHUB_REF_NAME} already exists"
|
|
127
|
+
exit 0
|
|
128
|
+
fi
|
|
129
|
+
flags="--verify-tag --generate-notes"
|
|
130
|
+
# PEP 440 pre-releases (a, b, rc, .dev) become GitHub pre-releases.
|
|
131
|
+
if echo "${GITHUB_REF_NAME}" | grep -Eq '(a|b|rc|\.dev)[0-9]+$'; then
|
|
132
|
+
flags="${flags} --prerelease"
|
|
133
|
+
fi
|
|
134
|
+
gh release create "${GITHUB_REF_NAME}" --title "pykmclib ${GITHUB_REF_NAME#v}" ${flags}
|
|
135
|
+
|
|
136
|
+
- name: Attach the wheels and the sdist
|
|
137
|
+
run: gh release upload "${GITHUB_REF_NAME}" dist/* --clobber
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
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
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# uv
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs/Zensical documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
# .idea/
|
|
192
|
+
|
|
193
|
+
# Abstra
|
|
194
|
+
# Abstra is an AI-powered process automation framework.
|
|
195
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
196
|
+
# Learn more at https://abstra.io/docs
|
|
197
|
+
.abstra/
|
|
198
|
+
|
|
199
|
+
# Visual Studio Code
|
|
200
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
201
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
202
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
203
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
204
|
+
# .vscode/
|
|
205
|
+
# Temporary file for partial code execution
|
|
206
|
+
tempCodeRunnerFile.py
|
|
207
|
+
|
|
208
|
+
# Ruff stuff:
|
|
209
|
+
.ruff_cache/
|
|
210
|
+
|
|
211
|
+
# PyPI configuration file
|
|
212
|
+
.pypirc
|
|
213
|
+
|
|
214
|
+
# Marimo
|
|
215
|
+
marimo/_static/
|
|
216
|
+
marimo/_lsp/
|
|
217
|
+
__marimo__/
|
|
218
|
+
|
|
219
|
+
# Streamlit
|
|
220
|
+
.streamlit/secrets.toml
|
|
221
|
+
|
|
222
|
+
# pykmclib: build, packaging and simulation artefacts
|
|
223
|
+
build/
|
|
224
|
+
dist/
|
|
225
|
+
.uv-cache/
|
|
226
|
+
.venv/
|
|
227
|
+
*.so
|
|
228
|
+
*.pyd
|
|
229
|
+
*.xyz
|
|
230
|
+
msd.data
|
|
231
|
+
scratch/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# pykmclib - Python re-development of KMCLib
|
|
2
|
+
#
|
|
3
|
+
# Entry point for the CMake build. scikit-build-core invokes this file and
|
|
4
|
+
# installs whatever is declared with install() into the wheel.
|
|
5
|
+
#
|
|
6
|
+
# The KMCLib C++ sources themselves live, unmodified, in third_party/KMCLib/.
|
|
7
|
+
# Nothing here patches them: all build adaptation (pybind11 bindings, generated
|
|
8
|
+
# mpiflag.h, md5 extraction) happens in cxx/.
|
|
9
|
+
|
|
10
|
+
cmake_minimum_required(VERSION 3.21...4.2)
|
|
11
|
+
|
|
12
|
+
project(pykmclib LANGUAGES C CXX)
|
|
13
|
+
|
|
14
|
+
if(NOT DEFINED SKBUILD_PROJECT_NAME)
|
|
15
|
+
# Allow a plain "cmake -S . -B build" session outside of a PEP 517 build.
|
|
16
|
+
set(SKBUILD_PROJECT_NAME pykmclib)
|
|
17
|
+
endif()
|
|
18
|
+
|
|
19
|
+
option(KMC_ENABLE_MPI "Compile the KMCLib core with MPI support (experimental)" OFF)
|
|
20
|
+
option(KMC_PORTABLE_LINUX_WHEEL
|
|
21
|
+
"Avoid libstdc++ symbols that the manylinux_2_28 policy rejects (used for the published Linux wheels)" OFF)
|
|
22
|
+
set(KMC_CXX_STANDARD "17" CACHE STRING "C++ standard used to compile the KMCLib core")
|
|
23
|
+
|
|
24
|
+
add_subdirectory(cxx)
|