@@ -974,8 +974,8 @@ def fill_priors(
974
974
datable_nodes [ts .samples ()] = False
975
975
datable_nodes = np .where (datable_nodes )[0 ]
976
976
977
- rescaled_timepoints = util .rescale_time_by_population_size (
978
- timepoints , population_size
977
+ rescaled_timepoints , _ , _ = util .change_time_measure (
978
+ timepoints , population_size [:, 0 ], 1 / ( 2 * population_size [:, 1 ])
979
979
)
980
980
981
981
prior_times = base .NodeGridValues (
@@ -1050,27 +1050,21 @@ def build_grid(
1050
1050
)
1051
1051
if population_size .shape [1 ] != 2 :
1052
1052
raise ValueError (
1053
- "'population_size' array must have two columns that contain \
1053
+ "Population size array must have two columns that contain \
1054
1054
epoch start times and population sizes, respectively"
1055
1055
)
1056
1056
if np .any (population_size [:, 0 ] < 0.0 ):
1057
- raise ValueError (
1058
- "Epoch start times in 'population_size' array must be nonnegative"
1059
- )
1057
+ raise ValueError ("Epoch start times must be nonnegative" )
1060
1058
if np .any (population_size [:, 1 ] <= 0.0 ):
1061
- raise ValueError (
1062
- "Population sizes in 'population_size' array must be positive "
1063
- )
1059
+ raise ValueError ("Population sizes must be positive " )
1064
1060
if population_size [0 , 0 ] != 0 :
1065
- raise ValueError (
1066
- "The first epoch in 'population_size' array must start at time 0"
1067
- )
1061
+ raise ValueError ("The first epoch must start at time 0" )
1068
1062
if not np .all (np .diff (population_size [:, 0 ]) > 0 ):
1069
- raise ValueError (
1070
- "Epoch start times 'population_size' array must be unique and increasing"
1071
- )
1072
- elif population_size <= 0 :
1073
- raise ValueError ( "Scalar ' population_size' must be greater than 0" )
1063
+ raise ValueError ("Epoch start times must be unique and increasing" )
1064
+ else :
1065
+ if population_size <= 0 :
1066
+ raise ValueError ( "Scalar ' population_size' must be greater than 0" )
1067
+ population_size = np . array ([[ 0 , population_size ]], dtype = float )
1074
1068
if approximate_priors :
1075
1069
if not approx_prior_size :
1076
1070
approx_prior_size = 1000
0 commit comments