diff --git a/dsps/metallicity/tests/test_umzr.py b/dsps/metallicity/tests/test_umzr.py index c1af356..909d229 100644 --- a/dsps/metallicity/tests/test_umzr.py +++ b/dsps/metallicity/tests/test_umzr.py @@ -1,5 +1,4 @@ -""" -""" +""" """ import numpy as np from jax import random as jran @@ -101,3 +100,14 @@ def test_default_umzr_params(): gen = zip(umzr.DEFAULT_MZR_U_PARAMS, umzr.DEFAULT_MZR_U_PARAMS._fields) for u_param, key in gen: assert np.all(np.isfinite(u_param)), f"Parameter `{key}` is NaN" + + +def test_default_values_within_bounds(): + values = umzr.DEFAULT_MZR_PARAMS._asdict() + bounds = umzr.MZR_PBOUNDS._asdict() + + assert len(values) == len(bounds) + + for param_name, val in values.items(): + low, high = bounds[param_name] + assert low <= val <= high diff --git a/dsps/metallicity/umzr.py b/dsps/metallicity/umzr.py index e75dbce..1450c4e 100644 --- a/dsps/metallicity/umzr.py +++ b/dsps/metallicity/umzr.py @@ -1,5 +1,4 @@ -"""Mass-metallicity-redshift scaling relation with unbounding behavior -""" +"""Mass-metallicity-redshift scaling relation with unbounding behavior""" from collections import OrderedDict, namedtuple @@ -67,6 +66,7 @@ MZRUParams = namedtuple("MZRUParams", _MZR_UPNAMES) DEFAULT_MZR_PARAMS = MZRParams(**DEFAULT_MZR_PDICT) +MZR_PBOUNDS = MZRParams(**MZR_PBDICT) def get_ran_t0_params(ran_key, bounds_pdict=MZR_T0_PBDICT):