psiphy 0.1.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.
- psiphy-0.1.1/LICENSE +21 -0
- psiphy-0.1.1/PKG-INFO +82 -0
- psiphy-0.1.1/README.md +40 -0
- psiphy-0.1.1/pyproject.toml +59 -0
- psiphy-0.1.1/setup.cfg +4 -0
- psiphy-0.1.1/src/psiphy/__init__.py +33 -0
- psiphy-0.1.1/src/psiphy/forecasting/__init__.py +1 -0
- psiphy-0.1.1/src/psiphy/forecasting/fisher.py +1136 -0
- psiphy-0.1.1/src/psiphy/mcmc/__init__.py +7 -0
- psiphy-0.1.1/src/psiphy/mcmc/importance_sampling.py +316 -0
- psiphy-0.1.1/src/psiphy/plotting/__init__.py +22 -0
- psiphy-0.1.1/src/psiphy/plotting/corner.py +416 -0
- psiphy-0.1.1/src/psiphy/plotting/diagnostics.py +666 -0
- psiphy-0.1.1/src/psiphy/plotting/mcmc_chains.py +403 -0
- psiphy-0.1.1/src/psiphy/sbi/__init__.py +24 -0
- psiphy-0.1.1/src/psiphy/sbi/abc_gp.py +128 -0
- psiphy-0.1.1/src/psiphy/sbi/bolfi.py +449 -0
- psiphy-0.1.1/src/psiphy/sbi/lfire.py +379 -0
- psiphy-0.1.1/src/psiphy/sbi/rejection_abc.py +33 -0
- psiphy-0.1.1/src/psiphy/sbi/sre.py +61 -0
- psiphy-0.1.1/src/psiphy/toy_models/__init__.py +5 -0
- psiphy-0.1.1/src/psiphy/toy_models/cosmological.py +71 -0
- psiphy-0.1.1/src/psiphy/toy_models/gaussian.py +64 -0
- psiphy-0.1.1/src/psiphy/toy_models/line_fitting.py +62 -0
- psiphy-0.1.1/src/psiphy/toy_models/lotka_volterra.py +146 -0
- psiphy-0.1.1/src/psiphy/toy_models/ma2.py +62 -0
- psiphy-0.1.1/src/psiphy/utils/__init__.py +18 -0
- psiphy-0.1.1/src/psiphy/utils/bayesian_opt.py +529 -0
- psiphy-0.1.1/src/psiphy/utils/distances.py +12 -0
- psiphy-0.1.1/src/psiphy/utils/gp_skopt.py +227 -0
- psiphy-0.1.1/src/psiphy/utils/helpers.py +30 -0
- psiphy-0.1.1/src/psiphy/utils/kernel_density.py +99 -0
- psiphy-0.1.1/src/psiphy/utils/sampling_space.py +125 -0
- psiphy-0.1.1/src/psiphy.egg-info/PKG-INFO +82 -0
- psiphy-0.1.1/src/psiphy.egg-info/SOURCES.txt +41 -0
- psiphy-0.1.1/src/psiphy.egg-info/dependency_links.txt +1 -0
- psiphy-0.1.1/src/psiphy.egg-info/requires.txt +34 -0
- psiphy-0.1.1/src/psiphy.egg-info/top_level.txt +1 -0
- psiphy-0.1.1/tests/test_diagnostics.py +249 -0
- psiphy-0.1.1/tests/test_importance_sampling.py +132 -0
- psiphy-0.1.1/tests/test_imports.py +20 -0
- psiphy-0.1.1/tests/test_toy_models.py +133 -0
- psiphy-0.1.1/tests/test_utils.py +25 -0
psiphy-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sambit Kumar Giri
|
|
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.
|
psiphy-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: psiphy
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Package for Statistical Inference of Physics — cosmological parameter inference tools
|
|
5
|
+
Author-email: Sambit Giri <sambit.giri@astro.su.se>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/sambit-giri/psiphy
|
|
8
|
+
Project-URL: Issues, https://github.com/sambit-giri/psiphy/issues
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: numpy
|
|
13
|
+
Requires-Dist: scipy
|
|
14
|
+
Requires-Dist: matplotlib
|
|
15
|
+
Requires-Dist: scikit-learn
|
|
16
|
+
Requires-Dist: scikit-image
|
|
17
|
+
Requires-Dist: getdist
|
|
18
|
+
Provides-Extra: mcmc
|
|
19
|
+
Requires-Dist: emcee; extra == "mcmc"
|
|
20
|
+
Requires-Dist: dynesty; extra == "mcmc"
|
|
21
|
+
Requires-Dist: nautilus-sampler; extra == "mcmc"
|
|
22
|
+
Provides-Extra: sbi
|
|
23
|
+
Requires-Dist: sbi; extra == "sbi"
|
|
24
|
+
Requires-Dist: torch; extra == "sbi"
|
|
25
|
+
Provides-Extra: hmc
|
|
26
|
+
Requires-Dist: blackjax; extra == "hmc"
|
|
27
|
+
Requires-Dist: jax; extra == "hmc"
|
|
28
|
+
Requires-Dist: jaxlib; extra == "hmc"
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
Requires-Dist: sphinx; extra == "docs"
|
|
31
|
+
Requires-Dist: sphinx-rtd-theme; extra == "docs"
|
|
32
|
+
Requires-Dist: myst-parser; extra == "docs"
|
|
33
|
+
Requires-Dist: numpydoc; extra == "docs"
|
|
34
|
+
Requires-Dist: nbsphinx; extra == "docs"
|
|
35
|
+
Requires-Dist: ipykernel; extra == "docs"
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
39
|
+
Requires-Dist: ruff; extra == "dev"
|
|
40
|
+
Requires-Dist: psiphy[docs,hmc,mcmc,sbi]; extra == "dev"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
# psiphy — Package for Statistical Inference of Physics
|
|
44
|
+
|
|
45
|
+
<img src="docs/logo_cropped.png" alt="psiphy logo" width="120" align="right"/>
|
|
46
|
+
|
|
47
|
+
[](https://github.com/sambit-giri/psiphy/blob/master/LICENSE)
|
|
48
|
+
[](https://github.com/sambit-giri/psiphy)
|
|
49
|
+
[](https://github.com/sambit-giri/psiphy/actions/workflows/ci.yml)
|
|
50
|
+
[](https://sambit-giri.github.io/psiphy)
|
|
51
|
+
|
|
52
|
+
A Python package for cosmological parameter inference, providing tools for
|
|
53
|
+
simulation-based inference (SBI), MCMC sampling, Fisher forecasting, and
|
|
54
|
+
posterior diagnostics.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
Install directly from GitHub:
|
|
59
|
+
|
|
60
|
+
pip install git+https://github.com/sambit-giri/psiphy.git
|
|
61
|
+
|
|
62
|
+
To include optional dependencies (e.g. MCMC samplers):
|
|
63
|
+
|
|
64
|
+
pip install "git+https://github.com/sambit-giri/psiphy.git#egg=psiphy[mcmc]"
|
|
65
|
+
|
|
66
|
+
For a local editable install (recommended for development):
|
|
67
|
+
|
|
68
|
+
git clone https://github.com/sambit-giri/psiphy.git
|
|
69
|
+
cd psiphy
|
|
70
|
+
pip install -e ".[dev]"
|
|
71
|
+
|
|
72
|
+
## Running the tests
|
|
73
|
+
|
|
74
|
+
The test suite uses [pytest](https://pytest.org). After installing with the `dev` extras:
|
|
75
|
+
|
|
76
|
+
pytest tests/ -v
|
|
77
|
+
|
|
78
|
+
Tests cover package imports, toy model simulators, and sampling utilities. New tests are added alongside each new module.
|
|
79
|
+
|
|
80
|
+
## Contributing and feedback
|
|
81
|
+
|
|
82
|
+
Bug reports, feature requests, and questions are welcome — please open an issue on the [GitHub issue tracker](https://github.com/sambit-giri/psiphy/issues). Pull requests are also encouraged.
|
psiphy-0.1.1/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# psiphy — Package for Statistical Inference of Physics
|
|
2
|
+
|
|
3
|
+
<img src="docs/logo_cropped.png" alt="psiphy logo" width="120" align="right"/>
|
|
4
|
+
|
|
5
|
+
[](https://github.com/sambit-giri/psiphy/blob/master/LICENSE)
|
|
6
|
+
[](https://github.com/sambit-giri/psiphy)
|
|
7
|
+
[](https://github.com/sambit-giri/psiphy/actions/workflows/ci.yml)
|
|
8
|
+
[](https://sambit-giri.github.io/psiphy)
|
|
9
|
+
|
|
10
|
+
A Python package for cosmological parameter inference, providing tools for
|
|
11
|
+
simulation-based inference (SBI), MCMC sampling, Fisher forecasting, and
|
|
12
|
+
posterior diagnostics.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install directly from GitHub:
|
|
17
|
+
|
|
18
|
+
pip install git+https://github.com/sambit-giri/psiphy.git
|
|
19
|
+
|
|
20
|
+
To include optional dependencies (e.g. MCMC samplers):
|
|
21
|
+
|
|
22
|
+
pip install "git+https://github.com/sambit-giri/psiphy.git#egg=psiphy[mcmc]"
|
|
23
|
+
|
|
24
|
+
For a local editable install (recommended for development):
|
|
25
|
+
|
|
26
|
+
git clone https://github.com/sambit-giri/psiphy.git
|
|
27
|
+
cd psiphy
|
|
28
|
+
pip install -e ".[dev]"
|
|
29
|
+
|
|
30
|
+
## Running the tests
|
|
31
|
+
|
|
32
|
+
The test suite uses [pytest](https://pytest.org). After installing with the `dev` extras:
|
|
33
|
+
|
|
34
|
+
pytest tests/ -v
|
|
35
|
+
|
|
36
|
+
Tests cover package imports, toy model simulators, and sampling utilities. New tests are added alongside each new module.
|
|
37
|
+
|
|
38
|
+
## Contributing and feedback
|
|
39
|
+
|
|
40
|
+
Bug reports, feature requests, and questions are welcome — please open an issue on the [GitHub issue tracker](https://github.com/sambit-giri/psiphy/issues). Pull requests are also encouraged.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "psiphy"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Package for Statistical Inference of Physics — cosmological parameter inference tools"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Sambit Giri", email = "sambit.giri@astro.su.se" },
|
|
13
|
+
]
|
|
14
|
+
requires-python = ">=3.9"
|
|
15
|
+
dependencies = [
|
|
16
|
+
"numpy",
|
|
17
|
+
"scipy",
|
|
18
|
+
"matplotlib",
|
|
19
|
+
"scikit-learn",
|
|
20
|
+
"scikit-image",
|
|
21
|
+
"getdist",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
mcmc = [
|
|
26
|
+
"emcee",
|
|
27
|
+
"dynesty",
|
|
28
|
+
"nautilus-sampler",
|
|
29
|
+
]
|
|
30
|
+
sbi = [
|
|
31
|
+
"sbi",
|
|
32
|
+
"torch",
|
|
33
|
+
]
|
|
34
|
+
hmc = [
|
|
35
|
+
"blackjax",
|
|
36
|
+
"jax",
|
|
37
|
+
"jaxlib",
|
|
38
|
+
]
|
|
39
|
+
docs = [
|
|
40
|
+
"sphinx",
|
|
41
|
+
"sphinx-rtd-theme",
|
|
42
|
+
"myst-parser",
|
|
43
|
+
"numpydoc",
|
|
44
|
+
"nbsphinx",
|
|
45
|
+
"ipykernel",
|
|
46
|
+
]
|
|
47
|
+
dev = [
|
|
48
|
+
"pytest",
|
|
49
|
+
"pytest-cov",
|
|
50
|
+
"ruff",
|
|
51
|
+
"psiphy[mcmc,sbi,hmc,docs]",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[project.urls]
|
|
55
|
+
Homepage = "https://github.com/sambit-giri/psiphy"
|
|
56
|
+
Issues = "https://github.com/sambit-giri/psiphy/issues"
|
|
57
|
+
|
|
58
|
+
[tool.setuptools.packages.find]
|
|
59
|
+
where = ["src"]
|
psiphy-0.1.1/setup.cfg
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
psiphy — Package for Statistical Inference of Physics
|
|
3
|
+
|
|
4
|
+
A Python package for cosmological parameter inference, providing tools for
|
|
5
|
+
simulation-based inference (SBI), MCMC sampling, Fisher forecasting, and
|
|
6
|
+
posterior diagnostics.
|
|
7
|
+
|
|
8
|
+
Submodules
|
|
9
|
+
----------
|
|
10
|
+
psiphy.sbi : Likelihood-free / simulation-based inference (BOLFI, LFIRE, ABC, SRE)
|
|
11
|
+
psiphy.mcmc : MCMC samplers (MH/emcee, nested sampling, HMC)
|
|
12
|
+
psiphy.forecasting: Fisher matrix forecasting
|
|
13
|
+
psiphy.plotting : Posterior corner plots and diagnostics
|
|
14
|
+
psiphy.toy_models : Example simulators for testing and benchmarking
|
|
15
|
+
psiphy.utils : Shared utilities (distances, KDE, sampling, helpers)
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import importlib.metadata
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
__version__ = importlib.metadata.version("psiphy")
|
|
22
|
+
except importlib.metadata.PackageNotFoundError:
|
|
23
|
+
__version__ = "unknown"
|
|
24
|
+
|
|
25
|
+
import numpy
|
|
26
|
+
numpy.seterr(all='ignore')
|
|
27
|
+
|
|
28
|
+
from . import utils
|
|
29
|
+
from . import sbi
|
|
30
|
+
from . import mcmc
|
|
31
|
+
from . import forecasting
|
|
32
|
+
from . import plotting
|
|
33
|
+
from . import toy_models
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .fisher import FisherMatrix
|