glass: extension of the existing script to the tomographic case#219
glass: extension of the existing script to the tomographic case#219sachaguer wants to merge 9 commits into
Conversation
…end with the new API. Updated the run script to the most recent version of GLASS
cailmdaley
left a comment
There was a problem hiding this comment.
Reviewing as the draft it is — the shape is good (list-or-scalar per-bin config, TOM_BIN_ID tagging, per-bin validation helpers), and most of what's left is finishing touches. Inline below; two headlines:
The dependency change is verified good news. We empirically checked glass[examples]==2026.2 against every glass/cosmology symbol this branch uses: clean install (glass-ext-camb 2023.6 and cosmology-compat-camb ride along via the examples extra), all APIs present with matching signatures, and the previously-broken map-generation path (build_shells → matter_cls → generate chain) now runs end-to-end, seed-deterministic. So this supersedes the old three-way pin — please also drop the now-stale xfail on test_matter_maps_are_seed_deterministic (its reason cites Cosmology.from_camb, which this branch no longer calls, and the test's call chain passes under 2026.2) and replace the commented-out pin block in pyproject.toml with a one-line note that 2026.2 resolves the whole stack.
Cross-PR wiring (also noted on #221): #221 reads the tomo bin column from cc[ver]["shear"]["tomo_bin_ids"]; this PR writes the literal column TOM_BIN_ID. Neither PR adds the config entry connecting them — worth wiring so the GLASS→pseudo-Cℓ validation loop actually closes, ideally as a small end-to-end 2-bin test.
— Fable, on behalf of Cail
| "Check that you downloaded the test mask from the repository." | ||
| ) | ||
| if not os.path.exists( | ||
| "config/glass_mock/test_data/redshift_distribution.txt" |
There was a problem hiding this comment.
--test mode is broken as committed: this file doesn't exist — the PR ships redshift_distribution_non_tomo.txt and redshift_distribution_tomo.txt, so this raises FileNotFoundError immediately. Also config_glass_mock_test.yaml isn't used by --test at all (this branch builds config via from_planck18 directly) — the two test paths have diverged; simplest fix might be to make --test just load the test yaml.
There was a problem hiding this comment.
This will be cleaned when my whole coherent testing will be fulfilled.
|
|
||
| # --- Runtime options --- | ||
| limber: True | ||
| mask_path: /n09data/guerrini/glass_mock_v1.4.6_rerun/mask_nside4096.fits |
There was a problem hiding this comment.
Still the hardcoded personal paths from Martin's earlier round — the committed config/glass_mock/test_data/ assets in this PR seem like the natural replacement (at least for the test config).
| """Cold dark matter density (CDM = matter - baryons), pre-neutrino.""" | ||
| return self.Om - self.Ob | ||
|
|
||
| def check_consistency(self): |
There was a problem hiding this comment.
from_yaml, check_consistency, and the shape_noise/number_density helpers are pure Python (no GLASS import needed) — a few unit tests (list-length mismatch → ValueError, per-bin n(z) normalization, scalar-vs-list broadcasting) would run in today's CI and lock in the config semantics cheaply.
This PR is corresponding to the issue #213.
Current progress allows me to run a tomographic GLASS mock. I am still in the validation process.
The API has been revised to work with config files and allow more flexibility on the parameters chosen before running the simulation.