pybinny 0.3.2__tar.gz → 0.3.3__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.3.2/src/pybinny.egg-info → pybinny-0.3.3}/PKG-INFO +6 -7
- {pybinny-0.3.2 → pybinny-0.3.3}/README.md +5 -6
- {pybinny-0.3.2 → pybinny-0.3.3}/pyproject.toml +2 -2
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/bin_stats.py +6 -1
- {pybinny-0.3.2 → pybinny-0.3.3/src/pybinny.egg-info}/PKG-INFO +6 -7
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_bin_stats.py +50 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/LICENSE +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/setup.cfg +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/api/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/api/nz_tomography.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/axes/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/axes/bin_edges.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/axes/grids.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/axes/mixed_edges.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/correlations/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/correlations/bin_combo_filter.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/correlations/filters.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/correlations/metrics.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/correlations/scores.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/correlations/topology.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz/calibration.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz/models.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz/registry.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/_tomography_bins.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/between_sample_metrics.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/bin_similarity.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/binning_core.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/nz_tomo_utils.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/photoz.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/nz_tomo/specz.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/config_utils.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/des_survey_specs.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/desi_survey_specs.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/euclid_survey_specs.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/example_full_photoz.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/example_full_specz.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/example_minimal_photoz.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/example_minimal_specz.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/example_tabulated.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/lsst_survey_specs.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/configs/roman_survey_specs.yaml +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/desi_elg_nz.txt +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/desi_lrg_nz.txt +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/example_tabulated_nz.txt +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/roman_n_eff20.nz +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/roman_n_eff30.nz +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/roman_n_eff40.nz +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/data/roman_n_eff50.nz +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/scripts/fit_roman_smail.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/sky.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/surveys/survey_presets.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/__init__.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/broadcasting.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/io.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/metadata.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/normalization.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/pairwise_metrics.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/relations.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/types.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/binny/utils/validators.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/pybinny.egg-info/SOURCES.txt +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/pybinny.egg-info/dependency_links.txt +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/pybinny.egg-info/requires.txt +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/src/pybinny.egg-info/top_level.txt +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_api_nz_tomography.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_api_nz_tomography_examples.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_api_nz_tomography_lsst_reference.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_axes_bin_edges.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_axes_grids.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_axes_mixed_edges.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_axes_mixed_edges_invariances_fast.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_axes_mixed_edges_invariances_slow.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_correlations_bin_combo_filter.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_correlations_filters.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_correlations_metrics.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_correlations_scores.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_correlations_topology.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_calibration.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_models.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_registry.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_between_sample_metrics.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_bin_similarity.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_bin_stats_center_invariance_fast.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_bin_stats_center_invariance_slow.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_bin_stats_invariances.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_binning_core.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_nz_tomo_utils.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_photoz.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_photoz_metadata.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_nz_tomo_specz.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_surveys_config_utils.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_surveys_sky.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_surveys_survey_presets.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_utils_broadcasting.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_utils_io.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_utils_metadata.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_utils_normalization.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_utils_pairwise_metrics.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_utils_relations.py +0 -0
- {pybinny-0.3.2 → pybinny-0.3.3}/tests/test_utils_validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pybinny
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Flexible tomographic binning algorithms for cosmology.
|
|
5
5
|
Author-email: Nikolina Sarcevic <nikolina.sarcevic@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -34,12 +34,11 @@ Dynamic: license-file
|
|
|
34
34
|
|
|
35
35
|
<p align="center">
|
|
36
36
|
|
|
37
|
-
[](https://github.com/binny-org/binny/actions/workflows/ci.yml)
|
|
38
|
+
[](https://github.com/binny-org/binny/actions/workflows/docs.yml)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
[](https://pypi.org/project/pybinny/)
|
|
41
|
+
[](https://binny-org.github.io/binny)
|
|
43
42
|
|
|
44
43
|
</p>
|
|
45
44
|
|
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
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)
|
|
15
14
|
|
|
16
15
|
</p>
|
|
17
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pybinny"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.3"
|
|
4
4
|
description = "Flexible tomographic binning algorithms for cosmology."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -86,7 +86,7 @@ where = ["src"]
|
|
|
86
86
|
]
|
|
87
87
|
|
|
88
88
|
[tool.bumpversion]
|
|
89
|
-
current_version = "0.3.
|
|
89
|
+
current_version = "0.3.3"
|
|
90
90
|
commit = true
|
|
91
91
|
tag = true
|
|
92
92
|
|
|
@@ -676,7 +676,12 @@ def population_stats(
|
|
|
676
676
|
out: dict[str, Any] = {"fractions": frac}
|
|
677
677
|
|
|
678
678
|
if density_total is not None:
|
|
679
|
-
|
|
679
|
+
density_per_bin_all = galaxy_density_per_bin(
|
|
680
|
+
metadata,
|
|
681
|
+
density_total=float(density_total),
|
|
682
|
+
)
|
|
683
|
+
density_per_bin = {i: density_per_bin_all[i] for i in indices}
|
|
684
|
+
|
|
680
685
|
out["density_total"] = float(density_total)
|
|
681
686
|
out["density_per_bin"] = density_per_bin
|
|
682
687
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pybinny
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Flexible tomographic binning algorithms for cosmology.
|
|
5
5
|
Author-email: Nikolina Sarcevic <nikolina.sarcevic@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -34,12 +34,11 @@ Dynamic: license-file
|
|
|
34
34
|
|
|
35
35
|
<p align="center">
|
|
36
36
|
|
|
37
|
-
[](https://github.com/binny-org/binny/actions/workflows/ci.yml)
|
|
38
|
+
[](https://github.com/binny-org/binny/actions/workflows/docs.yml)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
[](https://pypi.org/project/pybinny/)
|
|
41
|
+
[](https://binny-org.github.io/binny)
|
|
43
42
|
|
|
44
43
|
</p>
|
|
45
44
|
|
|
@@ -723,3 +723,53 @@ def test_galaxy_fraction_per_bin_reads_nested_bins_block_known() -> None:
|
|
|
723
723
|
assert set(fr) == {0, 1}
|
|
724
724
|
assert fr[0] == pytest.approx(0.5)
|
|
725
725
|
assert fr[1] == pytest.approx(0.5)
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
def test_population_stats_density_matches_galaxy_density_helper() -> None:
|
|
729
|
+
"""Tests that population_stats uses the same density allocation as the helper."""
|
|
730
|
+
bins = _dummy_bins(2)
|
|
731
|
+
meta = {"frac_per_bin": {0: 1.0, 1: 3.0}}
|
|
732
|
+
|
|
733
|
+
out = population_stats(bins, meta, density_total=40.0)
|
|
734
|
+
expected = galaxy_density_per_bin(meta, density_total=40.0)
|
|
735
|
+
|
|
736
|
+
assert out["density_per_bin"] == pytest.approx(expected)
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
def test_population_stats_density_uses_galaxy_density_helper(
|
|
740
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
741
|
+
) -> None:
|
|
742
|
+
"""Tests that population_stats routes density allocation through the helper."""
|
|
743
|
+
import binny.nz_tomo.bin_stats as bs
|
|
744
|
+
|
|
745
|
+
called = {"value": False}
|
|
746
|
+
|
|
747
|
+
def fake_galaxy_density_per_bin(metadata, density_total):
|
|
748
|
+
called["value"] = True
|
|
749
|
+
assert metadata == {"frac_per_bin": {0: 1.0, 1: 3.0}}
|
|
750
|
+
assert density_total == pytest.approx(40.0)
|
|
751
|
+
return {0: 10.0, 1: 30.0}
|
|
752
|
+
|
|
753
|
+
monkeypatch.setattr(
|
|
754
|
+
bs,
|
|
755
|
+
"galaxy_density_per_bin",
|
|
756
|
+
fake_galaxy_density_per_bin,
|
|
757
|
+
)
|
|
758
|
+
|
|
759
|
+
bins = _dummy_bins(2)
|
|
760
|
+
meta = {"frac_per_bin": {0: 1.0, 1: 3.0}}
|
|
761
|
+
|
|
762
|
+
out = bs.population_stats(bins, meta, density_total=40.0)
|
|
763
|
+
|
|
764
|
+
assert called["value"] is True
|
|
765
|
+
assert out["density_per_bin"] == {0: 10.0, 1: 30.0}
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
def test_population_stats_density_helper_output_is_restricted_to_bins() -> None:
|
|
769
|
+
"""Tests that population_stats only returns densities for requested bins."""
|
|
770
|
+
bins = _dummy_bins(2)
|
|
771
|
+
meta = {"frac_per_bin": {0: 1.0, 1: 3.0, 2: 6.0}}
|
|
772
|
+
|
|
773
|
+
out = population_stats(bins, meta, density_total=100.0)
|
|
774
|
+
|
|
775
|
+
assert set(out["density_per_bin"]) == {0, 1}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|