gsax 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 (122) hide show
  1. gsax-0.1.0/.github/dependabot.yml +10 -0
  2. gsax-0.1.0/.github/workflows/ci.yml +42 -0
  3. gsax-0.1.0/.github/workflows/docs-check.yml +39 -0
  4. gsax-0.1.0/.github/workflows/docs.yml +47 -0
  5. gsax-0.1.0/.github/workflows/publish.yml +48 -0
  6. gsax-0.1.0/.gitignore +113 -0
  7. gsax-0.1.0/.python-version +1 -0
  8. gsax-0.1.0/CHANGELOG.md +25 -0
  9. gsax-0.1.0/CITATION.cff +22 -0
  10. gsax-0.1.0/CONTRIBUTING.md +40 -0
  11. gsax-0.1.0/LICENSE +21 -0
  12. gsax-0.1.0/PKG-INFO +501 -0
  13. gsax-0.1.0/README.md +457 -0
  14. gsax-0.1.0/benchmark_salib.py +655 -0
  15. gsax-0.1.0/docs/.gitignore +3 -0
  16. gsax-0.1.0/docs/.vitepress/config.ts +57 -0
  17. gsax-0.1.0/docs/api/analyze.md +15 -0
  18. gsax-0.1.0/docs/api/dgsm.md +17 -0
  19. gsax-0.1.0/docs/api/efast.md +15 -0
  20. gsax-0.1.0/docs/api/hdmr.md +19 -0
  21. gsax-0.1.0/docs/api/hsic.md +15 -0
  22. gsax-0.1.0/docs/api/index.md +1509 -0
  23. gsax-0.1.0/docs/api/pawn.md +15 -0
  24. gsax-0.1.0/docs/api/pce.md +15 -0
  25. gsax-0.1.0/docs/api/problem.md +13 -0
  26. gsax-0.1.0/docs/api/sampling.md +20 -0
  27. gsax-0.1.0/docs/examples/advanced-workflow.md +121 -0
  28. gsax-0.1.0/docs/examples/basic.md +92 -0
  29. gsax-0.1.0/docs/examples/batch_reactor.md +39 -0
  30. gsax-0.1.0/docs/examples/bootstrap.md +78 -0
  31. gsax-0.1.0/docs/examples/dgsm.md +154 -0
  32. gsax-0.1.0/docs/examples/efast.md +186 -0
  33. gsax-0.1.0/docs/examples/hdmr.md +95 -0
  34. gsax-0.1.0/docs/examples/hsic.md +197 -0
  35. gsax-0.1.0/docs/examples/multi-output.md +100 -0
  36. gsax-0.1.0/docs/examples/non-uniform-inputs.md +116 -0
  37. gsax-0.1.0/docs/examples/pawn.md +164 -0
  38. gsax-0.1.0/docs/examples/pce.md +130 -0
  39. gsax-0.1.0/docs/examples/save-load.md +67 -0
  40. gsax-0.1.0/docs/examples/xarray.md +119 -0
  41. gsax-0.1.0/docs/guide/benchmarks.md +162 -0
  42. gsax-0.1.0/docs/guide/getting-started.md +95 -0
  43. gsax-0.1.0/docs/guide/methods.md +462 -0
  44. gsax-0.1.0/docs/index.md +35 -0
  45. gsax-0.1.0/docs/package-lock.json +3012 -0
  46. gsax-0.1.0/docs/package.json +16 -0
  47. gsax-0.1.0/docs/public/notebooks/batch_reactor_gsa.html +305 -0
  48. gsax-0.1.0/examples/__marimo__/session/batch_reactor_gsa.py.json +264 -0
  49. gsax-0.1.0/examples/__marimo__/session/benchmark_all.py.json +172 -0
  50. gsax-0.1.0/examples/__marimo__/session/dgsm_benchmark.py.json +178 -0
  51. gsax-0.1.0/examples/__marimo__/session/dynamic_gsa.py.json +238 -0
  52. gsax-0.1.0/examples/__marimo__/session/efast_gsa.py.json +278 -0
  53. gsax-0.1.0/examples/__marimo__/session/method_comparison.py.json +139 -0
  54. gsax-0.1.0/examples/__marimo__/session/oakley_ohagan_15d.py.json +297 -0
  55. gsax-0.1.0/examples/batch_reactor_gsa.py +437 -0
  56. gsax-0.1.0/examples/benchmark_all.py +1050 -0
  57. gsax-0.1.0/examples/benchmark_cache.json +183 -0
  58. gsax-0.1.0/examples/dgsm_benchmark.py +259 -0
  59. gsax-0.1.0/examples/dynamic_gsa.py +414 -0
  60. gsax-0.1.0/examples/efast_gsa.py +461 -0
  61. gsax-0.1.0/examples/method_comparison.py +417 -0
  62. gsax-0.1.0/examples/oakley_ohagan_15d.py +488 -0
  63. gsax-0.1.0/pyproject.toml +63 -0
  64. gsax-0.1.0/ruff.toml +5 -0
  65. gsax-0.1.0/scripts/check_api_docs_coverage.py +162 -0
  66. gsax-0.1.0/scripts/check_vitepress_pager.py +115 -0
  67. gsax-0.1.0/src/gsax/__init__.py +48 -0
  68. gsax-0.1.0/src/gsax/_normalization.py +170 -0
  69. gsax-0.1.0/src/gsax/_transforms.py +56 -0
  70. gsax-0.1.0/src/gsax/benchmarks/__init__.py +22 -0
  71. gsax-0.1.0/src/gsax/benchmarks/ishigami.py +111 -0
  72. gsax-0.1.0/src/gsax/benchmarks/linear.py +94 -0
  73. gsax-0.1.0/src/gsax/benchmarks/oakley_ohagan.py +189 -0
  74. gsax-0.1.0/src/gsax/benchmarks/sobol_g.py +102 -0
  75. gsax-0.1.0/src/gsax/dgsm/__init__.py +20 -0
  76. gsax-0.1.0/src/gsax/dgsm/_analyze.py +205 -0
  77. gsax-0.1.0/src/gsax/dgsm/_poincare.py +132 -0
  78. gsax-0.1.0/src/gsax/dgsm/_result.py +71 -0
  79. gsax-0.1.0/src/gsax/efast/__init__.py +20 -0
  80. gsax-0.1.0/src/gsax/efast/_analyze.py +215 -0
  81. gsax-0.1.0/src/gsax/efast/_result.py +82 -0
  82. gsax-0.1.0/src/gsax/efast/_sampling.py +104 -0
  83. gsax-0.1.0/src/gsax/hdmr/__init__.py +17 -0
  84. gsax-0.1.0/src/gsax/hdmr/_analyze.py +497 -0
  85. gsax-0.1.0/src/gsax/hdmr/_engine.py +596 -0
  86. gsax-0.1.0/src/gsax/hdmr/_result.py +151 -0
  87. gsax-0.1.0/src/gsax/hsic/__init__.py +20 -0
  88. gsax-0.1.0/src/gsax/hsic/_analyze.py +471 -0
  89. gsax-0.1.0/src/gsax/hsic/_result.py +88 -0
  90. gsax-0.1.0/src/gsax/pawn/__init__.py +20 -0
  91. gsax-0.1.0/src/gsax/pawn/_analyze.py +286 -0
  92. gsax-0.1.0/src/gsax/pawn/_result.py +74 -0
  93. gsax-0.1.0/src/gsax/pce/__init__.py +18 -0
  94. gsax-0.1.0/src/gsax/pce/_analyze.py +154 -0
  95. gsax-0.1.0/src/gsax/pce/_engine.py +240 -0
  96. gsax-0.1.0/src/gsax/pce/_result.py +70 -0
  97. gsax-0.1.0/src/gsax/problem.py +242 -0
  98. gsax-0.1.0/src/gsax/py.typed +0 -0
  99. gsax-0.1.0/src/gsax/sampling.py +748 -0
  100. gsax-0.1.0/src/gsax/sobol/__init__.py +17 -0
  101. gsax-0.1.0/src/gsax/sobol/_analyze.py +618 -0
  102. gsax-0.1.0/src/gsax/sobol/_bootstrap.py +155 -0
  103. gsax-0.1.0/src/gsax/sobol/_indices.py +200 -0
  104. gsax-0.1.0/src/gsax/sobol/_result.py +119 -0
  105. gsax-0.1.0/tests/conftest.py +55 -0
  106. gsax-0.1.0/tests/test_analytical.py +187 -0
  107. gsax-0.1.0/tests/test_analyze.py +606 -0
  108. gsax-0.1.0/tests/test_cleaning.py +101 -0
  109. gsax-0.1.0/tests/test_dgsm.py +419 -0
  110. gsax-0.1.0/tests/test_efast.py +357 -0
  111. gsax-0.1.0/tests/test_hdmr.py +628 -0
  112. gsax-0.1.0/tests/test_hsic.py +397 -0
  113. gsax-0.1.0/tests/test_imports.py +73 -0
  114. gsax-0.1.0/tests/test_indices.py +80 -0
  115. gsax-0.1.0/tests/test_pawn.py +276 -0
  116. gsax-0.1.0/tests/test_pce.py +447 -0
  117. gsax-0.1.0/tests/test_problem.py +92 -0
  118. gsax-0.1.0/tests/test_sampling.py +405 -0
  119. gsax-0.1.0/tests/test_save_load.py +224 -0
  120. gsax-0.1.0/tests/test_shapes.py +125 -0
  121. gsax-0.1.0/tests/test_xarray.py +291 -0
  122. gsax-0.1.0/uv.lock +1441 -0
@@ -0,0 +1,10 @@
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: ["*"]
@@ -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@v4
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v6
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/gsax
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/gsax/**"
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/gsax/**"
24
+
25
+ jobs:
26
+ docs-check:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
33
+ - uses: actions/setup-node@v4
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@v4
23
+ with:
24
+ fetch-depth: 0
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+ - uses: actions/setup-node@v4
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@v3
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@v4
@@ -0,0 +1,48 @@
1
+ # Publishes gsax 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=gsax, 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@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v6
22
+ with:
23
+ python-version: "3.12"
24
+
25
+ - name: Build sdist and wheel
26
+ run: uv build
27
+
28
+ - uses: actions/upload-artifact@v4
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/gsax
39
+ permissions:
40
+ id-token: write # OIDC token for PyPI trusted publishing
41
+ steps:
42
+ - uses: actions/download-artifact@v4
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+
47
+ - name: Publish to PyPI
48
+ uses: pypa/gh-action-pypi-publish@release/v1
gsax-0.1.0/.gitignore ADDED
@@ -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,25 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ Initial public release.
6
+
7
+ `gsax` provides global sensitivity analysis in JAX with seven complementary
8
+ methods:
9
+
10
+ - **Sobol** indices via Saltelli sampling — first-, total-, and second-order,
11
+ with JAX-accelerated bootstrap confidence intervals.
12
+ - **RS-HDMR** — B-spline surrogate with ANCOVA decomposition and a built-in
13
+ emulator; works with any `(X, Y)` sample pairs.
14
+ - **PCE** — Polynomial Chaos Expansion with analytical Sobol indices and
15
+ leave-one-out cross-validation.
16
+ - **eFAST** — Extended Fourier Amplitude Sensitivity Test.
17
+ - **DGSM** — Derivative-based measures via JAX autodiff, with Poincaré-constant
18
+ bounds on total Sobol indices.
19
+ - **HSIC** — Hilbert–Schmidt Independence Criterion (kernel-based dependence,
20
+ R2-HSIC and Total HSIC, permutation p-values).
21
+ - **PAWN** — moment-independent, CDF-based sensitivity via Kolmogorov–Smirnov
22
+ distances.
23
+
24
+ All methods support scalar, multi-output, and time-series outputs and export to
25
+ 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: "gsax: Global Sensitivity Analysis in JAX"
4
+ abstract: >-
5
+ gsax 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/gsax"
16
+ url: "https://danielepessina.github.io/gsax/"
17
+ keywords:
18
+ - sensitivity-analysis
19
+ - global-sensitivity-analysis
20
+ - sobol
21
+ - jax
22
+ - uncertainty-quantification
@@ -0,0 +1,40 @@
1
+ # Contributing to gsax
2
+
3
+ Thanks for your interest in improving gsax! This guide covers the local setup
4
+ and the checks a pull request is expected to pass.
5
+
6
+ ## Development setup
7
+
8
+ gsax uses [uv](https://docs.astral.sh/uv/) for environment and dependency
9
+ management.
10
+
11
+ ```bash
12
+ git clone https://github.com/DanielePessina/gsax.git
13
+ cd gsax
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/gsax # 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 gsax version, and
40
+ your Python/JAX versions.
gsax-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniele Pessina
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.