Skip to content

Commit caf8923

Browse files
committed
add args for gradients
1 parent dd70577 commit caf8923

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

ogcore/demographics.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,11 @@ def get_pop_objs(
684684
imm_rates=None,
685685
infer_pop=False,
686686
pop_dist=None,
687+
fert_gradient=None,
688+
mort_gradient=None,
689+
infmort_gradient=None,
690+
imm_gradient=None,
691+
income_percentiles=None,
687692
country_id=UN_COUNTRY_CODE,
688693
initial_data_year=START_YEAR - 1,
689694
final_data_year=START_YEAR + 2,
@@ -714,6 +719,20 @@ def get_pop_objs(
714719
infer_pop (bool): =True if want to infer the population
715720
pop_dist (array_like): user provided population distribution,
716721
dimensions are T0+1 x E+S
722+
fert_gradient (array_like): user provided fertility rate gradient,
723+
dimensions are S, represents the pp change in the fertility rate
724+
per percentile of the lifetime income distribution.
725+
mort_gradient (array_like): user provided mortality rate gradient,
726+
dimensions are S, represents the pp change in the mortality rate
727+
per percentile of the lifetime income distribution.
728+
infmort_gradient (array_like): user provided infant mortality rate gradient,
729+
dimensions are S, represents the pp change in the infant mortality rate
730+
per percentile of the lifetime income distribution.
731+
imm_gradient (array_like): user provided immigration rate gradient,
732+
dimensions are S, represents the pp change in the immigration rate
733+
per percentile of the lifetime income distribution.
734+
income_percentiles (array_like): user provided income percentiles,
735+
dimensions are J, the number of lifetime income groups
717736
country_id (str): country id for UN data
718737
initial_data_year (int): initial year of data to use
719738
(not relevant if have user provided data)
@@ -755,6 +774,8 @@ def get_pop_objs(
755774
", Final Data year = ",
756775
final_data_year,
757776
)
777+
if income_percentiles is not None:
778+
J = len(income_percentiles)
758779
assert E + S <= max_age - min_age + 1
759780
assert initial_data_year >= 2012 and initial_data_year <= 2100 - 1
760781
assert final_data_year >= 2012 and final_data_year <= 2100 - 1

0 commit comments

Comments
 (0)