pybinny 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pybinny-0.5.1/LICENSE +21 -0
- pybinny-0.5.1/PKG-INFO +118 -0
- pybinny-0.5.1/README.md +79 -0
- pybinny-0.5.1/pyproject.toml +195 -0
- pybinny-0.5.1/setup.cfg +4 -0
- pybinny-0.5.1/src/binny/__init__.py +10 -0
- pybinny-0.5.1/src/binny/api/__init__.py +19 -0
- pybinny-0.5.1/src/binny/api/nz_tomography.py +1314 -0
- pybinny-0.5.1/src/binny/axes/__init__.py +0 -0
- pybinny-0.5.1/src/binny/axes/bin_edges.py +265 -0
- pybinny-0.5.1/src/binny/axes/grids.py +89 -0
- pybinny-0.5.1/src/binny/axes/mixed_edges.py +332 -0
- pybinny-0.5.1/src/binny/correlations/__init__.py +0 -0
- pybinny-0.5.1/src/binny/correlations/bin_combo_filter.py +788 -0
- pybinny-0.5.1/src/binny/correlations/filters.py +465 -0
- pybinny-0.5.1/src/binny/correlations/metrics.py +284 -0
- pybinny-0.5.1/src/binny/correlations/scores.py +171 -0
- pybinny-0.5.1/src/binny/correlations/topology.py +268 -0
- pybinny-0.5.1/src/binny/cosmology/__init__.py +0 -0
- pybinny-0.5.1/src/binny/cosmology/ccl_wrappers.py +116 -0
- pybinny-0.5.1/src/binny/nz/__init__.py +3 -0
- pybinny-0.5.1/src/binny/nz/calibration.py +536 -0
- pybinny-0.5.1/src/binny/nz/luminosity_function_distribution.py +273 -0
- pybinny-0.5.1/src/binny/nz/models.py +502 -0
- pybinny-0.5.1/src/binny/nz/psf_selection.py +359 -0
- pybinny-0.5.1/src/binny/nz/registry.py +111 -0
- pybinny-0.5.1/src/binny/nz_tomo/__init__.py +0 -0
- pybinny-0.5.1/src/binny/nz_tomo/_tomography_bins.py +163 -0
- pybinny-0.5.1/src/binny/nz_tomo/between_sample_metrics.py +1080 -0
- pybinny-0.5.1/src/binny/nz_tomo/bin_similarity.py +405 -0
- pybinny-0.5.1/src/binny/nz_tomo/bin_stats.py +733 -0
- pybinny-0.5.1/src/binny/nz_tomo/binning_core.py +314 -0
- pybinny-0.5.1/src/binny/nz_tomo/nz_tomo_utils.py +188 -0
- pybinny-0.5.1/src/binny/nz_tomo/photoz.py +484 -0
- pybinny-0.5.1/src/binny/nz_tomo/predefined.py +400 -0
- pybinny-0.5.1/src/binny/nz_tomo/sample_composition.py +192 -0
- pybinny-0.5.1/src/binny/nz_tomo/specz.py +637 -0
- pybinny-0.5.1/src/binny/surveys/__init__.py +1 -0
- pybinny-0.5.1/src/binny/surveys/config_utils.py +923 -0
- pybinny-0.5.1/src/binny/surveys/configs/__init__.py +0 -0
- pybinny-0.5.1/src/binny/surveys/configs/des_survey_specs.yaml +59 -0
- pybinny-0.5.1/src/binny/surveys/configs/desi_survey_specs.yaml +200 -0
- pybinny-0.5.1/src/binny/surveys/configs/euclid_survey_specs.yaml +96 -0
- pybinny-0.5.1/src/binny/surveys/configs/example_full_photoz.yaml +58 -0
- pybinny-0.5.1/src/binny/surveys/configs/example_full_specz.yaml +58 -0
- pybinny-0.5.1/src/binny/surveys/configs/example_minimal_photoz.yaml +26 -0
- pybinny-0.5.1/src/binny/surveys/configs/example_minimal_specz.yaml +28 -0
- pybinny-0.5.1/src/binny/surveys/configs/example_tabulated.yaml +42 -0
- pybinny-0.5.1/src/binny/surveys/configs/lsst_survey_specs.yaml +237 -0
- pybinny-0.5.1/src/binny/surveys/configs/mock_predefined_config.yaml +21 -0
- pybinny-0.5.1/src/binny/surveys/configs/roman_survey_specs.yaml +169 -0
- pybinny-0.5.1/src/binny/surveys/data/__init__.py +0 -0
- pybinny-0.5.1/src/binny/surveys/data/desi_bgs_sgc_nz.txt +52 -0
- pybinny-0.5.1/src/binny/surveys/data/desi_elg_nz.txt +20 -0
- pybinny-0.5.1/src/binny/surveys/data/desi_lrg_nz.txt +31 -0
- pybinny-0.5.1/src/binny/surveys/data/desi_lrg_sgc_nz.txt +73 -0
- pybinny-0.5.1/src/binny/surveys/data/example_tabulated_nz.txt +102 -0
- pybinny-0.5.1/src/binny/surveys/data/lsst_dp2_nz_degraded_r24p5_masked.txt +124 -0
- pybinny-0.5.1/src/binny/surveys/data/mock_predefined_bins.txt +302 -0
- pybinny-0.5.1/src/binny/surveys/data/roman_n_eff20.nz +300 -0
- pybinny-0.5.1/src/binny/surveys/data/roman_n_eff30.nz +300 -0
- pybinny-0.5.1/src/binny/surveys/data/roman_n_eff40.nz +300 -0
- pybinny-0.5.1/src/binny/surveys/data/roman_n_eff50.nz +300 -0
- pybinny-0.5.1/src/binny/surveys/scripts/fit_roman_smail.py +580 -0
- pybinny-0.5.1/src/binny/surveys/sky.py +420 -0
- pybinny-0.5.1/src/binny/surveys/survey_presets.py +67 -0
- pybinny-0.5.1/src/binny/utils/__init__.py +0 -0
- pybinny-0.5.1/src/binny/utils/broadcasting.py +60 -0
- pybinny-0.5.1/src/binny/utils/io.py +258 -0
- pybinny-0.5.1/src/binny/utils/metadata.py +372 -0
- pybinny-0.5.1/src/binny/utils/normalization.py +584 -0
- pybinny-0.5.1/src/binny/utils/pairwise_metrics.py +565 -0
- pybinny-0.5.1/src/binny/utils/relations.py +29 -0
- pybinny-0.5.1/src/binny/utils/types.py +59 -0
- pybinny-0.5.1/src/binny/utils/validators.py +511 -0
- pybinny-0.5.1/src/pybinny.egg-info/PKG-INFO +118 -0
- pybinny-0.5.1/src/pybinny.egg-info/SOURCES.txt +119 -0
- pybinny-0.5.1/src/pybinny.egg-info/dependency_links.txt +1 -0
- pybinny-0.5.1/src/pybinny.egg-info/requires.txt +33 -0
- pybinny-0.5.1/src/pybinny.egg-info/top_level.txt +1 -0
- pybinny-0.5.1/tests/test_api_nz_tomography.py +1672 -0
- pybinny-0.5.1/tests/test_api_nz_tomography_examples.py +181 -0
- pybinny-0.5.1/tests/test_api_nz_tomography_lsst_reference.py +85 -0
- pybinny-0.5.1/tests/test_axes_bin_edges.py +279 -0
- pybinny-0.5.1/tests/test_axes_grids.py +182 -0
- pybinny-0.5.1/tests/test_axes_mixed_edges.py +393 -0
- pybinny-0.5.1/tests/test_axes_mixed_edges_invariances_fast.py +369 -0
- pybinny-0.5.1/tests/test_axes_mixed_edges_invariances_slow.py +588 -0
- pybinny-0.5.1/tests/test_correlations_bin_combo_filter.py +731 -0
- pybinny-0.5.1/tests/test_correlations_filters.py +263 -0
- pybinny-0.5.1/tests/test_correlations_metrics.py +230 -0
- pybinny-0.5.1/tests/test_correlations_scores.py +155 -0
- pybinny-0.5.1/tests/test_correlations_topology.py +162 -0
- pybinny-0.5.1/tests/test_nz_calibration.py +633 -0
- pybinny-0.5.1/tests/test_nz_luminosity_function_distribution.py +556 -0
- pybinny-0.5.1/tests/test_nz_models.py +465 -0
- pybinny-0.5.1/tests/test_nz_psf_selection.py +415 -0
- pybinny-0.5.1/tests/test_nz_registry.py +181 -0
- pybinny-0.5.1/tests/test_nz_tomo_between_sample_metrics.py +756 -0
- pybinny-0.5.1/tests/test_nz_tomo_bin_similarity.py +391 -0
- pybinny-0.5.1/tests/test_nz_tomo_bin_stats.py +897 -0
- pybinny-0.5.1/tests/test_nz_tomo_bin_stats_center_invariance_fast.py +451 -0
- pybinny-0.5.1/tests/test_nz_tomo_bin_stats_center_invariance_slow.py +664 -0
- pybinny-0.5.1/tests/test_nz_tomo_bin_stats_invariances.py +394 -0
- pybinny-0.5.1/tests/test_nz_tomo_binning_core.py +750 -0
- pybinny-0.5.1/tests/test_nz_tomo_nz_tomo_utils.py +201 -0
- pybinny-0.5.1/tests/test_nz_tomo_photoz.py +730 -0
- pybinny-0.5.1/tests/test_nz_tomo_photoz_metadata.py +170 -0
- pybinny-0.5.1/tests/test_nz_tomo_predefined.py +653 -0
- pybinny-0.5.1/tests/test_nz_tomo_sample_composition.py +642 -0
- pybinny-0.5.1/tests/test_nz_tomo_specz.py +771 -0
- pybinny-0.5.1/tests/test_surveys_config_utils.py +1095 -0
- pybinny-0.5.1/tests/test_surveys_sky.py +246 -0
- pybinny-0.5.1/tests/test_surveys_survey_presets.py +211 -0
- pybinny-0.5.1/tests/test_utils_broadcasting.py +76 -0
- pybinny-0.5.1/tests/test_utils_io.py +377 -0
- pybinny-0.5.1/tests/test_utils_metadata.py +175 -0
- pybinny-0.5.1/tests/test_utils_normalization.py +559 -0
- pybinny-0.5.1/tests/test_utils_pairwise_metrics.py +300 -0
- pybinny-0.5.1/tests/test_utils_relations.py +38 -0
- pybinny-0.5.1/tests/test_utils_validators.py +478 -0
pybinny-0.5.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Nikolina Sarcevic
|
|
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.
|
pybinny-0.5.1/PKG-INFO
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pybinny
|
|
3
|
+
Version: 0.5.1
|
|
4
|
+
Summary: Flexible tomographic binning algorithms for cosmology.
|
|
5
|
+
Author-email: Nikolina Sarcevic <nikolina.sarcevic@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: numpy
|
|
11
|
+
Requires-Dist: pyyaml
|
|
12
|
+
Requires-Dist: scipy
|
|
13
|
+
Requires-Dist: cmasher
|
|
14
|
+
Provides-Extra: lf
|
|
15
|
+
Requires-Dist: py-lfkit>=0.1.4; extra == "lf"
|
|
16
|
+
Provides-Extra: cosmo
|
|
17
|
+
Requires-Dist: pyccl>=3; extra == "cosmo"
|
|
18
|
+
Provides-Extra: lf-cosmo
|
|
19
|
+
Requires-Dist: py-lfkit>=0.1.4; extra == "lf-cosmo"
|
|
20
|
+
Requires-Dist: pyccl>=3; extra == "lf-cosmo"
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: bump-my-version>=0.26; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
25
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
26
|
+
Requires-Dist: tox>=4.22; extra == "dev"
|
|
27
|
+
Requires-Dist: py-lfkit>=0.1.4; extra == "dev"
|
|
28
|
+
Requires-Dist: pyccl>=3; extra == "dev"
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
Requires-Dist: sphinx[doctest]<9; extra == "docs"
|
|
31
|
+
Requires-Dist: sphinx-copybutton; extra == "docs"
|
|
32
|
+
Requires-Dist: sphinx-design; extra == "docs"
|
|
33
|
+
Requires-Dist: sphinx-multiversion; extra == "docs"
|
|
34
|
+
Requires-Dist: sphinxawesome-theme; extra == "docs"
|
|
35
|
+
Requires-Dist: furo; extra == "docs"
|
|
36
|
+
Requires-Dist: py-lfkit>=0.1.4; extra == "docs"
|
|
37
|
+
Requires-Dist: pyccl>=3; extra == "docs"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
<p align="center">
|
|
41
|
+
<img src="docs/_static/animations/binny_logo.gif" width="220">
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
# binny
|
|
45
|
+
|
|
46
|
+
<p align="center">
|
|
47
|
+
|
|
48
|
+
[](https://github.com/binny-org/binny/actions/workflows/ci.yml)
|
|
49
|
+
[](https://github.com/binny-org/binny/actions/workflows/docs.yml)
|
|
50
|
+
[](LICENSE)
|
|
51
|
+
[](https://pypi.org/project/pybinny/)
|
|
52
|
+
[](https://binny-org.github.io/binny)
|
|
53
|
+
|
|
54
|
+
</p>
|
|
55
|
+
|
|
56
|
+
**binny** is a Python library for constructing and analyzing
|
|
57
|
+
**tomographic redshift bins** used in cosmology and large-scale structure analyses.
|
|
58
|
+
|
|
59
|
+
It provides flexible binning algorithms, validation utilities, and diagnostic tools
|
|
60
|
+
for forecasting, inference pipelines, and survey analysis workflows.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
# Installation
|
|
65
|
+
|
|
66
|
+
## Install from PyPI
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install pybinny
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Install from source
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/binny-org/binny.git
|
|
75
|
+
cd binny
|
|
76
|
+
python -m pip install -e .
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Development install
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
python -m pip install -e ".[dev]"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# Citation
|
|
89
|
+
|
|
90
|
+
If you use **binny** in your research, please cite it.
|
|
91
|
+
|
|
92
|
+
```bibtex
|
|
93
|
+
@software{sarcevic2026binny,
|
|
94
|
+
title = {binny: Flexible binning algorithms for cosmology},
|
|
95
|
+
author = {Šarčević, Nikolina and van der Wild, Matthijs and Polen, Rebekah},
|
|
96
|
+
year = {2026},
|
|
97
|
+
url = {https://github.com/binny-org/binny}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Citation metadata is also available in `CITATION.cff`, which GitHub uses to generate citation formats automatically.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
# Contributing
|
|
106
|
+
|
|
107
|
+
Contributions are very welcome.
|
|
108
|
+
See the **Contributing** guide in the documentation for development workflow,
|
|
109
|
+
testing, and code style guidelines.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
# License
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
and:
|
|
117
|
+
|
|
118
|
+
MIT License © 2026 Nikolina Šarčević, Matthijs van der Wild, Rebekah Polen, and contributors.
|
pybinny-0.5.1/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/_static/animations/binny_logo.gif" width="220">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# binny
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
|
|
9
|
+
[](https://github.com/binny-org/binny/actions/workflows/ci.yml)
|
|
10
|
+
[](https://github.com/binny-org/binny/actions/workflows/docs.yml)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://pypi.org/project/pybinny/)
|
|
13
|
+
[](https://binny-org.github.io/binny)
|
|
14
|
+
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
**binny** is a Python library for constructing and analyzing
|
|
18
|
+
**tomographic redshift bins** used in cosmology and large-scale structure analyses.
|
|
19
|
+
|
|
20
|
+
It provides flexible binning algorithms, validation utilities, and diagnostic tools
|
|
21
|
+
for forecasting, inference pipelines, and survey analysis workflows.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Installation
|
|
26
|
+
|
|
27
|
+
## Install from PyPI
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install pybinny
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Install from source
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/binny-org/binny.git
|
|
36
|
+
cd binny
|
|
37
|
+
python -m pip install -e .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Development install
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
python -m pip install -e ".[dev]"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# Citation
|
|
50
|
+
|
|
51
|
+
If you use **binny** in your research, please cite it.
|
|
52
|
+
|
|
53
|
+
```bibtex
|
|
54
|
+
@software{sarcevic2026binny,
|
|
55
|
+
title = {binny: Flexible binning algorithms for cosmology},
|
|
56
|
+
author = {Šarčević, Nikolina and van der Wild, Matthijs and Polen, Rebekah},
|
|
57
|
+
year = {2026},
|
|
58
|
+
url = {https://github.com/binny-org/binny}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Citation metadata is also available in `CITATION.cff`, which GitHub uses to generate citation formats automatically.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
# Contributing
|
|
67
|
+
|
|
68
|
+
Contributions are very welcome.
|
|
69
|
+
See the **Contributing** guide in the documentation for development workflow,
|
|
70
|
+
testing, and code style guidelines.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
# License
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
and:
|
|
78
|
+
|
|
79
|
+
MIT License © 2026 Nikolina Šarčević, Matthijs van der Wild, Rebekah Polen, and contributors.
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pybinny"
|
|
3
|
+
version = "0.5.1"
|
|
4
|
+
description = "Flexible tomographic binning algorithms for cosmology."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
authors = [{ name = "Nikolina Sarcevic", email = "nikolina.sarcevic@gmail.com" }]
|
|
9
|
+
|
|
10
|
+
dependencies = [
|
|
11
|
+
"numpy",
|
|
12
|
+
"pyyaml",
|
|
13
|
+
"scipy",
|
|
14
|
+
"cmasher",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.optional-dependencies]
|
|
18
|
+
lf = [
|
|
19
|
+
"py-lfkit>=0.1.4",
|
|
20
|
+
]
|
|
21
|
+
cosmo = [
|
|
22
|
+
"pyccl>=3",
|
|
23
|
+
]
|
|
24
|
+
lf-cosmo = [
|
|
25
|
+
"py-lfkit>=0.1.4",
|
|
26
|
+
"pyccl>=3",
|
|
27
|
+
]
|
|
28
|
+
dev = [
|
|
29
|
+
"bump-my-version>=0.26",
|
|
30
|
+
"pytest>=8",
|
|
31
|
+
"pytest-cov>=5",
|
|
32
|
+
"ruff>=0.6",
|
|
33
|
+
"tox>=4.22",
|
|
34
|
+
"py-lfkit>=0.1.4",
|
|
35
|
+
"pyccl>=3",
|
|
36
|
+
]
|
|
37
|
+
docs = [
|
|
38
|
+
"sphinx[doctest]<9",
|
|
39
|
+
"sphinx-copybutton",
|
|
40
|
+
"sphinx-design",
|
|
41
|
+
"sphinx-multiversion",
|
|
42
|
+
"sphinxawesome-theme",
|
|
43
|
+
"furo",
|
|
44
|
+
"py-lfkit>=0.1.4",
|
|
45
|
+
"pyccl>=3",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[build-system]
|
|
49
|
+
requires = ["setuptools>=61"]
|
|
50
|
+
build-backend = "setuptools.build_meta"
|
|
51
|
+
|
|
52
|
+
[tool.coverage.run]
|
|
53
|
+
branch = true
|
|
54
|
+
parallel = true
|
|
55
|
+
source = ["binny"]
|
|
56
|
+
|
|
57
|
+
[tool.coverage.report]
|
|
58
|
+
exclude_lines = [
|
|
59
|
+
"pragma: no cover",
|
|
60
|
+
"if TYPE_CHECKING:",
|
|
61
|
+
"raise NotImplementedError",
|
|
62
|
+
]
|
|
63
|
+
fail_under = 90
|
|
64
|
+
show_missing = true
|
|
65
|
+
skip_empty = true
|
|
66
|
+
|
|
67
|
+
[tool.pytest.ini_options]
|
|
68
|
+
addopts = "-m 'not slow'"
|
|
69
|
+
markers = [
|
|
70
|
+
"slow: long-running tests (opt-in)",
|
|
71
|
+
"regression: heavier regression / sweep tests (opt-in)",
|
|
72
|
+
]
|
|
73
|
+
testpaths = ["tests"]
|
|
74
|
+
|
|
75
|
+
[tool.ruff]
|
|
76
|
+
exclude = [
|
|
77
|
+
"benchmarks",
|
|
78
|
+
"docs",
|
|
79
|
+
]
|
|
80
|
+
line-length = 100
|
|
81
|
+
target-version = "py310"
|
|
82
|
+
|
|
83
|
+
[tool.ruff.format]
|
|
84
|
+
indent-style = "space"
|
|
85
|
+
quote-style = "double"
|
|
86
|
+
|
|
87
|
+
[tool.ruff.lint]
|
|
88
|
+
select = ["B", "E", "F", "I", "UP"]
|
|
89
|
+
|
|
90
|
+
[tool.setuptools]
|
|
91
|
+
package-dir = { "" = "src" }
|
|
92
|
+
|
|
93
|
+
[tool.setuptools.packages.find]
|
|
94
|
+
where = ["src"]
|
|
95
|
+
|
|
96
|
+
[tool.setuptools.package-data]
|
|
97
|
+
"binny.surveys" = [
|
|
98
|
+
"configs/*.yaml",
|
|
99
|
+
"data/*",
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tool.bumpversion]
|
|
103
|
+
current_version = "0.5.1"
|
|
104
|
+
commit = true
|
|
105
|
+
tag = true
|
|
106
|
+
|
|
107
|
+
[[tool.bumpversion.files]]
|
|
108
|
+
filename = "pyproject.toml"
|
|
109
|
+
search = 'current_version = "{current_version}"'
|
|
110
|
+
replace = 'current_version = "{new_version}"'
|
|
111
|
+
|
|
112
|
+
[[tool.bumpversion.files]]
|
|
113
|
+
filename = "pyproject.toml"
|
|
114
|
+
search = 'version = "{current_version}"'
|
|
115
|
+
replace = 'version = "{new_version}"'
|
|
116
|
+
|
|
117
|
+
[[tool.bumpversion.files]]
|
|
118
|
+
filename = "CITATION.cff"
|
|
119
|
+
search = "version: {current_version}"
|
|
120
|
+
replace = "version: {new_version}"
|
|
121
|
+
|
|
122
|
+
[tool.tox]
|
|
123
|
+
requires = ["tox>=4.22"]
|
|
124
|
+
envlist = [
|
|
125
|
+
"py312",
|
|
126
|
+
"cov",
|
|
127
|
+
"cov-strict",
|
|
128
|
+
"docs",
|
|
129
|
+
"do",
|
|
130
|
+
"docs-releases",
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
[tool.tox.env_run_base.setenv]
|
|
134
|
+
PIP_CACHE_DIR = "{tox_root}/.cache/pip"
|
|
135
|
+
|
|
136
|
+
[tool.tox.env.py312]
|
|
137
|
+
description = "Run unit tests"
|
|
138
|
+
extras = ["dev"]
|
|
139
|
+
commands = [
|
|
140
|
+
["pytest", "-q"],
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
[tool.tox.env.cov]
|
|
144
|
+
description = "Coverage report for dev (does not fail)"
|
|
145
|
+
extras = ["dev"]
|
|
146
|
+
commands = [
|
|
147
|
+
[
|
|
148
|
+
"pytest",
|
|
149
|
+
"-q",
|
|
150
|
+
"--cov=binny",
|
|
151
|
+
"--cov-branch",
|
|
152
|
+
"--cov-report=term-missing:skip-covered",
|
|
153
|
+
"--cov-fail-under=0",
|
|
154
|
+
],
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
[tool.tox.env.cov-strict]
|
|
158
|
+
description = "Coverage gate (fails if below fail_under)"
|
|
159
|
+
extras = ["dev"]
|
|
160
|
+
commands = [
|
|
161
|
+
[
|
|
162
|
+
"pytest",
|
|
163
|
+
"-q",
|
|
164
|
+
"--cov=binny",
|
|
165
|
+
"--cov-branch",
|
|
166
|
+
"--cov-report=term-missing:skip-covered",
|
|
167
|
+
],
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
[tool.tox.env.docs]
|
|
171
|
+
description = "Build the HTML files for the current state using Sphinx"
|
|
172
|
+
extras = ["docs"]
|
|
173
|
+
commands = [
|
|
174
|
+
["sphinx-build", "{tox_root}/docs", "{tox_root}/docs/_build/html", "--fail-on-warning"],
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
[tool.tox.env.do]
|
|
178
|
+
description = "Run doctests and build the HTML docs"
|
|
179
|
+
extras = ["docs"]
|
|
180
|
+
allowlist_externals = ["open"]
|
|
181
|
+
commands = [
|
|
182
|
+
["sphinx-build", "-b", "doctest", "{tox_root}/docs", "{tox_root}/docs/_build/doctest", "--fail-on-warning"],
|
|
183
|
+
["sphinx-build", "-b", "html", "{tox_root}/docs", "{tox_root}/docs/_build/html", "--fail-on-warning"],
|
|
184
|
+
["open", "{tox_root}/docs/_build/html/index.html"],
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[tool.tox.env.docs-releases]
|
|
188
|
+
description = "Build the documentation for binny releases using Sphinx"
|
|
189
|
+
extras = ["docs"]
|
|
190
|
+
allowlist_externals = ["cp", "bash"]
|
|
191
|
+
commands = [
|
|
192
|
+
["bash", "-lc", "test \"$(git branch --show-current)\" = main"],
|
|
193
|
+
["sphinx-multiversion", "{tox_root}/docs", "{tox_root}/docs/_build/html", "--fail-on-warning"],
|
|
194
|
+
["cp", "{tox_root}/docs/_templates/pages_redirect.html", "{tox_root}/docs/_build/html/index.html"],
|
|
195
|
+
]
|
pybinny-0.5.1/setup.cfg
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Initialization of the Binny API package."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import import_module
|
|
6
|
+
|
|
7
|
+
_API_MODULES = ("binny.api.nz_tomography",)
|
|
8
|
+
|
|
9
|
+
__all__: list[str] = []
|
|
10
|
+
|
|
11
|
+
for mod_name in _API_MODULES:
|
|
12
|
+
mod = import_module(mod_name)
|
|
13
|
+
names = list(getattr(mod, "__all__", []))
|
|
14
|
+
for name in names:
|
|
15
|
+
globals()[name] = getattr(mod, name)
|
|
16
|
+
__all__.extend(names)
|
|
17
|
+
|
|
18
|
+
# remove duplicates and make ordering stable
|
|
19
|
+
__all__ = sorted(set(__all__))
|