You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
loop.collect_abs_tvecs() function shouldn't be mixing hardcoded strings with dynamic class name strings!
PROPOSED FIX BY Romesh:
I would guess this is because in loop.py it has around line 136
sim = self.sim
for key in ['sim', 'people']:
self.abs_tvecs[key] = sim.t.tvec
which assigns based on string 'people' but the functions are being registered under the actual class name, which is 'cattle'. You could maybe try replacing that snippet above with
I found this issue when trying to create a Cattle object derived from People:
odict key "cattle" not found; available keys are:
sim
people
deaths
births
cattlenetwork
rvf
routineelisatest
elisatest
KeyError: 'cattle'
During handling of the above exception, another exception occurred:
File "/Users/mine/git/starsim/starsim/loop.py", line 152, in make_plan
for t in self.abs_tvecs[func_row['module']]:
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/Users/mine/git/starsim/starsim/loop.py", line 36, in init
self.make_plan()
File "/Users/mine/git/starsim/starsim/sim.py", line 150, in init
self.loop.init() # Initialize the integration loop
^^^^^^^^^^^^^^^^
File "/Users/mine/git/rvf/scripts/run_simulation.py", line 70, in <module>
base_sim.init()
sciris.sc_utils.KeyNotFoundError: odict key "cattle" not found; available keys are:
sim
people
deaths
births
cattlenetwork
rvf
routineelisatest
elisatest
It fails during the simulation initialization (triggered automatically by sim.run() ), specifically it fails during the loop.make_plan() function, as it seems like whatever action that ensures that certain modules are part of the odict from which this for loop is reading the keys, doesn't contain cattle (the special version of people).
Any ideas what could be missing - at first glance it seems like I am either missing a function to ben added to the cattle object or is just purely not supported by the latest starsim.
(As context: a monolithic version of this project built with starsim 0.4.0 was handling it just fine).
The text was updated successfully, but these errors were encountered:
Issue:
loop.collect_abs_tvecs()
function shouldn't be mixing hardcoded strings with dynamic class name strings!PROPOSED FIX BY Romesh:
I would guess this is because in loop.py it has around line 136
which assigns based on string 'people' but the functions are being registered under the actual class name, which is 'cattle'. You could maybe try replacing that snippet above with
Context
I found this issue when trying to create a Cattle object derived from People:
It fails during the simulation initialization (triggered automatically by sim.run() ), specifically it fails during the loop.make_plan() function, as it seems like whatever action that ensures that certain modules are part of the odict from which this for loop is reading the keys, doesn't contain cattle (the special version of people).
Any ideas what could be missing - at first glance it seems like I am either missing a function to ben added to the cattle object or is just purely not supported by the latest starsim.
(As context: a monolithic version of this project built with starsim 0.4.0 was handling it just fine).
The text was updated successfully, but these errors were encountered: