calins 1.0.0b2__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 (131) hide show
  1. calins-1.0.0b2/.github/workflows/ci.yml +46 -0
  2. calins-1.0.0b2/.github/workflows/deploy-docs.yml +56 -0
  3. calins-1.0.0b2/.github/workflows/publish-pypi.yml +85 -0
  4. calins-1.0.0b2/.gitignore +26 -0
  5. calins-1.0.0b2/.nojekyll +0 -0
  6. calins-1.0.0b2/.pre-commit-config.yaml +23 -0
  7. calins-1.0.0b2/LICENSE +29 -0
  8. calins-1.0.0b2/PKG-INFO +586 -0
  9. calins-1.0.0b2/README.md +540 -0
  10. calins-1.0.0b2/USER_EXAMPLES.ipynb +733 -0
  11. calins-1.0.0b2/docs/citation.md +16 -0
  12. calins-1.0.0b2/docs/contributing.md +25 -0
  13. calins-1.0.0b2/docs/developer-manual/class_plot_helpers.md +44 -0
  14. calins-1.0.0b2/docs/developer-manual/classes.md +178 -0
  15. calins-1.0.0b2/docs/developer-manual/errors.md +8 -0
  16. calins-1.0.0b2/docs/developer-manual/logs.md +20 -0
  17. calins-1.0.0b2/docs/developer-manual/methods.md +123 -0
  18. calins-1.0.0b2/docs/developer-manual/plots.md +11 -0
  19. calins-1.0.0b2/docs/images/Assim.PNG +0 -0
  20. calins-1.0.0b2/docs/images/Bench_list.PNG +0 -0
  21. calins-1.0.0b2/docs/images/Case_sensi.PNG +0 -0
  22. calins-1.0.0b2/docs/images/Contributions.PNG +0 -0
  23. calins-1.0.0b2/docs/images/Image_maker/Diapositive1.PNG +0 -0
  24. calins-1.0.0b2/docs/images/Image_maker/Diapositive2.PNG +0 -0
  25. calins-1.0.0b2/docs/images/Image_maker/Diapositive3.PNG +0 -0
  26. calins-1.0.0b2/docs/images/Image_maker/Diapositive4.PNG +0 -0
  27. calins-1.0.0b2/docs/images/Image_maker/Diapositive5.PNG +0 -0
  28. calins-1.0.0b2/docs/images/Image_maker/Diapositive6.PNG +0 -0
  29. calins-1.0.0b2/docs/images/Image_maker/Diapositive7.PNG +0 -0
  30. calins-1.0.0b2/docs/images/Image_maker.pptx +0 -0
  31. calins-1.0.0b2/docs/images/Iso_reac_list.PNG +0 -0
  32. calins-1.0.0b2/docs/images/Logo.PNG +0 -0
  33. calins-1.0.0b2/docs/images/Sensi_heatmap.PNG +0 -0
  34. calins-1.0.0b2/docs/index.md +39 -0
  35. calins-1.0.0b2/docs/installation.md +57 -0
  36. calins-1.0.0b2/docs/javascripts/mathjax.js +21 -0
  37. calins-1.0.0b2/docs/license.md +45 -0
  38. calins-1.0.0b2/docs/points-of-attention.md +37 -0
  39. calins-1.0.0b2/docs/stylesheets/extra.css +183 -0
  40. calins-1.0.0b2/docs/theory/alignment-rule.md +4 -0
  41. calins-1.0.0b2/docs/theory/assimilation-gllsm.md +136 -0
  42. calins-1.0.0b2/docs/theory/covariance-matrix.md +10 -0
  43. calins-1.0.0b2/docs/theory/experimental-correlations.md +6 -0
  44. calins-1.0.0b2/docs/theory/introduction.md +12 -0
  45. calins-1.0.0b2/docs/theory/sensitivity-vector.md +8 -0
  46. calins-1.0.0b2/docs/theory/uncertainty-calculation.md +9 -0
  47. calins-1.0.0b2/docs/theory/validation-methods.md +344 -0
  48. calins-1.0.0b2/docs/troubleshooting.md +63 -0
  49. calins-1.0.0b2/docs/usage-examples/calculating-uncertainty.md +33 -0
  50. calins-1.0.0b2/docs/usage-examples/computing-similarity-indices.md +54 -0
  51. calins-1.0.0b2/docs/usage-examples/creating-case-object.md +32 -0
  52. calins-1.0.0b2/docs/usage-examples/loading-covariance-data.md +153 -0
  53. calins-1.0.0b2/docs/usage-examples/performing-data-assimilation.md +125 -0
  54. calins-1.0.0b2/docs/usage-examples/sensitivity-analysis-case-screening.md +81 -0
  55. calins-1.0.0b2/mkdocs.yml +78 -0
  56. calins-1.0.0b2/pyproject.toml +110 -0
  57. calins-1.0.0b2/requirements.txt +6 -0
  58. calins-1.0.0b2/setup.cfg +4 -0
  59. calins-1.0.0b2/src/calins/__init__.py +190 -0
  60. calins-1.0.0b2/src/calins/_logging.py +232 -0
  61. calins-1.0.0b2/src/calins/_version.py +24 -0
  62. calins-1.0.0b2/src/calins/analysis/__init__.py +1 -0
  63. calins-1.0.0b2/src/calins/analysis/bias.py +322 -0
  64. calins-1.0.0b2/src/calins/analysis/comparison.py +210 -0
  65. calins-1.0.0b2/src/calins/analysis/screening.py +784 -0
  66. calins-1.0.0b2/src/calins/analysis/similarity.py +700 -0
  67. calins-1.0.0b2/src/calins/analysis/uncertainty.py +512 -0
  68. calins-1.0.0b2/src/calins/assimilation/__init__.py +5 -0
  69. calins-1.0.0b2/src/calins/assimilation/gllsm.py +1077 -0
  70. calins-1.0.0b2/src/calins/assimilation/usl.py +841 -0
  71. calins-1.0.0b2/src/calins/case.py +801 -0
  72. calins-1.0.0b2/src/calins/config.py +56 -0
  73. calins-1.0.0b2/src/calins/constants.py +16 -0
  74. calins-1.0.0b2/src/calins/core/__init__.py +1 -0
  75. calins-1.0.0b2/src/calins/core/alignment.py +437 -0
  76. calins-1.0.0b2/src/calins/core/linalg.py +41 -0
  77. calins-1.0.0b2/src/calins/core/nuclides.py +112 -0
  78. calins-1.0.0b2/src/calins/covariances.py +353 -0
  79. calins-1.0.0b2/src/calins/data/Logo.PNG +0 -0
  80. calins-1.0.0b2/src/calins/data/html.model +95 -0
  81. calins-1.0.0b2/src/calins/data/iso_id.json +1 -0
  82. calins-1.0.0b2/src/calins/data/reac_id.json +1 -0
  83. calins-1.0.0b2/src/calins/datatypes.py +96 -0
  84. calins-1.0.0b2/src/calins/exceptions.py +40 -0
  85. calins-1.0.0b2/src/calins/io/__init__.py +1 -0
  86. calins-1.0.0b2/src/calins/io/covariances/__init__.py +85 -0
  87. calins-1.0.0b2/src/calins/io/covariances/comac.py +130 -0
  88. calins-1.0.0b2/src/calins/io/covariances/coverx.py +286 -0
  89. calins-1.0.0b2/src/calins/io/covariances/gendf.py +234 -0
  90. calins-1.0.0b2/src/calins/io/covariances/xlsx.py +86 -0
  91. calins-1.0.0b2/src/calins/io/sdf.py +687 -0
  92. calins-1.0.0b2/src/calins/plotting/__init__.py +1 -0
  93. calins-1.0.0b2/src/calins/plotting/figures.py +511 -0
  94. calins-1.0.0b2/src/calins/plotting/helpers.py +398 -0
  95. calins-1.0.0b2/src/calins/reporting/__init__.py +1 -0
  96. calins-1.0.0b2/src/calins/reporting/assimilation_report.py +1652 -0
  97. calins-1.0.0b2/src/calins/reporting/case_report.py +129 -0
  98. calins-1.0.0b2/src/calins/reporting/html.py +158 -0
  99. calins-1.0.0b2/src/calins/reporting/uncertainty_report.py +336 -0
  100. calins-1.0.0b2/src/calins/src/__init__.py +51 -0
  101. calins-1.0.0b2/src/calins/src/class_plot_helpers.py +7 -0
  102. calins-1.0.0b2/src/calins/src/classes.py +24 -0
  103. calins-1.0.0b2/src/calins/src/errors.py +14 -0
  104. calins-1.0.0b2/src/calins/src/logs.py +13 -0
  105. calins-1.0.0b2/src/calins/src/methods.py +58 -0
  106. calins-1.0.0b2/src/calins/src/plots.py +26 -0
  107. calins-1.0.0b2/src/calins/src/version.py +7 -0
  108. calins-1.0.0b2/src/calins/version.py +18 -0
  109. calins-1.0.0b2/src/calins.egg-info/PKG-INFO +586 -0
  110. calins-1.0.0b2/src/calins.egg-info/SOURCES.txt +129 -0
  111. calins-1.0.0b2/src/calins.egg-info/dependency_links.txt +1 -0
  112. calins-1.0.0b2/src/calins.egg-info/requires.txt +26 -0
  113. calins-1.0.0b2/src/calins.egg-info/scm_file_list.json +125 -0
  114. calins-1.0.0b2/src/calins.egg-info/scm_version.json +8 -0
  115. calins-1.0.0b2/src/calins.egg-info/top_level.txt +1 -0
  116. calins-1.0.0b2/tests/__init__.py +1 -0
  117. calins-1.0.0b2/tests/conftest.py +79 -0
  118. calins-1.0.0b2/tests/test_data_model.py +313 -0
  119. calins-1.0.0b2/tests/test_inputs/cov_corrupted_2_comac/cov_Am241 +10 -0
  120. calins-1.0.0b2/tests/test_inputs/cov_corrupted_2_comac/cov_Fe56 +5 -0
  121. calins-1.0.0b2/tests/test_inputs/cov_proper_1.txt +15 -0
  122. calins-1.0.0b2/tests/test_inputs/cov_proper_2_comac/cov_Am241 +10 -0
  123. calins-1.0.0b2/tests/test_inputs/cov_proper_2_comac/cov_Fe56 +5 -0
  124. calins-1.0.0b2/tests/test_inputs/empty_file.txt +0 -0
  125. calins-1.0.0b2/tests/test_inputs/sensi_corrupted_1.sdf +18 -0
  126. calins-1.0.0b2/tests/test_inputs/sensi_proper_1.sdf +33 -0
  127. calins-1.0.0b2/tests/test_inputs/sensi_proper_2.sdf +18 -0
  128. calins-1.0.0b2/tests/test_inputs/sensi_proper_3.sdf +37 -0
  129. calins-1.0.0b2/tests/test_inputs/sensi_proper_4.sdf +37 -0
  130. calins-1.0.0b2/tests/test_regressions.py +316 -0
  131. calins-1.0.0b2/tests/test_unit.py +774 -0
@@ -0,0 +1,46 @@
1
+ name: Unit Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-24.04
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: "3.12"
17
+ - name: Ruff
18
+ run: |
19
+ pip install "ruff>=0.5"
20
+ ruff check src tests
21
+
22
+ unit-test-job:
23
+ runs-on: ubuntu-24.04
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 0 # git tags are needed by setuptools-scm for the version
33
+
34
+ - name: Setup Python
35
+ uses: actions/setup-python@v5
36
+ with:
37
+ python-version: ${{ matrix.python-version }}
38
+ cache: pip
39
+
40
+ - name: Install package
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ pip install -e .[dev]
44
+
45
+ - name: Run unit tests
46
+ run: pytest tests --cov=calins --cov-report=term-missing
@@ -0,0 +1,56 @@
1
+ name: Deploy MkDocs to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: "pages"
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-24.04
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Setup Python
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: '3.9'
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ pip install mkdocs-material
33
+ pip install pymdown-extensions
34
+
35
+ - name: Build MkDocs
36
+ run: mkdocs build
37
+
38
+ - name: Setup Pages
39
+ uses: actions/configure-pages@v4
40
+
41
+ - name: Upload artifact
42
+ uses: actions/upload-pages-artifact@v3
43
+ with:
44
+ path: './site'
45
+
46
+ deploy:
47
+ environment:
48
+ name: github-pages
49
+ url: ${{ steps.deployment.outputs.page_url }}
50
+ runs-on: ubuntu-latest
51
+ needs: build
52
+ if: github.ref == 'refs/heads/main'
53
+ steps:
54
+ - name: Deploy to GitHub Pages
55
+ id: deployment
56
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,85 @@
1
+ name: Publish package to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build and check distributions
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout tagged commit
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.13"
26
+
27
+ - name: Install build tools
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ python -m pip install build twine
31
+
32
+ - name: Build wheel and source distribution
33
+ run: python -m build
34
+
35
+ - name: Check distributions
36
+ run: python -m twine check dist/*
37
+
38
+ - name: Verify generated version
39
+ shell: bash
40
+ run: |
41
+ python -m pip install --force-reinstall --no-deps dist/*.whl
42
+ python - <<'PY'
43
+ import os
44
+ from importlib.metadata import version
45
+
46
+ tag = os.environ["GITHUB_REF_NAME"]
47
+ expected = tag.removeprefix("v")
48
+ actual = version("calins")
49
+ print(f"Tag: {tag}")
50
+ print(f"Expected package version: {expected}")
51
+ print(f"Built package version: {actual}")
52
+ if actual != expected:
53
+ raise SystemExit(f"Version mismatch: tag={tag}, package={actual}")
54
+ PY
55
+
56
+ - name: Upload distributions
57
+ uses: actions/upload-artifact@v4
58
+ with:
59
+ name: calins-distributions
60
+ path: dist/
61
+ if-no-files-found: error
62
+
63
+ publish:
64
+ name: Publish to PyPI
65
+ needs: build
66
+ runs-on: ubuntu-latest
67
+
68
+ environment:
69
+ name: pypi
70
+ url: https://pypi.org/p/calins
71
+
72
+ permissions:
73
+ id-token: write
74
+
75
+ steps:
76
+ - name: Download distributions
77
+ uses: actions/download-artifact@v4
78
+ with:
79
+ name: calins-distributions
80
+ path: dist/
81
+
82
+ - name: Publish package
83
+ uses: pypa/gh-action-pypi-publish@release/v1
84
+ with:
85
+ packages-dir: dist/
@@ -0,0 +1,26 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+
8
+ # Version file generated by setuptools-scm
9
+ src/calins/_version.py
10
+
11
+ # Tests / coverage
12
+ .pytest_cache/
13
+ .coverage
14
+ coverage.xml
15
+ htmlcov/
16
+
17
+ # Tools
18
+ .ruff_cache/
19
+ .mypy_cache/
20
+
21
+ # Documentation build
22
+ site/
23
+
24
+ # Environments
25
+ .venv/
26
+ venv/
File without changes
@@ -0,0 +1,23 @@
1
+ # Installation: pip install -e .[dev] && pre-commit install
2
+ repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v4.6.0
5
+ hooks:
6
+ - id: trailing-whitespace
7
+ exclude: ^tests/test_inputs/
8
+ - id: end-of-file-fixer
9
+ exclude: ^tests/test_inputs/
10
+ - id: check-yaml
11
+ - id: check-toml
12
+ - id: check-added-large-files
13
+
14
+ - repo: https://github.com/astral-sh/ruff-pre-commit
15
+ rev: v0.5.7
16
+ hooks:
17
+ - id: ruff
18
+ args: [--fix]
19
+
20
+ - repo: https://github.com/psf/black
21
+ rev: 24.8.0
22
+ hooks:
23
+ - id: black
calins-1.0.0b2/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, French Authority for Nuclear Safety and Radiation Protection (ASNR)
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.