Skip to content

Commit

Permalink
Fix failing tests. Need to remember that gal_t_table should use T_TAB…
Browse files Browse the repository at this point in the history
…LE_MIN and not T_BIRTH_MIN
  • Loading branch information
aphearin committed Nov 3, 2023
1 parent 12f526e commit f3001e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions dsps/sed/tests/test_csp_sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"""
import numpy as np
from jax import random as jran
from ..stellar_sed import calc_rest_sed_sfh_table_lognormal_mdf
from ..stellar_sed import calc_rest_sed_sfh_table_met_table
from ...constants import T_BIRTH_MIN

from ...constants import T_TABLE_MIN
from ..stellar_sed import (
calc_rest_sed_sfh_table_lognormal_mdf,
calc_rest_sed_sfh_table_met_table,
)

SEED = 43
FSPS_LG_AGES = np.arange(5.5, 10.2, 0.05) # log10 ages in years
Expand All @@ -15,7 +17,7 @@ def test_calc_rest_sed_lognormal_mdf():
ran_key = jran.PRNGKey(SEED)
t_obs = 13.0
n_t = 500
gal_t_table = np.linspace(T_BIRTH_MIN, t_obs, n_t)
gal_t_table = np.linspace(T_TABLE_MIN, t_obs, n_t)

sfr_key, met_key, sed_key = jran.split(ran_key, 3)
gal_sfr_table = jran.uniform(sfr_key, minval=0, maxval=10, shape=(n_t,))
Expand Down Expand Up @@ -63,7 +65,7 @@ def test_calc_rest_sed_lgmet_table():
ran_key = jran.PRNGKey(SEED)
t_obs = 13.0
n_t = 500
gal_t_table = np.linspace(T_BIRTH_MIN, t_obs, n_t)
gal_t_table = np.linspace(T_TABLE_MIN, t_obs, n_t)

sfr_key, met_key, sed_key = jran.split(ran_key, 3)
gal_sfr_table = jran.uniform(sfr_key, minval=0, maxval=10, shape=(n_t,))
Expand Down
12 changes: 7 additions & 5 deletions dsps/sed/tests/test_ssp_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"""
import numpy as np
from jax import random as jran
from ..ssp_weights import calc_ssp_weights_sfh_table_lognormal_mdf
from ..ssp_weights import calc_ssp_weights_sfh_table_met_table
from ...constants import T_BIRTH_MIN

from ...constants import T_TABLE_MIN
from ..ssp_weights import (
calc_ssp_weights_sfh_table_lognormal_mdf,
calc_ssp_weights_sfh_table_met_table,
)

SEED = 43
FSPS_LG_AGES = np.arange(5.5, 10.2, 0.05) # log10 ages in years
Expand All @@ -15,7 +17,7 @@ def test_calc_ssp_weights_lognormal_mdf():
ran_key = jran.PRNGKey(SEED)
t_obs = 13.0
n_t = 500
gal_t_table = np.linspace(T_BIRTH_MIN, t_obs, n_t)
gal_t_table = np.linspace(T_TABLE_MIN, t_obs, n_t)

sfr_key, met_key = jran.split(ran_key, 2)
gal_sfr_table = jran.uniform(sfr_key, minval=0, maxval=10, shape=(n_t,))
Expand Down Expand Up @@ -59,7 +61,7 @@ def test_calc_ssp_weights_met_table():
ran_key = jran.PRNGKey(SEED)
t_obs = 13.0
n_t = 500
gal_t_table = np.linspace(T_BIRTH_MIN, t_obs, n_t)
gal_t_table = np.linspace(T_TABLE_MIN, t_obs, n_t)

sfr_key, met_key = jran.split(ran_key, 2)
gal_sfr_table = jran.uniform(sfr_key, minval=0, maxval=10, shape=(n_t,))
Expand Down

0 comments on commit f3001e6

Please sign in to comment.