BayesISOLA 0.1.0__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.
Files changed (160) hide show
  1. bayesisola-0.1.0/.gitattributes +7 -0
  2. bayesisola-0.1.0/.github/workflows/ci.yml +74 -0
  3. bayesisola-0.1.0/.github/workflows/release.yml +492 -0
  4. bayesisola-0.1.0/.gitignore +27 -0
  5. bayesisola-0.1.0/BayesISOLA/MT_comps.py +136 -0
  6. bayesisola-0.1.0/BayesISOLA/MouseTrap.py +392 -0
  7. bayesisola-0.1.0/BayesISOLA/_VR.py +83 -0
  8. bayesisola-0.1.0/BayesISOLA/__init__.py +6 -0
  9. bayesisola-0.1.0/BayesISOLA/_covariance_matrix.py +497 -0
  10. bayesisola-0.1.0/BayesISOLA/_green.py +198 -0
  11. bayesisola-0.1.0/BayesISOLA/_grid.py +96 -0
  12. bayesisola-0.1.0/BayesISOLA/_html.py +653 -0
  13. bayesisola-0.1.0/BayesISOLA/_input_crust.py +33 -0
  14. bayesisola-0.1.0/BayesISOLA/_input_event.py +107 -0
  15. bayesisola-0.1.0/BayesISOLA/_input_network.py +199 -0
  16. bayesisola-0.1.0/BayesISOLA/_input_seismo_files.py +360 -0
  17. bayesisola-0.1.0/BayesISOLA/_input_seismo_remote.py +136 -0
  18. bayesisola-0.1.0/BayesISOLA/_inverse.py +172 -0
  19. bayesisola-0.1.0/BayesISOLA/_mouse.py +62 -0
  20. bayesisola-0.1.0/BayesISOLA/_parameters.py +194 -0
  21. bayesisola-0.1.0/BayesISOLA/_paths.py +56 -0
  22. bayesisola-0.1.0/BayesISOLA/_plot.py +165 -0
  23. bayesisola-0.1.0/BayesISOLA/_plot_data.py +433 -0
  24. bayesisola-0.1.0/BayesISOLA/_plot_solution_maps.py +397 -0
  25. bayesisola-0.1.0/BayesISOLA/_plot_solution_summary.py +269 -0
  26. bayesisola-0.1.0/BayesISOLA/_print.py +54 -0
  27. bayesisola-0.1.0/BayesISOLA/_process_data.py +138 -0
  28. bayesisola-0.1.0/BayesISOLA/_save.py +37 -0
  29. bayesisola-0.1.0/BayesISOLA/axitra.py +101 -0
  30. bayesisola-0.1.0/BayesISOLA/covariance_matrix.py +60 -0
  31. bayesisola-0.1.0/BayesISOLA/fileformats.py +199 -0
  32. bayesisola-0.1.0/BayesISOLA/gf_helpers.py +1400 -0
  33. bayesisola-0.1.0/BayesISOLA/grid.py +76 -0
  34. bayesisola-0.1.0/BayesISOLA/helpers.py +101 -0
  35. bayesisola-0.1.0/BayesISOLA/histogram.py +89 -0
  36. bayesisola-0.1.0/BayesISOLA/inverse_problem.py +203 -0
  37. bayesisola-0.1.0/BayesISOLA/load_data.py +96 -0
  38. bayesisola-0.1.0/BayesISOLA/plot.py +81 -0
  39. bayesisola-0.1.0/BayesISOLA/process_data.py +126 -0
  40. bayesisola-0.1.0/BayesISOLA/resolve_MT.py +72 -0
  41. bayesisola-0.1.0/BayesISOLA/resources/axitra/soutype.dat +4 -0
  42. bayesisola-0.1.0/BayesISOLA/resources/html/css/lightbox.css +206 -0
  43. bayesisola-0.1.0/BayesISOLA/resources/html/css/lightbox.min.css +1 -0
  44. bayesisola-0.1.0/BayesISOLA/resources/html/images/close.png +0 -0
  45. bayesisola-0.1.0/BayesISOLA/resources/html/images/loading.gif +0 -0
  46. bayesisola-0.1.0/BayesISOLA/resources/html/images/next.png +0 -0
  47. bayesisola-0.1.0/BayesISOLA/resources/html/images/prev.png +0 -0
  48. bayesisola-0.1.0/BayesISOLA/resources/html/js/lightbox-plus-jquery.js +9664 -0
  49. bayesisola-0.1.0/BayesISOLA/resources/html/js/lightbox-plus-jquery.min.js +38 -0
  50. bayesisola-0.1.0/BayesISOLA/resources/html/js/lightbox-plus-jquery.min.map +1 -0
  51. bayesisola-0.1.0/BayesISOLA/resources/html/js/lightbox.js +453 -0
  52. bayesisola-0.1.0/BayesISOLA/resources/html/js/lightbox.min.js +13 -0
  53. bayesisola-0.1.0/BayesISOLA/resources/html/js/lightbox.min.map +1 -0
  54. bayesisola-0.1.0/BayesISOLA/resources/html/style.css +72 -0
  55. bayesisola-0.1.0/BayesISOLA/syngine.py +790 -0
  56. bayesisola-0.1.0/BayesISOLA/workflows.py +3523 -0
  57. bayesisola-0.1.0/CMakeLists.txt +34 -0
  58. bayesisola-0.1.0/LICENSE +621 -0
  59. bayesisola-0.1.0/PKG-INFO +285 -0
  60. bayesisola-0.1.0/README.md +257 -0
  61. bayesisola-0.1.0/docs/BayesISOLA.MT_comps.rst +9 -0
  62. bayesisola-0.1.0/docs/BayesISOLA.MouseTrap.rst +9 -0
  63. bayesisola-0.1.0/docs/BayesISOLA.axitra.rst +9 -0
  64. bayesisola-0.1.0/docs/BayesISOLA.covariance_matrix.rst +9 -0
  65. bayesisola-0.1.0/docs/BayesISOLA.fileformats.rst +9 -0
  66. bayesisola-0.1.0/docs/BayesISOLA.gf_helpers.rst +168 -0
  67. bayesisola-0.1.0/docs/BayesISOLA.grid.rst +9 -0
  68. bayesisola-0.1.0/docs/BayesISOLA.helpers.rst +9 -0
  69. bayesisola-0.1.0/docs/BayesISOLA.histogram.rst +9 -0
  70. bayesisola-0.1.0/docs/BayesISOLA.inverse_problem.rst +9 -0
  71. bayesisola-0.1.0/docs/BayesISOLA.load_data.rst +9 -0
  72. bayesisola-0.1.0/docs/BayesISOLA.plot.rst +9 -0
  73. bayesisola-0.1.0/docs/BayesISOLA.process_data.rst +9 -0
  74. bayesisola-0.1.0/docs/BayesISOLA.resolve_MT.rst +9 -0
  75. bayesisola-0.1.0/docs/BayesISOLA.syngine.rst +7 -0
  76. bayesisola-0.1.0/docs/BayesISOLA.workflows.rst +213 -0
  77. bayesisola-0.1.0/docs/Makefile +20 -0
  78. bayesisola-0.1.0/docs/_static/example_2_SAC.zip +0 -0
  79. bayesisola-0.1.0/docs/_static/example_2_fdsnws.zip +0 -0
  80. bayesisola-0.1.0/docs/conf.py +32 -0
  81. bayesisola-0.1.0/docs/index.rst +119 -0
  82. bayesisola-0.1.0/docs/make.bat +35 -0
  83. bayesisola-0.1.0/examples/example_2_SAC.py +45 -0
  84. bayesisola-0.1.0/examples/example_2_fdsnws.py +51 -0
  85. bayesisola-0.1.0/examples/input/example_2_SAC/crustal.dat +13 -0
  86. bayesisola-0.1.0/examples/input/example_2_SAC/event.isl +8 -0
  87. bayesisola-0.1.0/examples/input/example_2_SAC/network.stn +9 -0
  88. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/DAVAHHE.pz +15 -0
  89. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/DAVAHHN.pz +15 -0
  90. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/DAVAHHZ.pz +15 -0
  91. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/DAVOXHHE.pz +25 -0
  92. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/DAVOXHHN.pz +25 -0
  93. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/DAVOXHHZ.pz +25 -0
  94. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/LIENZHHE.pz +25 -0
  95. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/LIENZHHN.pz +25 -0
  96. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/LIENZHHZ.pz +25 -0
  97. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/LLSHHE.pz +25 -0
  98. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/LLSHHN.pz +25 -0
  99. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/LLSHHZ.pz +25 -0
  100. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/PANIXHHE.pz +25 -0
  101. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/PANIXHHN.pz +25 -0
  102. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/PANIXHHZ.pz +25 -0
  103. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT01HHE.pz +18 -0
  104. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT01HHN.pz +18 -0
  105. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT01HHZ.pz +18 -0
  106. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT03HHE.pz +18 -0
  107. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT03HHN.pz +18 -0
  108. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT03HHZ.pz +18 -0
  109. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT04HHE.pz +18 -0
  110. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT04HHN.pz +18 -0
  111. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT04HHZ.pz +18 -0
  112. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT05HHE.pz +18 -0
  113. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT05HHN.pz +18 -0
  114. bayesisola-0.1.0/examples/input/example_2_SAC/pzfiles/SGT05HHZ.pz +18 -0
  115. bayesisola-0.1.0/examples/input/example_2_SAC/sac/DAVAHHE.sac +0 -0
  116. bayesisola-0.1.0/examples/input/example_2_SAC/sac/DAVAHHN.sac +0 -0
  117. bayesisola-0.1.0/examples/input/example_2_SAC/sac/DAVAHHZ.sac +0 -0
  118. bayesisola-0.1.0/examples/input/example_2_SAC/sac/DAVOXHHE.sac +0 -0
  119. bayesisola-0.1.0/examples/input/example_2_SAC/sac/DAVOXHHN.sac +0 -0
  120. bayesisola-0.1.0/examples/input/example_2_SAC/sac/DAVOXHHZ.sac +0 -0
  121. bayesisola-0.1.0/examples/input/example_2_SAC/sac/LIENZHHE.sac +0 -0
  122. bayesisola-0.1.0/examples/input/example_2_SAC/sac/LIENZHHN.sac +0 -0
  123. bayesisola-0.1.0/examples/input/example_2_SAC/sac/LIENZHHZ.sac +0 -0
  124. bayesisola-0.1.0/examples/input/example_2_SAC/sac/LLSHHE.sac +0 -0
  125. bayesisola-0.1.0/examples/input/example_2_SAC/sac/LLSHHN.sac +0 -0
  126. bayesisola-0.1.0/examples/input/example_2_SAC/sac/LLSHHZ.sac +0 -0
  127. bayesisola-0.1.0/examples/input/example_2_SAC/sac/PANIXHHE.sac +0 -0
  128. bayesisola-0.1.0/examples/input/example_2_SAC/sac/PANIXHHN.sac +0 -0
  129. bayesisola-0.1.0/examples/input/example_2_SAC/sac/PANIXHHZ.sac +0 -0
  130. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT01HHE.sac +0 -0
  131. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT01HHN.sac +0 -0
  132. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT01HHZ.sac +0 -0
  133. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT03HHE.sac +0 -0
  134. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT03HHN.sac +0 -0
  135. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT03HHZ.sac +0 -0
  136. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT04HHE.sac +0 -0
  137. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT04HHN.sac +0 -0
  138. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT04HHZ.sac +0 -0
  139. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT05HHE.sac +0 -0
  140. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT05HHN.sac +0 -0
  141. bayesisola-0.1.0/examples/input/example_2_SAC/sac/SGT05HHZ.sac +0 -0
  142. bayesisola-0.1.0/examples/input/example_2_fdsnws/crustal.dat +13 -0
  143. bayesisola-0.1.0/examples/input/example_2_fdsnws/event.isl +8 -0
  144. bayesisola-0.1.0/examples/input/example_2_fdsnws/network.stn +9 -0
  145. bayesisola-0.1.0/examples/run_auto_cmt_example.ipynb +1353 -0
  146. bayesisola-0.1.0/examples/vm/AK135F.csv +146 -0
  147. bayesisola-0.1.0/examples/vm/IASP91.csv +153 -0
  148. bayesisola-0.1.0/examples/vm/gil7.d +19 -0
  149. bayesisola-0.1.0/examples/vm/nz3dvm_2p3.csv +112001 -0
  150. bayesisola-0.1.0/fortran/axitra/dimen1.inc +32 -0
  151. bayesisola-0.1.0/fortran/axitra/dimen2.inc +30 -0
  152. bayesisola-0.1.0/fortran/axitra/elemse.for +538 -0
  153. bayesisola-0.1.0/fortran/axitra/gr_xyz.for +2030 -0
  154. bayesisola-0.1.0/fortran/axitra/param.inc +25 -0
  155. bayesisola-0.1.0/pyproject.toml +51 -0
  156. bayesisola-0.1.0/tests/data/axitra_smoke_reference.npz +0 -0
  157. bayesisola-0.1.0/tests/test_axitra_numerical.py +118 -0
  158. bayesisola-0.1.0/tests/test_package_layout.py +23 -0
  159. bayesisola-0.1.0/tests/test_packaging_paths.py +37 -0
  160. bayesisola-0.1.0/tests/test_process_data_parameter_routing.py +116 -0
@@ -0,0 +1,7 @@
1
+ * text=auto eol=lf
2
+ *.sac binary
3
+ *.zip binary
4
+ *.png binary
5
+ *.gif binary
6
+ *.jpg binary
7
+ *.jpeg binary
@@ -0,0 +1,74 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ source-tests:
15
+ name: Source tests (Python ${{ matrix.python-version }})
16
+ runs-on: ubuntu-latest
17
+
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v7
25
+
26
+ - uses: actions/setup-python@v7
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install test dependency
31
+ run: python -m pip install --upgrade pip pytest
32
+
33
+ - name: Reject SyntaxWarnings
34
+ run: PYTHONWARNINGS="error::SyntaxWarning" python -m compileall -q BayesISOLA tests examples docs
35
+
36
+ - name: Run source-level regression tests
37
+ run: >-
38
+ python -m pytest -q
39
+ tests/test_package_layout.py
40
+ tests/test_packaging_paths.py
41
+ tests/test_process_data_parameter_routing.py
42
+
43
+ sdist-check:
44
+ name: Source distribution check
45
+ runs-on: ubuntu-latest
46
+
47
+ steps:
48
+ - uses: actions/checkout@v7
49
+
50
+ - uses: actions/setup-python@v7
51
+ with:
52
+ python-version: "3.12"
53
+
54
+ - name: Build source distribution
55
+ run: |
56
+ python -m pip install --upgrade pip build
57
+ python -m build --sdist --outdir dist
58
+
59
+ - name: Verify source distribution
60
+ run: |
61
+ python - <<'PY'
62
+ from pathlib import Path
63
+ import tomllib
64
+
65
+ with open("pyproject.toml", "rb") as f:
66
+ version = tomllib.load(f)["project"]["version"]
67
+
68
+ expected = Path("dist") / f"bayesisola-{version}.tar.gz"
69
+
70
+ if not expected.is_file():
71
+ raise SystemExit(f"Missing expected source distribution: {expected}")
72
+
73
+ print(expected)
74
+ PY
@@ -0,0 +1,492 @@
1
+ name: Build and Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ validate:
14
+ name: Validate release metadata
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v7
19
+
20
+ - uses: actions/setup-python@v7
21
+ with:
22
+ python-version: "3.12"
23
+
24
+ - name: Check version and tag
25
+ run: |
26
+ python - <<'PY'
27
+ import os
28
+ import tomllib
29
+
30
+ with open("pyproject.toml", "rb") as f:
31
+ version = tomllib.load(f)["project"]["version"]
32
+
33
+ print(f"BayesISOLA version: {version}")
34
+
35
+ if os.environ.get("GITHUB_REF_TYPE") == "tag":
36
+ actual = os.environ["GITHUB_REF_NAME"]
37
+ expected = f"v{version}"
38
+
39
+ if actual != expected:
40
+ raise SystemExit(
41
+ f"Tag/version mismatch: tag={actual}, expected={expected}"
42
+ )
43
+ PY
44
+
45
+ sdist:
46
+ name: Build source distribution
47
+ needs: validate
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v7
52
+
53
+ - uses: actions/setup-python@v7
54
+ with:
55
+ python-version: "3.12"
56
+
57
+ - name: Build source distribution
58
+ run: |
59
+ python -m pip install --upgrade pip build
60
+ python -m build --sdist --outdir dist
61
+
62
+ - name: Verify source distribution filename
63
+ run: |
64
+ python - <<'PY'
65
+ from pathlib import Path
66
+ import tomllib
67
+
68
+ with open("pyproject.toml", "rb") as f:
69
+ version = tomllib.load(f)["project"]["version"]
70
+
71
+ expected = Path("dist") / f"bayesisola-{version}.tar.gz"
72
+
73
+ if not expected.is_file():
74
+ raise SystemExit(f"Missing expected source distribution: {expected}")
75
+
76
+ print(expected)
77
+ PY
78
+
79
+ - uses: actions/upload-artifact@v7
80
+ with:
81
+ name: release-sdist
82
+ path: dist/*.tar.gz
83
+ if-no-files-found: error
84
+
85
+ linux-wheel:
86
+ name: Build Linux manylinux wheel
87
+ needs: sdist
88
+ runs-on: ubuntu-latest
89
+
90
+ steps:
91
+ - uses: actions/download-artifact@v8
92
+ with:
93
+ name: release-sdist
94
+ path: dist
95
+
96
+ - name: Build and repair manylinux wheel
97
+ run: |
98
+ mkdir -p wheelhouse/linux
99
+
100
+ docker run --rm \
101
+ -v "$PWD:/io" \
102
+ -w /io \
103
+ quay.io/pypa/manylinux_2_28_x86_64 \
104
+ bash -lc '
105
+ set -euo pipefail
106
+
107
+ if ! command -v gfortran >/dev/null 2>&1; then
108
+ dnf -y install gcc-gfortran || dnf -y install gcc-toolset-14-gcc-gfortran
109
+ fi
110
+
111
+ PY=/opt/python/cp312-cp312/bin/python
112
+
113
+ SDIST="$(find /io/dist -maxdepth 1 -type f -name "bayesisola-*.tar.gz" -print -quit)"
114
+ test -n "$SDIST"
115
+
116
+ "$PY" -m pip wheel --no-deps "$SDIST" -w /tmp/bayesisola-raw
117
+
118
+ RAW="$(find /tmp/bayesisola-raw -maxdepth 1 -type f -name "bayesisola-*.whl" -print -quit)"
119
+ test -n "$RAW"
120
+
121
+ auditwheel show "$RAW"
122
+
123
+ auditwheel repair \
124
+ --plat manylinux_2_28_x86_64 \
125
+ "$RAW" \
126
+ -w /io/wheelhouse/linux
127
+
128
+ REPAIRED="$(find /io/wheelhouse/linux -maxdepth 1 -type f -name "bayesisola-*.whl" -print -quit)"
129
+ test -n "$REPAIRED"
130
+
131
+ auditwheel show "$REPAIRED"
132
+ '
133
+
134
+ - uses: actions/upload-artifact@v7
135
+ with:
136
+ name: release-linux-wheel
137
+ path: wheelhouse/linux/*.whl
138
+ if-no-files-found: error
139
+
140
+ windows-wheel:
141
+ name: Build Windows wheel
142
+ needs: sdist
143
+ runs-on: windows-latest
144
+
145
+ steps:
146
+ - uses: actions/setup-python@v7
147
+ with:
148
+ python-version: "3.12"
149
+
150
+ - uses: actions/download-artifact@v8
151
+ with:
152
+ name: release-sdist
153
+ path: dist
154
+
155
+ - name: Set up pinned WinLibs GNU Fortran 13.2.0
156
+ shell: pwsh
157
+ run: |
158
+ $url = "https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0posix-18.1.5-11.0.1-ucrt-r8/winlibs-x86_64-posix-seh-gcc-13.2.0-mingw-w64ucrt-11.0.1-r8.zip"
159
+ $archive = Join-Path $env:RUNNER_TEMP "winlibs-gcc-13.2.0-r8.zip"
160
+ $root = Join-Path $env:RUNNER_TEMP "winlibs-gcc-13.2.0-r8"
161
+
162
+ curl.exe -L --fail --retry 5 --retry-delay 2 -o $archive $url
163
+
164
+ if ($LASTEXITCODE -ne 0) {
165
+ throw "Failed to download pinned WinLibs toolchain."
166
+ }
167
+
168
+ Expand-Archive -Path $archive -DestinationPath $root -Force
169
+
170
+ $bin = Join-Path $root "mingw64\bin"
171
+ $gfortran = Join-Path $bin "gfortran.exe"
172
+
173
+ if (-not (Test-Path $gfortran)) {
174
+ throw "Pinned WinLibs gfortran.exe was not found."
175
+ }
176
+
177
+ $bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
178
+ "FC=$gfortran" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
179
+ "CMAKE_GENERATOR=Ninja" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
180
+
181
+ Write-Host "=== PINNED WINDOWS FORTRAN TOOLCHAIN ==="
182
+ & $gfortran --version
183
+ & $gfortran -dumpmachine
184
+
185
+ $ninja = Join-Path $bin "ninja.exe"
186
+
187
+ if (-not (Test-Path $ninja)) {
188
+ throw "Pinned WinLibs ninja.exe was not found."
189
+ }
190
+
191
+ & $ninja --version
192
+
193
+ - name: Build Windows wheel from source distribution
194
+ shell: pwsh
195
+ run: |
196
+ $gfortran = (Get-Command gfortran.exe).Source
197
+
198
+ Write-Host "GNU Fortran: $gfortran"
199
+ & $gfortran --version
200
+
201
+ python -m pip install --upgrade pip ninja
202
+
203
+ $env:CMAKE_GENERATOR = "Ninja"
204
+ $env:FC = $gfortran
205
+
206
+ Write-Host "CMAKE_GENERATOR=$env:CMAKE_GENERATOR"
207
+ Write-Host "FC=$env:FC"
208
+ ninja --version
209
+
210
+ New-Item -ItemType Directory -Force "wheelhouse\windows" | Out-Null
211
+
212
+ $sdist = (
213
+ Get-ChildItem "dist\bayesisola-*.tar.gz" |
214
+ Select-Object -First 1
215
+ ).FullName
216
+
217
+ if (-not $sdist) {
218
+ throw "Source distribution not found."
219
+ }
220
+
221
+ python -m pip wheel --no-deps $sdist -w "wheelhouse\windows"
222
+
223
+ if ($LASTEXITCODE -ne 0) {
224
+ throw "Windows wheel build failed."
225
+ }
226
+
227
+ $wheel = (
228
+ Get-ChildItem "wheelhouse\windows\bayesisola-*-py3-none-win_amd64.whl" |
229
+ Select-Object -First 1
230
+ )
231
+
232
+ if (-not $wheel) {
233
+ throw "Expected py3-none-win_amd64 wheel was not produced."
234
+ }
235
+
236
+ Write-Host $wheel.FullName
237
+
238
+ - name: Verify packaged executables and runtime DLLs
239
+ shell: pwsh
240
+ run: |
241
+ $wheel = (
242
+ Get-ChildItem "wheelhouse\windows\bayesisola-*-py3-none-win_amd64.whl" |
243
+ Select-Object -First 1
244
+ ).FullName
245
+
246
+ $script = Join-Path $env:RUNNER_TEMP "check_wheel.py"
247
+
248
+ @'
249
+ import sys
250
+ import zipfile
251
+
252
+ required = {
253
+ "BayesISOLA/_bin/gr_xyz.exe",
254
+ "BayesISOLA/_bin/elemse.exe",
255
+ "BayesISOLA/_bin/libgcc_s_seh-1.dll",
256
+ "BayesISOLA/_bin/libgfortran-5.dll",
257
+ "BayesISOLA/_bin/libquadmath-0.dll",
258
+ "BayesISOLA/_bin/libwinpthread-1.dll",
259
+ }
260
+
261
+ with zipfile.ZipFile(sys.argv[1]) as z:
262
+ names = set(z.namelist())
263
+
264
+ missing = sorted(required - names)
265
+
266
+ for name in sorted(required):
267
+ print(("FOUND " if name in names else "MISSING ") + name)
268
+
269
+ if missing:
270
+ raise SystemExit(
271
+ f"Missing packaged Windows runtime files: {missing}"
272
+ )
273
+ '@ | Set-Content -Encoding utf8 $script
274
+
275
+ python $script $wheel
276
+
277
+ - uses: actions/upload-artifact@v7
278
+ with:
279
+ name: release-windows-wheel
280
+ path: wheelhouse/windows/*.whl
281
+ if-no-files-found: error
282
+
283
+ test-linux:
284
+ name: Linux wheel regression (Python ${{ matrix.python-version }})
285
+ needs: linux-wheel
286
+ runs-on: ubuntu-latest
287
+
288
+ strategy:
289
+ fail-fast: false
290
+ matrix:
291
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
292
+
293
+ steps:
294
+ - uses: actions/checkout@v7
295
+
296
+ - uses: actions/setup-python@v7
297
+ with:
298
+ python-version: ${{ matrix.python-version }}
299
+
300
+ - uses: actions/download-artifact@v8
301
+ with:
302
+ name: release-linux-wheel
303
+ path: wheelhouse
304
+
305
+ - name: Install exact wheel
306
+ run: |
307
+ python -m pip install --upgrade pip
308
+ python -m pip install wheelhouse/*.whl pytest
309
+
310
+ - name: Run source-free Axitra numerical regression
311
+ run: |
312
+ SMOKE="$RUNNER_TEMP/bayesisola-smoke"
313
+
314
+ rm -rf "$SMOKE"
315
+ mkdir -p "$SMOKE/tests/data" "$SMOKE/examples/input"
316
+
317
+ cp tests/test_axitra_numerical.py "$SMOKE/tests/"
318
+ cp tests/data/axitra_smoke_reference.npz "$SMOKE/tests/data/"
319
+ cp -a examples/input/example_2_SAC "$SMOKE/examples/input/"
320
+
321
+ cd "$SMOKE"
322
+
323
+ python - <<'PY'
324
+ import os
325
+ from pathlib import Path
326
+
327
+ import BayesISOLA
328
+ from BayesISOLA._paths import axitra_executable
329
+
330
+ pkg = Path(BayesISOLA.__file__).resolve()
331
+ repo = Path(os.environ["GITHUB_WORKSPACE"]).resolve()
332
+
333
+ print("BayesISOLA:", pkg)
334
+ print("gr_xyz:", axitra_executable("gr_xyz"))
335
+ print("elemse:", axitra_executable("elemse"))
336
+
337
+ if repo == pkg or repo in pkg.parents:
338
+ raise SystemExit(
339
+ "Imported BayesISOLA from the source checkout."
340
+ )
341
+ PY
342
+
343
+ python -m pytest -q tests/test_axitra_numerical.py
344
+
345
+ test-windows:
346
+ name: Windows wheel regression (Python ${{ matrix.python-version }})
347
+ needs: windows-wheel
348
+ runs-on: windows-latest
349
+
350
+ strategy:
351
+ fail-fast: false
352
+ matrix:
353
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
354
+
355
+ steps:
356
+ - uses: actions/checkout@v7
357
+
358
+ - uses: actions/setup-python@v7
359
+ with:
360
+ python-version: ${{ matrix.python-version }}
361
+
362
+ - uses: actions/download-artifact@v8
363
+ with:
364
+ name: release-windows-wheel
365
+ path: wheelhouse
366
+
367
+ - name: Install exact wheel
368
+ shell: pwsh
369
+ run: |
370
+ python -m pip install --upgrade pip
371
+
372
+ $wheel = (
373
+ Get-ChildItem "wheelhouse\*.whl" |
374
+ Select-Object -First 1
375
+ ).FullName
376
+
377
+ if (-not $wheel) {
378
+ throw "Windows wheel not found."
379
+ }
380
+
381
+ python -m pip install $wheel pytest
382
+
383
+ if ($LASTEXITCODE -ne 0) {
384
+ throw "Wheel/dependency installation failed."
385
+ }
386
+
387
+ - name: Run source-free Axitra numerical regression
388
+ shell: pwsh
389
+ run: |
390
+ $smoke = Join-Path $env:RUNNER_TEMP "bayesisola-smoke"
391
+
392
+ Remove-Item $smoke -Recurse -Force -ErrorAction SilentlyContinue
393
+
394
+ New-Item -ItemType Directory -Force "$smoke\tests\data" | Out-Null
395
+ New-Item -ItemType Directory -Force "$smoke\examples\input" | Out-Null
396
+
397
+ Copy-Item "tests\test_axitra_numerical.py" "$smoke\tests\"
398
+ Copy-Item "tests\data\axitra_smoke_reference.npz" "$smoke\tests\data\"
399
+ Copy-Item "examples\input\example_2_SAC" "$smoke\examples\input\" -Recurse
400
+
401
+ $script = Join-Path $smoke "check_installed_wheel.py"
402
+
403
+ @'
404
+ import os
405
+ from pathlib import Path
406
+
407
+ import BayesISOLA
408
+ from BayesISOLA._paths import axitra_executable
409
+
410
+ pkg = Path(BayesISOLA.__file__).resolve()
411
+ repo = Path(os.environ["GITHUB_WORKSPACE"]).resolve()
412
+
413
+ print("BayesISOLA:", pkg)
414
+ print("gr_xyz:", axitra_executable("gr_xyz"))
415
+ print("elemse:", axitra_executable("elemse"))
416
+
417
+ if repo == pkg or repo in pkg.parents:
418
+ raise SystemExit(
419
+ "Imported BayesISOLA from the source checkout."
420
+ )
421
+ '@ | Set-Content -Encoding utf8 $script
422
+
423
+ Push-Location $smoke
424
+
425
+ try {
426
+ python $script
427
+
428
+ if ($LASTEXITCODE -ne 0) {
429
+ throw "Installed-wheel import check failed."
430
+ }
431
+
432
+ python -m pytest -q tests\test_axitra_numerical.py
433
+
434
+ if ($LASTEXITCODE -ne 0) {
435
+ throw "Numerical regression failed."
436
+ }
437
+ }
438
+ finally {
439
+ Pop-Location
440
+ }
441
+
442
+ release:
443
+ name: Publish GitHub release
444
+ if: ${{ github.ref_type == 'tag' }}
445
+ needs:
446
+ - sdist
447
+ - linux-wheel
448
+ - windows-wheel
449
+ - test-linux
450
+ - test-windows
451
+
452
+ runs-on: ubuntu-latest
453
+
454
+ permissions:
455
+ contents: write
456
+
457
+ steps:
458
+ - uses: actions/download-artifact@v8
459
+ with:
460
+ path: release-dist
461
+ pattern: release-*
462
+ merge-multiple: true
463
+
464
+ - name: Create checksums
465
+ run: |
466
+ cd release-dist
467
+ sha256sum *.tar.gz *.whl > SHA256SUMS.txt
468
+ cat SHA256SUMS.txt
469
+
470
+ - name: Create or update GitHub release
471
+ env:
472
+ GH_TOKEN: ${{ github.token }}
473
+ run: |
474
+ if gh release view "$GITHUB_REF_NAME" \
475
+ --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
476
+
477
+ gh release upload "$GITHUB_REF_NAME" \
478
+ release-dist/*.tar.gz \
479
+ release-dist/*.whl \
480
+ release-dist/SHA256SUMS.txt \
481
+ --clobber \
482
+ --repo "$GITHUB_REPOSITORY"
483
+ else
484
+ gh release create "$GITHUB_REF_NAME" \
485
+ release-dist/*.tar.gz \
486
+ release-dist/*.whl \
487
+ release-dist/SHA256SUMS.txt \
488
+ --verify-tag \
489
+ --generate-notes \
490
+ --title "BayesISOLA $GITHUB_REF_NAME" \
491
+ --repo "$GITHUB_REPOSITORY"
492
+ fi
@@ -0,0 +1,27 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.so
4
+ *.pyd
5
+ *.dylib
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .venv/
9
+ build/
10
+ dist/
11
+ _skbuild/
12
+ CMakeFiles/
13
+ CMakeCache.txt
14
+ cmake_install.cmake
15
+ install_manifest.txt
16
+ docs/_build/
17
+ docs/_templates/
18
+ examples/output/
19
+ invert/
20
+ output/
21
+ filtrace.md
22
+
23
+ BayesISOLA/_bin/
24
+ .compat/
25
+ .venv-release-sdist/
26
+ .venv-release-win/
27
+ wheelhouse/