shine.validation.bias_config¶
Pydantic configuration models for bias testing.
Defines bias levels, convergence thresholds, shear grids, acceptance criteria, and per-run/campaign configuration.
bias_config
¶
Pydantic configuration models for bias testing.
BiasLevel
¶
Bases: str, Enum
Bias testing levels, from noiseless sanity check to survey-realistic.
ConvergenceThresholds
¶
Bases: BaseModel
Thresholds for MCMC convergence diagnostics.
Attributes:
| Name | Type | Description |
|---|---|---|
rhat_max |
float
|
Maximum acceptable R-hat statistic. |
ess_min |
int
|
Minimum acceptable effective sample size. |
divergence_frac_max |
float
|
Maximum acceptable fraction of divergent transitions. |
bfmi_min |
float
|
Minimum acceptable Bayesian Fraction of Missing Information. |
ShearGrid
¶
Bases: BaseModel
Grid of true shear values for bias regression.
Attributes:
| Name | Type | Description |
|---|---|---|
values |
List[float]
|
List of g_true values to test. |
validate_values(v)
classmethod
¶
Validate that shear grid values are within physical bounds.
Source code in shine/validation/bias_config.py
AcceptanceCriteria
¶
Bases: BaseModel
Level-specific acceptance criteria for bias tests.
Attributes:
| Name | Type | Description |
|---|---|---|
max_offset_sigma |
float
|
Maximum offset from truth in units of posterior sigma. |
max_posterior_width |
Optional[float]
|
Maximum posterior standard deviation. |
max_abs_m |
Optional[float]
|
Maximum acceptable |m| (multiplicative bias). |
max_abs_c |
Optional[float]
|
Maximum acceptable |c| (additive bias). |
coverage_levels |
List[float]
|
Expected coverage levels to check (e.g., 68%, 95%). |
BiasRunConfig
¶
Bases: BaseModel
Configuration for a single bias measurement realization.
This is the per-GPU-job unit. The campaign orchestrator creates one BiasRunConfig per realization.
Attributes:
| Name | Type | Description |
|---|---|---|
shine_config_path |
str
|
Path to the base SHINE YAML config. |
g1_true |
float
|
True g1 shear value for this realization. |
g2_true |
float
|
True g2 shear value for this realization. |
seed |
int
|
Random seed for noise generation. |
paired |
bool
|
Whether this is a paired-shear realization. |
output_dir |
str
|
Directory for output files. |
run_id |
str
|
Unique identifier for this realization. |
BiasTestConfig
¶
Bases: BaseModel
Full campaign configuration for bias testing.
Attributes:
| Name | Type | Description |
|---|---|---|
level |
BiasLevel
|
Bias testing level. |
shine_config_path |
str
|
Path to the base SHINE YAML config. |
shear_grid |
ShearGrid
|
Grid of true shear values. |
n_realizations |
int
|
Number of realizations per shear grid point. |
paired |
bool
|
Whether to use paired-shear method. |
convergence |
ConvergenceThresholds
|
Convergence diagnostic thresholds. |
acceptance |
AcceptanceCriteria
|
Acceptance criteria for bias results. |
output_dir |
str
|
Top-level output directory. |
validate_n_realizations(v)
classmethod
¶
Validate that number of realizations is positive.