It's been since early May when I last ran OG-USA:master successfully. Since that time I have updated from Python 2.7 to 3.6. But when running OG-USA I am activating the ospcdyn environment.
This morning, I attempted to run run_ogusa_serial.py again so that I can help someone new to the project. My runs failed.
In run_ogusa_serial.py, my arguments are:
output_base = BASELINE_DIR
input_dir = BASELINE_DIR
kwargs={'output_base':output_base, 'baseline_dir':BASELINE_DIR,
'test':False, 'time_path':True, 'baseline':True,
'analytical_mtrs':False, 'age_specific':True,
'user_params':user_params,'guid':'',
'run_micro':False, 'small_open': False, 'budget_balance':False,
'baseline_spending':False}
runner(**kwargs)
First, I got the error:
Traceback (most recent call last):
File "run_ogusa_serial.py", line 126, in <module>
run_micro_macro(user_params={})
File "run_ogusa_serial.py", line 85, in run_micro_macro
runner(**kwargs)
File "/Users/jason.debacker/repos/dynamic/Python/ogusa/scripts/execute.py", line 50, in runner
run_params = ogusa.parameters.get_parameters(test=test, baseline=baseline, guid=guid)
File "/Users/jason.debacker/repos/dynamic/Python/ogusa/parameters.py", line 452, in get_parameters
flag_graphs)
File "/Users/jason.debacker/repos/dynamic/Python/ogusa/demographics.py", line 699, in get_pop_objs
graph=False)
File "/Users/jason.debacker/repos/dynamic/Python/ogusa/demographics.py", line 287, in get_mort
mort_rates_sub = np.zeros(num_sub_bins * max_yr, dtype=np.float64)
TypeError: 'float' object cannot be interpreted as an index
I fixed this by changing line 284 of demographics.py from
num_sub_bins = float(100)
to
num_sub_bins = int(100)
This allowed me to get to SS solution algorithm. This had been quite robust, but I find that the root finders (mostly scipy. optimize.fsolve) are often hitting the constraints for the variables and eventually nan's are returned and the SS solution fails.
@rickecon and @PeterDSteinberg Can you confirm this behavior?
Before fixing, I'd like to have some idea what caused the code to break.
It's been since early May when I last ran OG-USA:master successfully. Since that time I have updated from Python 2.7 to 3.6. But when running OG-USA I am activating the
ospcdynenvironment.This morning, I attempted to run
run_ogusa_serial.pyagain so that I can help someone new to the project. My runs failed.In
run_ogusa_serial.py, my arguments are:First, I got the error:
I fixed this by changing line 284 of
demographics.pyfromnum_sub_bins = float(100)to
num_sub_bins = int(100)This allowed me to get to SS solution algorithm. This had been quite robust, but I find that the root finders (mostly
scipy. optimize.fsolve) are often hitting the constraints for the variables and eventuallynan's are returned and the SS solution fails.@rickecon and @PeterDSteinberg Can you confirm this behavior?
Before fixing, I'd like to have some idea what caused the code to break.