-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
154 lines (146 loc) · 5.47 KB
/
Copy pathpyproject.toml
File metadata and controls
154 lines (146 loc) · 5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
[project]
name = "sp_validation"
version = "0.6.0"
description = "Validation of weak-lensing catalogues (galaxy and star shapes and other parameters) produced by ShapePipe"
authors = [
{name = "Martin Kilbinger", email = "martin.kilbinger@cea.fr"},
{name = "Cail Daley", email = "cail.daley@cea.fr"},
{name = "Sacha Guerrini", email = "sacha.guerrini@cea.fr"},
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Operating System :: Unix",
"Operating System :: MacOS"
]
dependencies = [
"adjustText",
"astropy>=5.0",
# Floor at the current latest release; do not cap — we want the eventual
# scipy-1.18 fix release. Revisit the scipy cap below when camb ships
# > 1.6.6 with the scipy-1.18 / BBN fix.
"camb>=1.6",
"clmm",
"colorama",
"cs_util>=0.2.1",
"emcee",
# SHA-pinned snapshot of getdist branch `upper_triangle_whisker`.
"getdist @ git+https://github.com/benabed/getdist.git@113cd22a9a0d013b6f72fe734be81f260f3d3be5",
"h5py",
"healpy",
"healsparse",
"importlib_metadata",
"joblib>=0.13",
"jupyter",
"jupyterlab",
"jupytext>=1.15",
"lenspack",
"lmfit",
"numexpr",
"numpy>=2.0",
"opencv-python-headless",
"pyccl",
"pyarrow",
"pymaster",
"regions",
"reproject",
# scipy 1.18 ported FITPACK from Fortran to C, changing the return shape of
# RectBivariateSpline(scalar, scalar, grid=False) from 0-d `array(x)` to
# shape-(1,) `array([x])`. camb's BBN Y_He predictor (bbn.py) wraps the
# result in np.float64(), which collapses a 0-d array to a scalar but leaves
# a (1,) array as (1,); set_cosmology then fails at the ctypes float
# assignment `self.YHe = YHe` with `TypeError: only 0-dimensional arrays can
# be converted to Python scalars`, failing all get_cosmo-backed tests. camb
# 1.6.6 (latest on PyPI) and current master are both unfixed. Lift this cap
# when camb ships > 1.6.6 with the scipy-1.18 fix.
"scipy<1.18",
"seaborn",
# Intentionally tracks the mutable `develop` branch (NOT SHA-pinned):
# shear_psf_leakage is actively co-developed CosmoStat code we want to stay
# current with, so freezing it would only create bump-churn. (Contrast the
# getdist feature-branch below, which is an external fork we pin for repro.)
"shear_psf_leakage @ git+https://github.com/CosmoStat/shear_psf_leakage.git@develop",
"skyproj",
"statsmodels",
"treecorr>=5.0",
"tqdm",
"uncertainties"
]
[project.urls]
Homepage = "https://github.com/CosmoStat/sp_validation"
[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"ruff"
]
docs = [
"sphinx>=8.0",
"myst-parser>=4.0",
"numpydoc>=1.8",
"sphinxcontrib-bibtex>=2.6",
# 6.0.3 is a broken wheel on PyPI (dist-info only, no python module)
"sphinxawesome-theme>=5.3,!=6.0.3"
]
# GLASS mock generation (sp_validation.glass_mock). Kept optional: the core
# library and its import guard resolve without GLASS, and the production
# container does not yet ship it. Pinned set (verified 2026-06-13, fiber
# glass-cosmology-api-pin): glass 2025.1 is the unique version with the flat API
# the map path uses AND the legacy ``cosmo.dc``/``xm``/``ef`` interface that
# ``cosmology`` 2022.10.9 (its newest release) provides — newer glass calls
# ``comoving_distance``, which no ``cosmology`` release exposes. ``matter_cls``
# lives in the separate ``glass.ext.camb`` package (absent from glass core
# >=2024.2), so it is pinned explicitly.
glass = [
"glass==2025.1",
"glass.ext.camb==2023.6",
"cosmology==2022.10.9",
]
develop = ["sp_validation[test,docs]"]
[tool.pytest.ini_options]
testpaths = ["src/sp_validation/tests"]
addopts = [
"--verbose",
"--cov=sp_validation",
"--cov-report=term",
"--cov-report=xml",
"--junitxml=pytest.xml"
]
markers = [
"fast: marks tests as fast (deselect with '-m \"not fast\"')",
"slow: marks tests as slow (deselect with '-m \"not slow\"')"
]
[tool.ruff]
line-length = 88
target-version = "py311"
# Snakemake injects a `snakemake` object into rule scripts at runtime, so ruff
# can't see where it's defined. Declaring it a builtin silences the false
# `F821 undefined-name` it raises in `workflow/scripts/*` (~110 hits) while
# still catching every other undefined name in those scripts.
builtins = ["snakemake"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
]
ignore = [
"E712", # comparison to True should be 'if cond is True:' or 'if cond:'
"E501", # line-too-long: the formatter owns line width (ruff's own guidance)
]
# Region-aware relaxations. src/ stays strict (no ignores). The peripheral
# trees — workflow scripts, per-paper analysis scripts, top-level scripts, and
# scratch — legitimately do sys.path manipulation before importing (E402) and
# pull names in via `from x import *` (F403/F405); enforcing those there would
# be noise, not signal.
[tool.ruff.lint.per-file-ignores]
"workflow/scripts/*" = ["E402"]
"papers/*/scripts/*" = ["E402", "F403", "F405"]
"papers/*/*.py" = ["E402", "F403", "F405"] # per-paper analysis scripts live at this level too
"scripts/*" = ["E402", "F403", "F405"]
"scratch/*" = ["E402", "F403", "F405"]
"cosmo_inference/**" = ["E402"] # notebooks + scripts do sys.path + mpl-backend setup before imports (covers .ipynb cells, not just .py)