From 8eb480752621ce11bf95e9a60665a15aa2a808da Mon Sep 17 00:00:00 2001 From: jdebacker Date: Fri, 16 Feb 2024 07:30:00 -0500 Subject: [PATCH] add assertion to ensure infer_pop is true if pass custom imm rates --- ogcore/demographics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ogcore/demographics.py b/ogcore/demographics.py index 0581daf57..a6017e3e0 100644 --- a/ogcore/demographics.py +++ b/ogcore/demographics.py @@ -671,7 +671,9 @@ def get_pop_objs( assert final_data_year < initial_data_year + T assert ( T > 2 * T0 - ) # ensure time path 2x as long as allows rates to fluctuate + ) # ensure time path 2x as long as allows rates to fluctuate + if imm_rates is not None: + assert infer_pop is True # if pass immigration rates, need to infer population # Get fertility rates if not provided if fert_rates is None: