rlds-cosmo 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aleksander Kubanski
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.
@@ -0,0 +1,196 @@
1
+ Metadata-Version: 2.4
2
+ Name: rlds-cosmo
3
+ Version: 0.1.0
4
+ Summary: Cosmological application layer for Regime-Limited Dynamical Systems (RLDS)
5
+ Author-email: Aleksander Kubanski <aleksander@kubanski.pro>
6
+ License: MIT
7
+ Project-URL: Homepage, https://research.kubanski.pro
8
+ Project-URL: Documentation, https://github.com/AKubanski/rlds-cosmo#readme
9
+ Project-URL: Repository, https://github.com/AKubanski/rlds-cosmo
10
+ Project-URL: Issues, https://github.com/AKubanski/rlds-cosmo/issues
11
+ Project-URL: RLDS-MAT mathematical core, https://github.com/AKubanski/rlds-mat
12
+ Project-URL: RLDS-MAT DOI, https://doi.org/10.5281/zenodo.20342965
13
+ Project-URL: RLDS overview DOI, https://doi.org/10.5281/zenodo.19670133
14
+ Keywords: cosmology,dark energy,dark matter,MCMC,RLDS,attractor,phantom,GRB,DESI,Cobaya
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
23
+ Classifier: Topic :: Scientific/Engineering :: Physics
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: numpy>=1.23
28
+ Requires-Dist: scipy>=1.9
29
+ Requires-Dist: matplotlib>=3.5
30
+ Provides-Extra: mcmc
31
+ Requires-Dist: emcee>=3.0; extra == "mcmc"
32
+ Requires-Dist: corner>=2.2; extra == "mcmc"
33
+ Provides-Extra: cobaya
34
+ Requires-Dist: cobaya>=3.4; extra == "cobaya"
35
+ Provides-Extra: notebook
36
+ Requires-Dist: jupyter; extra == "notebook"
37
+ Requires-Dist: ipykernel; extra == "notebook"
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=7.0; extra == "dev"
40
+ Requires-Dist: pytest-cov; extra == "dev"
41
+ Requires-Dist: ruff; extra == "dev"
42
+ Provides-Extra: yaml
43
+ Requires-Dist: pyyaml>=6.0; extra == "yaml"
44
+ Dynamic: license-file
45
+
46
+ # rlds-cosmo
47
+
48
+ **RLDS-COSMO** is the cosmological application layer of the Regime-Limited Dynamical Systems (RLDS) framework. It provides a reproducible high-redshift GRB forecast toolkit for testing the RLDS dark-sector closure against CPL/ΛCDM baselines.
49
+
50
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
51
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
52
+ [![RLDS overview DOI](https://img.shields.io/badge/RLDS%20overview-10.5281%2Fzenodo.19670133-blue)](https://doi.org/10.5281/zenodo.19670133)
53
+
54
+ ## Position in the RLDS software family
55
+
56
+ - **`rlds-mat`** is the mathematical core: RLDS reduction criteria, auxiliary-function geometry, attractor verification, and stability analysis.
57
+ - **`rlds-cosmo`** is the first application layer: shooting self-consistency for dark-sector cosmology, high-redshift GRB forecast machinery, and a Cobaya-compatible theory wrapper.
58
+
59
+ RLDS-MAT DOI: https://doi.org/10.5281/zenodo.20342965
60
+ RLDS overview DOI: https://doi.org/10.5281/zenodo.19670133
61
+
62
+ ## Headline GRB forecast
63
+
64
+ For the current RLDS posterior, the package reproduces the high-redshift GRB signature:
65
+
66
+ - median distance-modulus residual in `4 < z < 8`: about **−40 mmag** over the posterior;
67
+ - best-fit example: about **−32 mmag** in `4 < z < 8`;
68
+ - detection forecast at `σ_μ = 0.25 mag`: approximately **2.3σ for N_GRB = 200** and **>3σ for N_GRB = 500** for the posterior median signal;
69
+ - Cobaya-compatible theory wrapper for use in standard cosmological pipelines.
70
+
71
+ The sign convention is
72
+
73
+ ```text
74
+ Δμ = μ_CPL+Planck − μ_RLDS
75
+ ```
76
+
77
+ so a negative value means the RLDS prediction is brighter at high redshift than the CPL+Planck counter-fit.
78
+
79
+ ## Installation
80
+
81
+ From a local checkout:
82
+
83
+ ```bash
84
+ pip install -e .
85
+ ```
86
+
87
+ After PyPI publication:
88
+
89
+ ```bash
90
+ pip install rlds-cosmo
91
+ ```
92
+
93
+ ## Quick start
94
+
95
+ ```python
96
+ from rlds_cosmo import ShootingRLDS, best_fit_params, predict_grb_residual
97
+
98
+ model = ShootingRLDS(**best_fit_params())
99
+
100
+ print(f"Omega_m = {model.Omega_m:.4f}")
101
+ print(f"w_eff(z=1) = {model.w_eff(1.0):.5f}")
102
+
103
+ result = predict_grb_residual(model)
104
+ print(f"<Δμ> z=4-8 = {result['avg_4_8_mmag']:+.1f} mmag")
105
+ print(f"CPL counter-fit: w0={result['w0_cpl']:+.3f}, wa={result['wa_cpl']:+.3f}")
106
+ ```
107
+
108
+ Expected best-fit-scale output:
109
+
110
+ ```text
111
+ Omega_m = 0.2998
112
+ w_eff(z=1) = -1.00149
113
+ <Δμ> z=4-8 = -32.1 mmag
114
+ ```
115
+
116
+ ## Command line
117
+
118
+ ```bash
119
+ rlds-cosmo info
120
+ rlds-cosmo quickstart
121
+ rlds-cosmo headline --samples 100 --output grb_headline.png
122
+ ```
123
+
124
+ The `headline` command regenerates the four-panel GRB figure from posterior samples.
125
+
126
+ ## What is included
127
+
128
+ | Module | Purpose |
129
+ |---|---|
130
+ | `rlds_cosmo.model` | Core `ShootingRLDS` cosmology and observables |
131
+ | `rlds_cosmo.posterior` | Bundled posterior chain and propagation helpers |
132
+ | `rlds_cosmo.forecast` | GRB residual forecast and CPL counter-fit machinery |
133
+ | `rlds_cosmo.cobaya_module` | Cobaya `Theory` plugin |
134
+ | `rlds_cosmo.lcdm` | Reference ΛCDM utilities |
135
+
136
+ ## Cobaya integration
137
+
138
+ ```yaml
139
+ theory:
140
+ rlds_cosmo.cobaya_module.RLDSTheory:
141
+ speed: 50
142
+
143
+ params:
144
+ K: {prior: {min: 0.005, max: 0.25}, ref: 0.012}
145
+ H0: {prior: {min: 60.0, max: 75.0}, ref: 67.44}
146
+ R_c: {prior: {min: 0.30, max: 0.60}, ref: 0.51}
147
+ Delta_R: {prior: {min: 0.03, max: 0.20}, ref: 0.15}
148
+ alpha: {prior: {min: 3.01, max: 3.30}, ref: 3.010}
149
+ Omega_m_derived: {derived: true}
150
+ ```
151
+
152
+ See `examples/02_cobaya_demo.py` and `examples/rlds_demo.yaml`.
153
+
154
+ ## Reproducing the GRB figure
155
+
156
+ ```bash
157
+ python examples/01_grb_headline.py
158
+ ```
159
+
160
+ or, after installation:
161
+
162
+ ```bash
163
+ rlds-cosmo headline --samples 200 --output grb_headline.png
164
+ ```
165
+
166
+ Runtime depends on the number of posterior samples. A 100–200 sample run is enough for a fast reproducibility check; larger runs are used for publication figures.
167
+
168
+ ## Important naming note
169
+
170
+ The distribution name is:
171
+
172
+ ```text
173
+ rlds-cosmo
174
+ ```
175
+
176
+ The Python import name is:
177
+
178
+ ```python
179
+ import rlds_cosmo
180
+ ```
181
+
182
+ The import package is intentionally **not** named `rlds`, to avoid conflicts with unrelated packages and to mirror the existing `rlds_mat` core package.
183
+
184
+ ## Citing
185
+
186
+ If you use this code, cite the RLDS overview record:
187
+
188
+ > Kubanski, A. (2026). RLDS dark-sector research program. Zenodo. DOI: 10.5281/zenodo.19670133
189
+
190
+ When referring to the mathematical core, cite RLDS-MAT:
191
+
192
+ > RLDS-MAT DOI: 10.5281/zenodo.20342965
193
+
194
+ ## License
195
+
196
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,151 @@
1
+ # rlds-cosmo
2
+
3
+ **RLDS-COSMO** is the cosmological application layer of the Regime-Limited Dynamical Systems (RLDS) framework. It provides a reproducible high-redshift GRB forecast toolkit for testing the RLDS dark-sector closure against CPL/ΛCDM baselines.
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
7
+ [![RLDS overview DOI](https://img.shields.io/badge/RLDS%20overview-10.5281%2Fzenodo.19670133-blue)](https://doi.org/10.5281/zenodo.19670133)
8
+
9
+ ## Position in the RLDS software family
10
+
11
+ - **`rlds-mat`** is the mathematical core: RLDS reduction criteria, auxiliary-function geometry, attractor verification, and stability analysis.
12
+ - **`rlds-cosmo`** is the first application layer: shooting self-consistency for dark-sector cosmology, high-redshift GRB forecast machinery, and a Cobaya-compatible theory wrapper.
13
+
14
+ RLDS-MAT DOI: https://doi.org/10.5281/zenodo.20342965
15
+ RLDS overview DOI: https://doi.org/10.5281/zenodo.19670133
16
+
17
+ ## Headline GRB forecast
18
+
19
+ For the current RLDS posterior, the package reproduces the high-redshift GRB signature:
20
+
21
+ - median distance-modulus residual in `4 < z < 8`: about **−40 mmag** over the posterior;
22
+ - best-fit example: about **−32 mmag** in `4 < z < 8`;
23
+ - detection forecast at `σ_μ = 0.25 mag`: approximately **2.3σ for N_GRB = 200** and **>3σ for N_GRB = 500** for the posterior median signal;
24
+ - Cobaya-compatible theory wrapper for use in standard cosmological pipelines.
25
+
26
+ The sign convention is
27
+
28
+ ```text
29
+ Δμ = μ_CPL+Planck − μ_RLDS
30
+ ```
31
+
32
+ so a negative value means the RLDS prediction is brighter at high redshift than the CPL+Planck counter-fit.
33
+
34
+ ## Installation
35
+
36
+ From a local checkout:
37
+
38
+ ```bash
39
+ pip install -e .
40
+ ```
41
+
42
+ After PyPI publication:
43
+
44
+ ```bash
45
+ pip install rlds-cosmo
46
+ ```
47
+
48
+ ## Quick start
49
+
50
+ ```python
51
+ from rlds_cosmo import ShootingRLDS, best_fit_params, predict_grb_residual
52
+
53
+ model = ShootingRLDS(**best_fit_params())
54
+
55
+ print(f"Omega_m = {model.Omega_m:.4f}")
56
+ print(f"w_eff(z=1) = {model.w_eff(1.0):.5f}")
57
+
58
+ result = predict_grb_residual(model)
59
+ print(f"<Δμ> z=4-8 = {result['avg_4_8_mmag']:+.1f} mmag")
60
+ print(f"CPL counter-fit: w0={result['w0_cpl']:+.3f}, wa={result['wa_cpl']:+.3f}")
61
+ ```
62
+
63
+ Expected best-fit-scale output:
64
+
65
+ ```text
66
+ Omega_m = 0.2998
67
+ w_eff(z=1) = -1.00149
68
+ <Δμ> z=4-8 = -32.1 mmag
69
+ ```
70
+
71
+ ## Command line
72
+
73
+ ```bash
74
+ rlds-cosmo info
75
+ rlds-cosmo quickstart
76
+ rlds-cosmo headline --samples 100 --output grb_headline.png
77
+ ```
78
+
79
+ The `headline` command regenerates the four-panel GRB figure from posterior samples.
80
+
81
+ ## What is included
82
+
83
+ | Module | Purpose |
84
+ |---|---|
85
+ | `rlds_cosmo.model` | Core `ShootingRLDS` cosmology and observables |
86
+ | `rlds_cosmo.posterior` | Bundled posterior chain and propagation helpers |
87
+ | `rlds_cosmo.forecast` | GRB residual forecast and CPL counter-fit machinery |
88
+ | `rlds_cosmo.cobaya_module` | Cobaya `Theory` plugin |
89
+ | `rlds_cosmo.lcdm` | Reference ΛCDM utilities |
90
+
91
+ ## Cobaya integration
92
+
93
+ ```yaml
94
+ theory:
95
+ rlds_cosmo.cobaya_module.RLDSTheory:
96
+ speed: 50
97
+
98
+ params:
99
+ K: {prior: {min: 0.005, max: 0.25}, ref: 0.012}
100
+ H0: {prior: {min: 60.0, max: 75.0}, ref: 67.44}
101
+ R_c: {prior: {min: 0.30, max: 0.60}, ref: 0.51}
102
+ Delta_R: {prior: {min: 0.03, max: 0.20}, ref: 0.15}
103
+ alpha: {prior: {min: 3.01, max: 3.30}, ref: 3.010}
104
+ Omega_m_derived: {derived: true}
105
+ ```
106
+
107
+ See `examples/02_cobaya_demo.py` and `examples/rlds_demo.yaml`.
108
+
109
+ ## Reproducing the GRB figure
110
+
111
+ ```bash
112
+ python examples/01_grb_headline.py
113
+ ```
114
+
115
+ or, after installation:
116
+
117
+ ```bash
118
+ rlds-cosmo headline --samples 200 --output grb_headline.png
119
+ ```
120
+
121
+ Runtime depends on the number of posterior samples. A 100–200 sample run is enough for a fast reproducibility check; larger runs are used for publication figures.
122
+
123
+ ## Important naming note
124
+
125
+ The distribution name is:
126
+
127
+ ```text
128
+ rlds-cosmo
129
+ ```
130
+
131
+ The Python import name is:
132
+
133
+ ```python
134
+ import rlds_cosmo
135
+ ```
136
+
137
+ The import package is intentionally **not** named `rlds`, to avoid conflicts with unrelated packages and to mirror the existing `rlds_mat` core package.
138
+
139
+ ## Citing
140
+
141
+ If you use this code, cite the RLDS overview record:
142
+
143
+ > Kubanski, A. (2026). RLDS dark-sector research program. Zenodo. DOI: 10.5281/zenodo.19670133
144
+
145
+ When referring to the mathematical core, cite RLDS-MAT:
146
+
147
+ > RLDS-MAT DOI: 10.5281/zenodo.20342965
148
+
149
+ ## License
150
+
151
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,67 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rlds-cosmo"
7
+ dynamic = ["version"]
8
+ description = "Cosmological application layer for Regime-Limited Dynamical Systems (RLDS)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "Aleksander Kubanski", email = "aleksander@kubanski.pro"}
14
+ ]
15
+ keywords = [
16
+ "cosmology", "dark energy", "dark matter", "MCMC",
17
+ "RLDS", "attractor", "phantom", "GRB", "DESI", "Cobaya"
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 4 - Beta",
21
+ "Intended Audience :: Science/Research",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Topic :: Scientific/Engineering :: Astronomy",
28
+ "Topic :: Scientific/Engineering :: Physics",
29
+ ]
30
+ dependencies = [
31
+ "numpy>=1.23",
32
+ "scipy>=1.9",
33
+ "matplotlib>=3.5",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ mcmc = ["emcee>=3.0", "corner>=2.2"]
38
+ cobaya = ["cobaya>=3.4"]
39
+ notebook = ["jupyter", "ipykernel"]
40
+ dev = ["pytest>=7.0", "pytest-cov", "ruff"]
41
+ yaml = ["pyyaml>=6.0"]
42
+
43
+ [project.scripts]
44
+ rlds-cosmo = "rlds_cosmo.cli:main"
45
+
46
+ [project.urls]
47
+ Homepage = "https://research.kubanski.pro"
48
+ Documentation = "https://github.com/AKubanski/rlds-cosmo#readme"
49
+ Repository = "https://github.com/AKubanski/rlds-cosmo"
50
+ Issues = "https://github.com/AKubanski/rlds-cosmo/issues"
51
+ "RLDS-MAT mathematical core" = "https://github.com/AKubanski/rlds-mat"
52
+ "RLDS-MAT DOI" = "https://doi.org/10.5281/zenodo.20342965"
53
+ "RLDS overview DOI" = "https://doi.org/10.5281/zenodo.19670133"
54
+
55
+ [tool.setuptools]
56
+ packages = ["rlds_cosmo"]
57
+ include-package-data = true
58
+
59
+ [tool.setuptools.dynamic]
60
+ version = {attr = "rlds_cosmo._version.__version__"}
61
+
62
+ [tool.setuptools.package-data]
63
+ rlds_cosmo = ["data/*.npy"]
64
+
65
+ [tool.pytest.ini_options]
66
+ testpaths = ["tests"]
67
+ pythonpath = ["."]
@@ -0,0 +1,104 @@
1
+ """
2
+ rlds-cosmo
3
+ ==========
4
+
5
+ Cosmological application layer for Regime-Limited Dynamical Systems (RLDS).
6
+
7
+ The package provides a reproducible high-redshift GRB forecast toolkit for
8
+ RLDS dark-sector cosmology: a shooting solver, posterior propagation,
9
+ CPL+Planck counter-fits, and a Cobaya-compatible theory wrapper.
10
+
11
+ Quick start
12
+ -----------
13
+ >>> from rlds_cosmo import ShootingRLDS, best_fit_params
14
+ >>> params = best_fit_params()
15
+ >>> model = ShootingRLDS(**params)
16
+ >>> print(f"Omega_m (derived) = {model.Omega_m:.4f}")
17
+ >>> print(f"mu(z=1) = {model.mu(1.0):.4f}")
18
+
19
+ GRB forecast
20
+ ------------
21
+ >>> from rlds_cosmo import predict_grb_residual, detection_significance
22
+ >>> result = predict_grb_residual(model)
23
+ >>> print(f"<Δμ> in z=4-8: {result['avg_4_8_mmag']:.1f} mmag")
24
+ >>> z = detection_significance(result['avg_4_8_mmag'], n_grb=200, sigma_mu=0.25)
25
+ >>> print(f"Detection: {z:.2f}σ")
26
+
27
+ References
28
+ ----------
29
+ Kubanski A. (2026). RLDS dark-sector research program.
30
+ Zenodo overview DOI: 10.5281/zenodo.19670133
31
+ """
32
+
33
+ from ._version import __version__
34
+
35
+ from .model import (
36
+ ShootingRLDS,
37
+ find_selfconsistent_Omega_m,
38
+ find_attractor,
39
+ R_LCDM,
40
+ C_LIGHT,
41
+ OMEGA_R_DEFAULT,
42
+ )
43
+
44
+ from .lcdm import (
45
+ E_LCDM,
46
+ distance_modulus_LCDM,
47
+ sound_horizon_Eh98,
48
+ )
49
+
50
+ from .posterior import (
51
+ load_chains,
52
+ best_fit_params,
53
+ random_samples,
54
+ propagate,
55
+ PARAM_NAMES,
56
+ )
57
+
58
+ from .forecast import (
59
+ predict_grb_residual,
60
+ detection_significance,
61
+ fit_cpl_omfixed,
62
+ E_CPL,
63
+ OMEGA_M_PLANCK,
64
+ )
65
+
66
+ # Cobaya integration imports lazily; the module works even without cobaya.
67
+ from .cobaya_module import (
68
+ RLDSTheory,
69
+ get_default_yaml,
70
+ print_default_yaml,
71
+ COBAYA_AVAILABLE,
72
+ )
73
+
74
+ __all__ = [
75
+ "__version__",
76
+ # core
77
+ "ShootingRLDS",
78
+ "find_selfconsistent_Omega_m",
79
+ "find_attractor",
80
+ "R_LCDM",
81
+ "C_LIGHT",
82
+ "OMEGA_R_DEFAULT",
83
+ # LCDM
84
+ "E_LCDM",
85
+ "distance_modulus_LCDM",
86
+ "sound_horizon_Eh98",
87
+ # posterior
88
+ "load_chains",
89
+ "best_fit_params",
90
+ "random_samples",
91
+ "propagate",
92
+ "PARAM_NAMES",
93
+ # forecast
94
+ "predict_grb_residual",
95
+ "detection_significance",
96
+ "fit_cpl_omfixed",
97
+ "E_CPL",
98
+ "OMEGA_M_PLANCK",
99
+ # cobaya
100
+ "RLDSTheory",
101
+ "get_default_yaml",
102
+ "print_default_yaml",
103
+ "COBAYA_AVAILABLE",
104
+ ]
@@ -0,0 +1,3 @@
1
+ """Version information for rlds-cosmo."""
2
+
3
+ __version__ = "0.1.0"