Skip to content

glass: extension of the existing script to the tomographic case#219

Draft
sachaguer wants to merge 9 commits into
feature/sp_validation-extend-to-tomographyfrom
feature/glass
Draft

glass: extension of the existing script to the tomographic case#219
sachaguer wants to merge 9 commits into
feature/sp_validation-extend-to-tomographyfrom
feature/glass

Conversation

@sachaguer

Copy link
Copy Markdown
Contributor

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.

@sachaguer sachaguer self-assigned this Jul 1, 2026
@sachaguer sachaguer linked an issue Jul 1, 2026 that may be closed by this pull request
Comment thread config/glass_mock/config_glass_mock.yaml
Comment thread config/glass_mock/config_glass_mock_test.yaml
@cailmdaley cailmdaley mentioned this pull request Jul 6, 2026

@cailmdaley cailmdaley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_shellsmatter_clsgenerate 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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

"""Cold dark matter density (CDM = matter - baryons), pre-neutrino."""
return self.Om - self.Ob

def check_consistency(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tomographic GLASS mock generation

3 participants