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
If inputs to demographics are provided as integers, like ASFR to Pregnancy, we get the following error due to divide: np.divide(num_to_make, new_denom, where=new_denom>0, out=new_rate)
Exception has occurred: _UFuncOutputCastingError
Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
File "/Users/dklein/GIT/starsim/starsim/demographics.py", line 350, in make_fertility_prob_fn
np.divide(num_to_make, new_denom, where=new_denom>0, out=new_rate)
File "/Users/dklein/GIT/starsim/starsim/distributions.py", line 512, in convert_callable
out = val(self.module, self.sim, size_par)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/distributions.py", line 1049, in call_par
val = self.convert_callable(key, val, size, uids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/distributions.py", line 535, in call_pars
val = self.call_par(key, val, size, uids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/distributions.py", line 495, in process_pars
self.call_pars() # Convert from function to values if needed
^^^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/distributions.py", line 614, in rvs
self.process_pars()
File "/Users/dklein/GIT/starsim/starsim/distributions.py", line 1025, in filter
bools = self.rvs(uids)
^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/demographics.py", line 474, in make_pregnancies
conceive_uids = self.pars.p_fertility.filter(eligible_uids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/demographics.py", line 417, in do_step
conceive_uids = self.make_pregnancies()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/demographics.py", line 411, in step
new_uids = self.do_step()
^^^^^^^^^^^^^^
File "/Users/dklein/GIT/starsim/starsim/loop.py", line 192, in run
f() # Execute the function -- this is where all of Starsim happens!!
^^^
File "/Users/dklein/GIT/starsim/starsim/sim.py", line 297, in run
self.loop.run(until)
File "/Users/dklein/GIT/UWEpi554-ABM/demographics.py", line 42, in<module>sim.run()
numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
The text was updated successfully, but these errors were encountered:
If inputs to demographics are provided as integers, like ASFR to
Pregnancy
, we get the following error due to divide:np.divide(num_to_make, new_denom, where=new_denom>0, out=new_rate)
The text was updated successfully, but these errors were encountered: