binny.surveys.config_utils module#
Survey config parsing utilities.
This module provides small, reusable helpers for reading survey YAML files and selecting entries from a flat tomography list schema.
Schema:
name: <optional str>
survey_meta: <optional mapping> # ignored unless requested
z_grid: {start: float, stop: float, n: int} # optional
nz: {model: str, params: {…}} # required parent distribution
tomography: # required
- role: <optional str>
year: <optional str>
n_gal_arcmin2: <optional float>
kind: photoz|specz # optional; defaults to photoz
bins:
edges: [...] # explicit edges
# OR
scheme: <str>
n_bins: <int>
range: [z_min, z_max] # optional
uncertainties: {…} # optional kwargs passed to builders
- class binny.surveys.config_utils.SurveyFootprint#
Bases:
TypedDictTyped footprint metadata returned from survey configs.
- frac_sky: float#
- survey_area: float#
- binny.surveys.config_utils.config_path(filename: str) Path#
Resolves a shipped config filename to a concrete filesystem path.
This helper locates configuration files bundled with the package and returns a usable local path (via
importlib.resources.as_file).- Parameters:
filename – Shipped YAML filename (
.yamlor.yml).- Returns:
Local filesystem path to the shipped config.
- Raises:
FileNotFoundError – If no shipped config matches
filename.
- binny.surveys.config_utils.list_configs() list[str]#
Lists shipped survey configuration filenames.
- Returns:
Sorted list of YAML filenames shipped in the
binny.surveys.configspackage directory.