jaxgsa 0.4.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 (169) hide show
  1. jaxgsa-0.4.0/.github/dependabot.yml +21 -0
  2. jaxgsa-0.4.0/.github/workflows/ci.yml +42 -0
  3. jaxgsa-0.4.0/.github/workflows/docs-check.yml +39 -0
  4. jaxgsa-0.4.0/.github/workflows/docs.yml +47 -0
  5. jaxgsa-0.4.0/.github/workflows/publish.yml +48 -0
  6. jaxgsa-0.4.0/.gitignore +113 -0
  7. jaxgsa-0.4.0/.python-version +1 -0
  8. jaxgsa-0.4.0/CHANGELOG.md +304 -0
  9. jaxgsa-0.4.0/CITATION.cff +22 -0
  10. jaxgsa-0.4.0/CONTRIBUTING.md +40 -0
  11. jaxgsa-0.4.0/LICENSE +21 -0
  12. jaxgsa-0.4.0/PKG-INFO +644 -0
  13. jaxgsa-0.4.0/README.md +607 -0
  14. jaxgsa-0.4.0/benchmark_salib.py +683 -0
  15. jaxgsa-0.4.0/docs/.gitignore +3 -0
  16. jaxgsa-0.4.0/docs/.vitepress/config.ts +63 -0
  17. jaxgsa-0.4.0/docs/api/analyze.md +17 -0
  18. jaxgsa-0.4.0/docs/api/borgonovo.md +17 -0
  19. jaxgsa-0.4.0/docs/api/dgsm.md +19 -0
  20. jaxgsa-0.4.0/docs/api/efast.md +18 -0
  21. jaxgsa-0.4.0/docs/api/hdmr.md +16 -0
  22. jaxgsa-0.4.0/docs/api/hsic.md +17 -0
  23. jaxgsa-0.4.0/docs/api/index.md +125 -0
  24. jaxgsa-0.4.0/docs/api/morris.md +18 -0
  25. jaxgsa-0.4.0/docs/api/optimal-transport.md +20 -0
  26. jaxgsa-0.4.0/docs/api/pawn.md +17 -0
  27. jaxgsa-0.4.0/docs/api/pce.md +15 -0
  28. jaxgsa-0.4.0/docs/api/problem.md +16 -0
  29. jaxgsa-0.4.0/docs/api/sampling.md +19 -0
  30. jaxgsa-0.4.0/docs/api/shapley.md +37 -0
  31. jaxgsa-0.4.0/docs/examples/advanced-workflow.md +121 -0
  32. jaxgsa-0.4.0/docs/examples/basic.md +88 -0
  33. jaxgsa-0.4.0/docs/examples/batch_reactor.md +39 -0
  34. jaxgsa-0.4.0/docs/examples/bootstrap.md +78 -0
  35. jaxgsa-0.4.0/docs/examples/borgonovo.md +168 -0
  36. jaxgsa-0.4.0/docs/examples/dgsm.md +148 -0
  37. jaxgsa-0.4.0/docs/examples/efast.md +191 -0
  38. jaxgsa-0.4.0/docs/examples/hdmr.md +88 -0
  39. jaxgsa-0.4.0/docs/examples/hsic.md +190 -0
  40. jaxgsa-0.4.0/docs/examples/morris.md +295 -0
  41. jaxgsa-0.4.0/docs/examples/multi-output.md +104 -0
  42. jaxgsa-0.4.0/docs/examples/non-uniform-inputs.md +116 -0
  43. jaxgsa-0.4.0/docs/examples/optimal-transport.md +158 -0
  44. jaxgsa-0.4.0/docs/examples/pawn.md +164 -0
  45. jaxgsa-0.4.0/docs/examples/pce.md +123 -0
  46. jaxgsa-0.4.0/docs/examples/save-load.md +37 -0
  47. jaxgsa-0.4.0/docs/examples/shapley.md +215 -0
  48. jaxgsa-0.4.0/docs/examples/xarray.md +119 -0
  49. jaxgsa-0.4.0/docs/guide/benchmarks.md +183 -0
  50. jaxgsa-0.4.0/docs/guide/configuration.md +123 -0
  51. jaxgsa-0.4.0/docs/guide/getting-started.md +149 -0
  52. jaxgsa-0.4.0/docs/guide/methods.md +734 -0
  53. jaxgsa-0.4.0/docs/guide/migration-0.4.md +271 -0
  54. jaxgsa-0.4.0/docs/index.md +44 -0
  55. jaxgsa-0.4.0/docs/package-lock.json +3012 -0
  56. jaxgsa-0.4.0/docs/package.json +16 -0
  57. jaxgsa-0.4.0/docs/public/notebooks/batch_reactor_gsa.html +305 -0
  58. jaxgsa-0.4.0/examples/__marimo__/session/batch_reactor_gsa.py.json +264 -0
  59. jaxgsa-0.4.0/examples/__marimo__/session/benchmark_all.py.json +172 -0
  60. jaxgsa-0.4.0/examples/__marimo__/session/dgsm_benchmark.py.json +178 -0
  61. jaxgsa-0.4.0/examples/__marimo__/session/dynamic_gsa.py.json +238 -0
  62. jaxgsa-0.4.0/examples/__marimo__/session/efast_gsa.py.json +278 -0
  63. jaxgsa-0.4.0/examples/__marimo__/session/method_comparison.py.json +139 -0
  64. jaxgsa-0.4.0/examples/__marimo__/session/oakley_ohagan_15d.py.json +297 -0
  65. jaxgsa-0.4.0/examples/batch_reactor_gsa.py +443 -0
  66. jaxgsa-0.4.0/examples/benchmark_all.py +1050 -0
  67. jaxgsa-0.4.0/examples/benchmark_cache.json +183 -0
  68. jaxgsa-0.4.0/examples/dgsm_benchmark.py +262 -0
  69. jaxgsa-0.4.0/examples/dynamic_gsa.py +422 -0
  70. jaxgsa-0.4.0/examples/efast_gsa.py +470 -0
  71. jaxgsa-0.4.0/examples/method_comparison.py +693 -0
  72. jaxgsa-0.4.0/examples/morris_gsa.py +369 -0
  73. jaxgsa-0.4.0/examples/oakley_ohagan_15d.py +494 -0
  74. jaxgsa-0.4.0/examples/shapley_gsa.py +309 -0
  75. jaxgsa-0.4.0/pyproject.toml +83 -0
  76. jaxgsa-0.4.0/ruff.toml +5 -0
  77. jaxgsa-0.4.0/scripts/check_api_docs_coverage.py +112 -0
  78. jaxgsa-0.4.0/scripts/check_vitepress_pager.py +125 -0
  79. jaxgsa-0.4.0/src/jaxgsa/__init__.py +37 -0
  80. jaxgsa-0.4.0/src/jaxgsa/_core/__init__.py +5 -0
  81. jaxgsa-0.4.0/src/jaxgsa/_core/batching.py +120 -0
  82. jaxgsa-0.4.0/src/jaxgsa/_core/bootstrap.py +55 -0
  83. jaxgsa-0.4.0/src/jaxgsa/_core/partition.py +72 -0
  84. jaxgsa-0.4.0/src/jaxgsa/_core/samples.py +298 -0
  85. jaxgsa-0.4.0/src/jaxgsa/_core/sampling.py +140 -0
  86. jaxgsa-0.4.0/src/jaxgsa/_core/surrogate.py +140 -0
  87. jaxgsa-0.4.0/src/jaxgsa/_core/transforms.py +56 -0
  88. jaxgsa-0.4.0/src/jaxgsa/_core/validation.py +340 -0
  89. jaxgsa-0.4.0/src/jaxgsa/benchmarks/__init__.py +30 -0
  90. jaxgsa-0.4.0/src/jaxgsa/benchmarks/gaussian_linear.py +256 -0
  91. jaxgsa-0.4.0/src/jaxgsa/benchmarks/ishigami.py +157 -0
  92. jaxgsa-0.4.0/src/jaxgsa/benchmarks/linear.py +147 -0
  93. jaxgsa-0.4.0/src/jaxgsa/benchmarks/oakley_ohagan.py +189 -0
  94. jaxgsa-0.4.0/src/jaxgsa/benchmarks/sobol_g.py +143 -0
  95. jaxgsa-0.4.0/src/jaxgsa/borgonovo/__init__.py +25 -0
  96. jaxgsa-0.4.0/src/jaxgsa/borgonovo/_analyze.py +389 -0
  97. jaxgsa-0.4.0/src/jaxgsa/borgonovo/_result.py +77 -0
  98. jaxgsa-0.4.0/src/jaxgsa/config.py +98 -0
  99. jaxgsa-0.4.0/src/jaxgsa/dgsm/__init__.py +24 -0
  100. jaxgsa-0.4.0/src/jaxgsa/dgsm/_analyze.py +280 -0
  101. jaxgsa-0.4.0/src/jaxgsa/dgsm/_poincare.py +136 -0
  102. jaxgsa-0.4.0/src/jaxgsa/dgsm/_result.py +66 -0
  103. jaxgsa-0.4.0/src/jaxgsa/efast/__init__.py +20 -0
  104. jaxgsa-0.4.0/src/jaxgsa/efast/_analyze.py +245 -0
  105. jaxgsa-0.4.0/src/jaxgsa/efast/_result.py +65 -0
  106. jaxgsa-0.4.0/src/jaxgsa/efast/_sampling.py +243 -0
  107. jaxgsa-0.4.0/src/jaxgsa/hdmr/__init__.py +16 -0
  108. jaxgsa-0.4.0/src/jaxgsa/hdmr/_analyze.py +630 -0
  109. jaxgsa-0.4.0/src/jaxgsa/hdmr/_engine.py +613 -0
  110. jaxgsa-0.4.0/src/jaxgsa/hdmr/_result.py +300 -0
  111. jaxgsa-0.4.0/src/jaxgsa/hdmr/_stream.py +455 -0
  112. jaxgsa-0.4.0/src/jaxgsa/hsic/__init__.py +23 -0
  113. jaxgsa-0.4.0/src/jaxgsa/hsic/_analyze.py +495 -0
  114. jaxgsa-0.4.0/src/jaxgsa/hsic/_result.py +77 -0
  115. jaxgsa-0.4.0/src/jaxgsa/morris/__init__.py +21 -0
  116. jaxgsa-0.4.0/src/jaxgsa/morris/_analyze.py +349 -0
  117. jaxgsa-0.4.0/src/jaxgsa/morris/_result.py +125 -0
  118. jaxgsa-0.4.0/src/jaxgsa/morris/_sampling.py +484 -0
  119. jaxgsa-0.4.0/src/jaxgsa/optimal_transport/__init__.py +35 -0
  120. jaxgsa-0.4.0/src/jaxgsa/optimal_transport/_analyze.py +582 -0
  121. jaxgsa-0.4.0/src/jaxgsa/optimal_transport/_result.py +112 -0
  122. jaxgsa-0.4.0/src/jaxgsa/optimal_transport/_solver.py +123 -0
  123. jaxgsa-0.4.0/src/jaxgsa/pawn/__init__.py +23 -0
  124. jaxgsa-0.4.0/src/jaxgsa/pawn/_analyze.py +295 -0
  125. jaxgsa-0.4.0/src/jaxgsa/pawn/_result.py +63 -0
  126. jaxgsa-0.4.0/src/jaxgsa/pce/__init__.py +17 -0
  127. jaxgsa-0.4.0/src/jaxgsa/pce/_analyze.py +432 -0
  128. jaxgsa-0.4.0/src/jaxgsa/pce/_engine.py +260 -0
  129. jaxgsa-0.4.0/src/jaxgsa/pce/_result.py +163 -0
  130. jaxgsa-0.4.0/src/jaxgsa/problem.py +273 -0
  131. jaxgsa-0.4.0/src/jaxgsa/py.typed +0 -0
  132. jaxgsa-0.4.0/src/jaxgsa/sampling.py +48 -0
  133. jaxgsa-0.4.0/src/jaxgsa/shapley/__init__.py +18 -0
  134. jaxgsa-0.4.0/src/jaxgsa/shapley/_analyze.py +225 -0
  135. jaxgsa-0.4.0/src/jaxgsa/shapley/_engine.py +66 -0
  136. jaxgsa-0.4.0/src/jaxgsa/shapley/_result.py +121 -0
  137. jaxgsa-0.4.0/src/jaxgsa/sobol/__init__.py +17 -0
  138. jaxgsa-0.4.0/src/jaxgsa/sobol/_analyze.py +574 -0
  139. jaxgsa-0.4.0/src/jaxgsa/sobol/_bootstrap.py +156 -0
  140. jaxgsa-0.4.0/src/jaxgsa/sobol/_indices.py +200 -0
  141. jaxgsa-0.4.0/src/jaxgsa/sobol/_result.py +111 -0
  142. jaxgsa-0.4.0/src/jaxgsa/sobol/_sampling.py +361 -0
  143. jaxgsa-0.4.0/tests/conftest.py +55 -0
  144. jaxgsa-0.4.0/tests/test_analytical.py +187 -0
  145. jaxgsa-0.4.0/tests/test_analyze.py +626 -0
  146. jaxgsa-0.4.0/tests/test_borgonovo.py +482 -0
  147. jaxgsa-0.4.0/tests/test_cleaning.py +111 -0
  148. jaxgsa-0.4.0/tests/test_config.py +49 -0
  149. jaxgsa-0.4.0/tests/test_dgsm.py +598 -0
  150. jaxgsa-0.4.0/tests/test_efast.py +468 -0
  151. jaxgsa-0.4.0/tests/test_emulate_batching.py +229 -0
  152. jaxgsa-0.4.0/tests/test_hdmr.py +809 -0
  153. jaxgsa-0.4.0/tests/test_hdmr_streaming.py +237 -0
  154. jaxgsa-0.4.0/tests/test_hsic.py +416 -0
  155. jaxgsa-0.4.0/tests/test_imports.py +67 -0
  156. jaxgsa-0.4.0/tests/test_indices.py +80 -0
  157. jaxgsa-0.4.0/tests/test_morris.py +592 -0
  158. jaxgsa-0.4.0/tests/test_optimal_transport.py +602 -0
  159. jaxgsa-0.4.0/tests/test_output_shapes.py +54 -0
  160. jaxgsa-0.4.0/tests/test_pawn.py +291 -0
  161. jaxgsa-0.4.0/tests/test_pce.py +598 -0
  162. jaxgsa-0.4.0/tests/test_pce_streaming.py +218 -0
  163. jaxgsa-0.4.0/tests/test_problem.py +92 -0
  164. jaxgsa-0.4.0/tests/test_sampling.py +348 -0
  165. jaxgsa-0.4.0/tests/test_save_load.py +295 -0
  166. jaxgsa-0.4.0/tests/test_shapes.py +127 -0
  167. jaxgsa-0.4.0/tests/test_shapley.py +462 -0
  168. jaxgsa-0.4.0/tests/test_xarray.py +291 -0
  169. jaxgsa-0.4.0/uv.lock +1399 -0
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ updates:
3
+ # Keep the GitHub Actions used by CI / publish workflows up to date.
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ groups:
9
+ actions:
10
+ patterns: ["*"]
11
+
12
+ # Keep the locked Python dependencies (uv.lock) current. Grouped into a
13
+ # single weekly PR to minimise noise; these are lockfile/dev pins, not the
14
+ # public version floors declared in pyproject.toml.
15
+ - package-ecosystem: "uv"
16
+ directory: "/"
17
+ schedule:
18
+ interval: "weekly"
19
+ groups:
20
+ python-dependencies:
21
+ patterns: ["*"]
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.12", "3.13"]
20
+ steps:
21
+ - uses: actions/checkout@v7
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v7
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ enable-cache: true
28
+
29
+ - name: Install project and dev dependencies
30
+ run: uv sync --extra dev
31
+
32
+ - name: Ruff format check
33
+ run: uv run ruff format --check .
34
+
35
+ - name: Ruff lint
36
+ run: uv run ruff check .
37
+
38
+ - name: Type check
39
+ run: uv run ty check src/jaxgsa
40
+
41
+ - name: Run tests
42
+ run: uv run pytest -q
@@ -0,0 +1,39 @@
1
+ name: Check Docs
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - ".github/workflows/docs-check.yml"
7
+ - ".github/workflows/docs.yml"
8
+ - "README.md"
9
+ - "docs/**"
10
+ - "scripts/check_api_docs_coverage.py"
11
+ - "scripts/check_vitepress_pager.py"
12
+ - "src/jaxgsa/**"
13
+ push:
14
+ branches:
15
+ - master
16
+ paths:
17
+ - ".github/workflows/docs-check.yml"
18
+ - ".github/workflows/docs.yml"
19
+ - "README.md"
20
+ - "docs/**"
21
+ - "scripts/check_api_docs_coverage.py"
22
+ - "scripts/check_vitepress_pager.py"
23
+ - "src/jaxgsa/**"
24
+
25
+ jobs:
26
+ docs-check:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v7
30
+ - uses: actions/setup-python@v6
31
+ with:
32
+ python-version: "3.12"
33
+ - uses: actions/setup-node@v6
34
+ with:
35
+ node-version: 22
36
+ - run: npm ci
37
+ working-directory: docs
38
+ - run: npm run docs:check
39
+ working-directory: docs
@@ -0,0 +1,47 @@
1
+ name: Deploy VitePress to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ if: contains(github.event.head_commit.message, '[build docs]') || github.event_name == 'workflow_dispatch'
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v7
23
+ with:
24
+ fetch-depth: 0
25
+ - uses: actions/setup-python@v6
26
+ with:
27
+ python-version: "3.12"
28
+ - uses: actions/setup-node@v6
29
+ with:
30
+ node-version: 22
31
+ - run: npm ci
32
+ working-directory: docs
33
+ - run: npm run docs:check
34
+ working-directory: docs
35
+ - uses: actions/upload-pages-artifact@v5
36
+ with:
37
+ path: docs/.vitepress/dist
38
+
39
+ deploy:
40
+ environment:
41
+ name: github-pages
42
+ url: ${{ steps.deployment.outputs.page_url }}
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - id: deployment
47
+ uses: actions/deploy-pages@v5
@@ -0,0 +1,48 @@
1
+ # Publishes jaxgsa to PyPI when a GitHub Release is published.
2
+ #
3
+ # Setup required once on PyPI (no API tokens needed):
4
+ # PyPI project -> Settings -> Publishing -> add a "trusted publisher" for
5
+ # owner=DanielePessina, repo=jaxgsa, workflow=publish.yml, environment=pypi.
6
+ # See https://docs.pypi.org/trusted-publishers/
7
+ name: Publish to PyPI
8
+
9
+ on:
10
+ release:
11
+ types: [published]
12
+ workflow_dispatch:
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v7
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v7
22
+ with:
23
+ python-version: "3.12"
24
+
25
+ - name: Build sdist and wheel
26
+ run: uv build
27
+
28
+ - uses: actions/upload-artifact@v7
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+
33
+ publish:
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: pypi
38
+ url: https://pypi.org/p/jaxgsa
39
+ permissions:
40
+ id-token: write # OIDC token for PyPI trusted publishing
41
+ steps:
42
+ - uses: actions/download-artifact@v8
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+
47
+ - name: Publish to PyPI
48
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,113 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # MacOS
13
+ .DS_Store
14
+
15
+ # Aim
16
+ .aim/
17
+
18
+ # VS Code config
19
+ .vscode/settings.json
20
+
21
+ # Repomix
22
+ .repomix/
23
+ *.xml
24
+
25
+ # Claude Code
26
+ .claude/
27
+
28
+ # Local AI-agent instructions (kept on disk, not published)
29
+ AGENTS.md
30
+ CLAUDE.md
31
+
32
+ # Temporary files
33
+ tmp/
34
+
35
+
36
+ .Rproj.user
37
+
38
+ # GSA simulation results (keep metadata, ignore large output files)
39
+ scripts/results/salib_runs/**/*_sim.xlsx
40
+ scripts/results/salib_runs/**/*_sim.csv
41
+ scripts/results/salib_runs/**/*_sim.feather
42
+ # scripts/results/salib_runs/**/*_sim__*.parquet
43
+
44
+ ### Core LaTeX files
45
+ *.aux
46
+ *.lof
47
+ *.log
48
+ *.lot
49
+ *.fls
50
+ *.out
51
+ *.toc
52
+ *.fmt
53
+ *.fot
54
+ *.cb
55
+ *.cb2
56
+ .*.lb
57
+
58
+ ## Intermediate documents
59
+ *.dvi
60
+ *.xdv
61
+ *-converted-to.*
62
+
63
+ ## Bibliography auxiliary files
64
+ *.bbl
65
+ *.bcf
66
+ *.blg
67
+ *-blx.aux
68
+ *-blx.bib
69
+ *.run.xml
70
+
71
+ ## Build tool auxiliary files
72
+ *.fdb_latexmk
73
+ *.synctex
74
+ *.synctex(busy)
75
+ *.synctex.gz
76
+ *.synctex.gz(busy)
77
+ *.pdfsync
78
+
79
+ ## Build tool directories
80
+ latex.out/
81
+
82
+ ## Auxiliary and intermediate files from other packages
83
+ *.makefile
84
+ *.idx
85
+ *.ilg
86
+ *.ind
87
+
88
+ ## Glossaries
89
+ *.acn
90
+ *.acr
91
+ *.glg
92
+ *.glo
93
+ *.gls
94
+ *.glsdefs
95
+ *.lzo
96
+ *.lzs
97
+
98
+ ## Uncomment if you don't want to keep the PDF output
99
+ # *.pdf
100
+
101
+ ## Backup files
102
+ *.backup
103
+ *.bak
104
+ *~
105
+
106
+ ## Editor-specific files
107
+ .vscode/
108
+ .DS_Store
109
+ *.swp
110
+ *.swo
111
+ *~
112
+
113
+ docs/node_modules/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,304 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0
4
+
5
+ ### Changed
6
+
7
+ - **BREAKING: renamed the package from `gsax` to `jaxgsa`.** The distribution
8
+ and import name are now `jaxgsa` (`pip install jaxgsa`, `import jaxgsa`). The
9
+ old `gsax` project on PyPI is frozen at `0.3.0b1` with no compatibility shim;
10
+ see the [0.3 → 0.4 migration guide](docs/guide/migration-0.4.md).
11
+ - Replaced root-level command aliases with method namespaces such as
12
+ `jaxgsa.sobol.sample`, `jaxgsa.sobol.analyze`, `jaxgsa.pce.analyze`, and
13
+ `jaxgsa.hdmr.analyze`.
14
+ - Moved surrogate prediction and Shapley derivation onto `PCEResult` and
15
+ `HDMRResult` through `predict(...)` and `shapley(...)`.
16
+ - Enforced one output contract across methods: `(N,)`, `(N, K)`, or
17
+ `(N, T, K)`. Axis inference and automatic transposition were removed.
18
+ - Renamed the main sampling/result types to `SobolSamples`, `SobolResult`, and
19
+ `MorrisSamples`.
20
+ - Simplified Sobol persistence to one NPZ file through
21
+ `SobolSamples.save(...)` and `SobolSamples.load(...)`; removed pandas and
22
+ format-specific persistence dependencies.
23
+ - Renamed the design row-count fields on `SobolSamples` and `MorrisSamples`:
24
+ `n_total` is now `n_runs` (unique rows you evaluate, one model run per row)
25
+ and `expanded_n_total` is now `n_expanded` (pre-deduplication design size).
26
+ - Retyped the eFAST workflow: `jaxgsa.efast.sample(problem, n_per_curve, *, M=4,
27
+ ...)` (the second parameter was `N`) returns a typed `EFASTSamples` carrying
28
+ `samples`, `n_per_curve`, `M`, `problem`, and an `n_runs` property;
29
+ `jaxgsa.efast.analyze(samples, Y, ...)` is samples-first and no longer takes
30
+ `M` or `problem` — both are threaded from the design object, so a mismatch
31
+ between sampling and analysis is now impossible.
32
+ - Tightened the eFAST design bound to `n_per_curve >= 4*M^2*(D-1) + 1` (was
33
+ `n_per_curve > 4*M^2`, independent of `D`). Below the new bound there are
34
+ not enough integer frequencies below `omega_0/(2M)` to give each non-focal
35
+ parameter a distinct one; the old code wrapped them cyclically, so two
36
+ parameters got the same frequency and the same phase and were therefore
37
+ identical along that search curve — a silent bias. Such designs now raise
38
+ `ValueError` from both `efast.sample` and `EFASTSamples`.
39
+ - Standardized the batching vocabulary package-wide: `batch_size` always means
40
+ rows of X/Y per batch (`pce.analyze`, `hdmr.analyze`, `dgsm.analyze`,
41
+ `hsic.analyze`, and `result.predict`); output-slice chunking parameters were
42
+ renamed from `chunk_size` to `slice_chunk_size` on `hdmr`, `efast`, `sobol`,
43
+ `borgonovo`, `optimal_transport`, and `pawn` `analyze`.
44
+ - Moved shared internals into a private `jaxgsa._core` package and introduced
45
+ private base classes for sample designs and surrogate results (internal
46
+ reorganization; no user-facing API change).
47
+
48
+ ### Added
49
+
50
+ - Correlation-aware HDMR Shapley effects with
51
+ `result.shapley(include_correlative=True)`.
52
+ - Dense structural `HDMRResult.S2` and `HDMRResult.S3` interaction arrays.
53
+ - Bounded-memory batched prediction for PCE and HDMR result objects.
54
+ - Automatic streaming fits for `jaxgsa.pce.analyze` and `jaxgsa.hdmr.analyze`:
55
+ when the estimated single-pass fit memory exceeds the active budget, the
56
+ fit streams over row batches. The streamed path is mathematically exact —
57
+ it accumulates the same Gram matrices and moments as the in-memory path
58
+ (PCE leave-one-out diagnostics stay exact via a second streamed pass),
59
+ differing only in floating-point summation order. An explicit `batch_size=`
60
+ forces streaming.
61
+ - `jaxgsa.config.set_memory_budget(bytes)` / `jaxgsa.config.get_memory_budget()`:
62
+ an opt-in, process-global transient-memory budget (default 512 MiB) that
63
+ sizes every automatic batching decision — surrogate `predict` batches, HDMR
64
+ output-slice chunking, and the streaming fits. Explicit per-call
65
+ `batch_size` / `slice_chunk_size` parameters always take precedence.
66
+ - `MorrisSamples.save(path)` and `MorrisSamples.load(path)`, using the same
67
+ single-NPZ format and metadata schema as `SobolSamples`.
68
+ - `jaxgsa.shapley.analyze(problem, X, Y, backend="pce"|"hdmr", ...)`: a thin
69
+ convenience wrapper over the canonical result methods
70
+ (`pce.analyze(...).shapley()` / `hdmr.analyze(...).shapley(...)`).
71
+ - A 0.3 to 0.4 API migration guide.
72
+
73
+ ### Improved
74
+
75
+ - Power-of-2 validation errors now name the two nearest valid values, so the
76
+ message states exactly which sample counts would be accepted.
77
+
78
+ ## 0.3.0b1
79
+
80
+ ### Added
81
+
82
+ - **Optimal-transport sensitivity indices**
83
+ (`jaxgsa.optimal_transport`, re-exported as `jaxgsa.analyze_optimal_transport()`):
84
+ the Wasserstein-based distributional indices of Borgonovo, Figalli,
85
+ Plischke & Savaré (2024, Management Science, doi:10.1287/mnsc.2023.01796) —
86
+ the class-averaged squared 2-Wasserstein distance between conditional and
87
+ unconditional output distributions, normalized to [0, 1] by `2 * Var(Y)`,
88
+ with
89
+ - an exact **advective/diffusive decomposition** of every index: the
90
+ advective (location-shift) component equals half the given-data
91
+ first-order Sobol index, the diffusive remainder captures changes in
92
+ spread, tails and shape;
93
+ - three output modes: `"univariate"` (default; per output column via the
94
+ closed-form 1-D sorted-quantile coupling — no iterative solver),
95
+ `"multivariate"` (one index per input over the flattened joint output as a
96
+ point cloud), and `"trajectory"` (one index per input per output
97
+ over each output's whole time course), covering scalar, multi-output,
98
+ and time-series `Y`;
99
+ - a pure-JAX **log-domain Sinkhorn** solver for the point-cloud modes (entropic
100
+ regularization on the max-scaled cost, unregularized `<P, C>` reported,
101
+ single post-hoc convergence warning), with per-output standardization
102
+ on by default;
103
+ - **rank-based conditioning**: distribution-free in X (uniform, Gaussian,
104
+ truncated-Gaussian, or mixed marginals work unchanged) and well-defined
105
+ for correlated inputs (total, correlation-inclusive influence);
106
+ - an opt-in `dummy=True` irrelevance baseline (a synthetic independent
107
+ input scored through the identical pipeline) to threshold against the
108
+ entropic/finite-sample index floor;
109
+ - percentile bootstrap confidence intervals sharing one scanned code path
110
+ with the point estimate, and `OTResult.to_dataset()` xarray export.
111
+ Implemented from the published equations; numerics are validated in
112
+ the test suite against POT (`ot.wasserstein_1d`,
113
+ `ot.sinkhorn2`, `ot.emd2`; new `pot` dev extra), analytic Gaussian closed
114
+ forms (new `jaxgsa.benchmarks.gaussian_linear.ANALYTICAL_OT` constant), the
115
+ published Ishigami anchor, and the `2 * advective == S1` identity.
116
+ - Shared `jaxgsa._partition` module: the equal-frequency rank-partition
117
+ helpers (`_class_layout`, `_build_class_indices`) moved out of
118
+ `jaxgsa.borgonovo` so the Borgonovo delta and optimal-transport estimators
119
+ use one implementation (no behavior change).
120
+
121
+ ## 0.2.0
122
+
123
+ ### Added
124
+
125
+ - **Morris** elementary-effects screening
126
+ (`jaxgsa.morris`, re-exported as `jaxgsa.morris.sample()` /
127
+ `jaxgsa.morris.analyze()`): globalized one-at-a-time screening that reduces
128
+ `r * (D + 1)` model evaluations to mu, mu_star (importance ranking), and
129
+ sigma (nonlinearity/interaction flag), with
130
+ - trajectory (Morris, 1991) and radial (Campolongo et al., 2011,
131
+ scrambled-Sobol' star) designs;
132
+ - uniform and Gaussian marginals — Gaussian coordinates are confined to a
133
+ truncated-quantile grid (`truncation_quantile`, default 0.005) so the
134
+ design probes the 0.5%–99.5% quantile range instead of unbounded tails;
135
+ - unique-row deduplication, so grid collisions across trajectories do not
136
+ cost real model evaluations (same contract as Saltelli `sample()`);
137
+ - scalar, multi-output, and time-series outputs, non-finite trajectory
138
+ cleaning, and bootstrap confidence intervals over trajectories;
139
+ - `MorrisSamples.downsample()` prefix-slicing to fewer trajectories
140
+ without re-simulation, and `MorrisResult.to_physical_units()` /
141
+ `to_dataset()` for derivative-scale measures and labeled xarray export.
142
+ - **Shapley effects** (`jaxgsa.analyze_shapley`, `ShapleyResult`) — global
143
+ Shapley-value allocation of output variance across inputs (Owen 2014;
144
+ Song, Nelson & Staum 2016), computed analytically from a fitted surrogate's
145
+ variance decomposition instead of permutation Monte Carlo. Two backends:
146
+ `"pce"` (default; subset variances read off orthonormal polynomial
147
+ coefficients) and `"hdmr"` (RS-HDMR component-function variances); both
148
+ accept scalar, multi-output, and time-series outputs. Indices are
149
+ normalized by the surrogate's total decomposed variance, so `Sh` sums to
150
+ exactly 1 (the Shapley efficiency property); the `explained_variance` field
151
+ reports the fraction of `Var(Y)` the surrogate captured, and the `order`
152
+ field the effective surrogate order used. For the `"pce"` backend `S1`/`ST`
153
+ match `analyze_pce` exactly. A `UserWarning` flags a pathological fit
154
+ (`explained_variance` far from 1). Assumes independent inputs.
155
+ - Closed-form analytical Shapley values (`ANALYTICAL_SHAPLEY`,
156
+ `analytical_shapley(...)`) for the Ishigami, linear, and Sobol-G
157
+ benchmarks, used to validate the new method.
158
+ - `jaxgsa.borgonovo` subpackage — moment-independent, density-based sensitivity via
159
+ the Plischke, Borgonovo & Smith (2013) given-data estimator of Borgonovo's
160
+ (2007) delta index. `analyze` (top-level alias `analyze_borgonovo`) returns both
161
+ the delta index and the given-data first-order Sobol `S1` from the same
162
+ rank-class partition, with bootstrap bias correction (`2*d_hat - mean(d_boot)`)
163
+ and percentile confidence intervals. Works with any `(X, Y)` pairs and supports
164
+ scalar, multi-output, and time-series outputs.
165
+ - `DeltaResult` dataclass holding the delta and `S1` indices with optional
166
+ bootstrap intervals and a `to_dataset()` xarray export.
167
+ - `jaxgsa.benchmarks.gaussian_linear` — a Gaussian linear additive benchmark whose
168
+ Gaussian marginals give the Borgonovo delta index a semi-analytic solution
169
+ (`ANALYTICAL_DELTA`), for ground-truth validation of the delta estimator.
170
+ - **Uniform output support across all ten methods** — every analyze entry point
171
+ now accepts `(N,)`, `(N, K)`, and `(N, T, K)` outputs. `analyze_pce`,
172
+ `analyze_shapley` (`"pce"` backend), and `dgsm.analyze` gained
173
+ multi-output/time-series support: PCE fits all output slices against one
174
+ shared basis in a single multi-right-hand-side solve, and DGSM accepts
175
+ `(T, K)`-valued functions and precomputed Jacobians. A precomputed `dfdx`
176
+ must mirror `Y`'s layout with one extra trailing `(D,)` axis, and singleton
177
+ promotions are tolerated (`(N,)` pairs with `(N, 1, D)`, `(N, 1)` with
178
+ `(N, D)`); whatever axis moves layout inference applies to a transposed or
179
+ single-labeled `Y` are replayed on `dfdx`.
180
+ - **Smart output-layout inference** at every public entry point. `Y` is
181
+ resolved from two signals — the expected sample count identifies the sample
182
+ axis, and `len(problem.output_names)` (when set) identifies the output
183
+ axis — through a strict ladder: exact canonical shapes pass silently;
184
+ unambiguously recoverable layouts (e.g. a transposed `(K, N)` array, or a
185
+ 3-D `(N, K, T)` array whose middle axis matches the labels) are fixed with
186
+ a `UserWarning` naming the transformation; ambiguous layouts raise. The
187
+ warnings point at the user's call site (a corrected `stacklevel` across all
188
+ ten methods). Label rule: a 2-D `Y` of shape `(N, M)` with exactly **one**
189
+ entry in `problem.output_names` and `M > 1` is read as `M` timepoints of that
190
+ single output and flows as `(N, M, 1)`; a lone column `(N, 1)` stays canonical
191
+ as `(N, K=1)` (a scalar output, not a 1-timepoint series — pass `(N, 1, 1)`
192
+ for that). Without `output_names`, 2-D `Y` still always means `(N, K)`. A 1-D
193
+ `(N,)` `Y` is accepted as one output regardless of how many names the problem
194
+ lists.
195
+ - `time_coords` parameter on `PCEResult.to_dataset()` and
196
+ `DGSMResult.to_dataset()` for labeled time axes on 3-D results
197
+ (dims `(time, output, param)`).
198
+
199
+ ### Changed
200
+
201
+ - RS-HDMR now returns `NaN` sensitivity indices (with the existing
202
+ zero-variance warning) for constant-output slices, matching the
203
+ package-wide convention used by Sobol and PCE, instead of silent zeros.
204
+ - `analyze_pce` now emits a `UserWarning` when the requested polynomial
205
+ `order` is automatically reduced to fit the sample budget, and warns on a
206
+ constant (zero-variance) output.
207
+ - Input-validation errors are now uniform across methods: RS-HDMR, PCE, and
208
+ DGSM share the same `X`/`Y` contract checks (and error messages) as the
209
+ given-data methods, and RS-HDMR now also rejects `X`/`Y` row-count
210
+ mismatches up front.
211
+ - `PCEResult` field layouts now mirror the output layout: `S1`/`ST` are
212
+ `(..., D)`, `S2` is `(..., D, D)` with a `NaN` diagonal, `coefficients` is
213
+ `(..., n_terms)` with the term axis last, and `loo_rmse` is per output slice
214
+ (`()`, `(K,)`, or `(T, K)`). `order` remains a single int — all slices share
215
+ one basis.
216
+ - `emulate_pce` and `emulate_hdmr` mirror the original training-`Y` rank: a 2-D
217
+ `(N, T)` single-labeled training `Y` (fit internally as `(N, T, 1)`) now
218
+ predicts `(N_new, T)` rather than `(N_new, T, 1)`, so `pred - Y_train`
219
+ broadcasts as expected.
220
+ - PCE Sobol-index extraction is vectorized end to end: `S1`/`ST`/`S2` are
221
+ masked matmuls over the term axis (`S2` uses an upper-triangle pair mask),
222
+ replacing the previous Python pair loop.
223
+
224
+ ### Internal
225
+
226
+ - Bootstrap confidence-interval helpers moved to a shared `jaxgsa._bootstrap`
227
+ module (previously private to `jaxgsa.sobol` and cross-imported by Morris);
228
+ PAWN and Borgonovo now reuse the same percentile-CI implementation.
229
+ - All ten result classes now build their `to_dataset()` dims/coords through the
230
+ shared `_dims_and_coords` helper (including `HDMRResult`, whose per-term
231
+ arrays swap the trailing `param` dim for `term`), instead of hand-rolling the
232
+ `param`/`output`/`time` schema; the singleton-axis squeeze after analysis is
233
+ likewise a single shared `_squeeze_output_axes` helper.
234
+ - `analyze_shapley` now fits through the shared PCE/HDMR cores directly: the
235
+ default `"pce"` backend reuses `analyze_pce`'s fit without recomputing the
236
+ `S2` einsum and LOO diagnostic it discards, and both backends validate `Y`
237
+ and warn about zero-variance slices exactly once.
238
+
239
+ ## 0.1.2
240
+
241
+ ### Added
242
+
243
+ - `jaxgsa.config.enable_compilation_cache(path, ...)` — opt-in helper that enables JAX's
244
+ persistent, on-disk compilation cache so compiled kernels are reused across
245
+ process restarts (parameter sweeps, CI, HPC batches).
246
+ - Configuration guide covering double precision (`jax_enable_x64`) for
247
+ precision-sensitive Sobol/HSIC estimators and the compilation cache.
248
+
249
+ ### Changed
250
+
251
+ - Raise the minimum JAX/jaxlib version to 0.6 — the oldest release the test
252
+ suite is validated against (previously advertised 0.4 but never tested there).
253
+ - Benchmark harness times the SALib HDMR path with the same best-of-N method as
254
+ the other paths and refreshes the published tables (measured on Apple M1 Pro,
255
+ JAX 0.10.2); the one-off XLA compile is documented as excluded from the
256
+ steady-state numbers.
257
+ - The test suite now promotes `DeprecationWarning`/`FutureWarning` to errors
258
+ (ignore-listing known third-party ones), so upcoming API removals — JAX API
259
+ changes especially — surface in CI instead of passing silently.
260
+
261
+ ### Fixed
262
+
263
+ - Benchmark timing helper in `examples/benchmark_all.py` now synchronizes every
264
+ result array (including bootstrap confidence intervals) before stopping the
265
+ timer, so no async device work leaks out of the timed region.
266
+
267
+ ## 0.1.1
268
+
269
+ ### Fixed
270
+
271
+ - HDMR: widen the `scan`/`vmap` loop-variable annotations to `int | Array`
272
+ so the package type-checks under newer `ty` releases (no runtime change).
273
+ - Loosen the HDMR chunk-size regression test tolerance to absorb
274
+ floating-point reduction-order differences across jax versions.
275
+
276
+ ### Changed
277
+
278
+ - Documentation installs jaxgsa from PyPI (`pip install jaxgsa` / `uv add jaxgsa`).
279
+ - Update pinned development/CI dependencies and GitHub Actions; add weekly
280
+ Dependabot updates for Python dependencies.
281
+
282
+ ## 0.1.0
283
+
284
+ Initial public release.
285
+
286
+ `jaxgsa` provides global sensitivity analysis in JAX with seven complementary
287
+ methods:
288
+
289
+ - **Sobol** indices via Saltelli sampling — first-, total-, and second-order,
290
+ with JAX-accelerated bootstrap confidence intervals.
291
+ - **RS-HDMR** — B-spline surrogate with ANCOVA decomposition and a built-in
292
+ emulator; works with any `(X, Y)` sample pairs.
293
+ - **PCE** — Polynomial Chaos Expansion with analytical Sobol indices and
294
+ leave-one-out cross-validation.
295
+ - **eFAST** — Extended Fourier Amplitude Sensitivity Test.
296
+ - **DGSM** — Derivative-based measures via JAX autodiff, with Poincaré-constant
297
+ bounds on total Sobol indices.
298
+ - **HSIC** — Hilbert–Schmidt Independence Criterion (kernel-based dependence,
299
+ R2-HSIC and Total HSIC, permutation p-values).
300
+ - **PAWN** — moment-independent, CDF-based sensitivity via Kolmogorov–Smirnov
301
+ distances.
302
+
303
+ All methods support scalar, multi-output, and time-series outputs and export to
304
+ labeled `xarray` Datasets.
@@ -0,0 +1,22 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it using these metadata."
3
+ title: "jaxgsa: Global Sensitivity Analysis in JAX"
4
+ abstract: >-
5
+ jaxgsa computes global sensitivity indices entirely in JAX, providing Sobol,
6
+ RS-HDMR, PCE, eFAST, DGSM, HSIC, and PAWN methods with GPU/TPU acceleration.
7
+ type: software
8
+ authors:
9
+ - family-names: Pessina
10
+ given-names: Daniele
11
+ email: danielepessina99@gmail.com
12
+ version: 0.1.0
13
+ date-released: "2026-07-09"
14
+ license: MIT
15
+ repository-code: "https://github.com/DanielePessina/jaxgsa"
16
+ url: "https://danielepessina.github.io/jaxgsa/"
17
+ keywords:
18
+ - sensitivity-analysis
19
+ - global-sensitivity-analysis
20
+ - sobol
21
+ - jax
22
+ - uncertainty-quantification
@@ -0,0 +1,40 @@
1
+ # Contributing to jaxgsa
2
+
3
+ Thanks for your interest in improving jaxgsa! This guide covers the local setup
4
+ and the checks a pull request is expected to pass.
5
+
6
+ ## Development setup
7
+
8
+ jaxgsa uses [uv](https://docs.astral.sh/uv/) for environment and dependency
9
+ management.
10
+
11
+ ```bash
12
+ git clone https://github.com/DanielePessina/jaxgsa.git
13
+ cd jaxgsa
14
+ uv sync --extra dev
15
+ ```
16
+
17
+ ## Before opening a pull request
18
+
19
+ Run the same checks CI runs, and make sure they all pass:
20
+
21
+ ```bash
22
+ uv run ruff format . # format
23
+ uv run ruff check . # lint
24
+ uv run ty check src/jaxgsa # type-check
25
+ uv run pytest # tests
26
+ ```
27
+
28
+ Please also:
29
+
30
+ - Add or update tests for any behaviour you change.
31
+ - Keep public APIs documented with Google-style docstrings.
32
+ - Update `CHANGELOG.md` under the unreleased section when user-facing behaviour
33
+ changes.
34
+ - If you touch the public API, run `uv run python scripts/check_api_docs_coverage.py`
35
+ so the reference docs stay complete.
36
+
37
+ ## Reporting issues
38
+
39
+ Please open an issue with a minimal reproducible example, the jaxgsa version, and
40
+ your Python/JAX versions.