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
I would like to change this to np.clip(rate, -np.inf, 250.0), so that it works with scalars, but I thought I'd see if anyone sees a risk in this before making a PR.
The text was updated successfully, but these errors were encountered:
Here is a code snippet that shows where I ran into the issue
def on_time_step(self, event):
population = self.population_view.get(
event.index, query='alive == "alive" and sex =="Female" and age >= 15 and age < 45'
)
had_children = self.randomness.filter_for_rate(population, (2.5/30/365) # FIXME: float does not work here
Here is a notebook that puts this in context. Cell 6 shows how this fails, and Cell 7 shows a simple work-around.
I tried using a float for a simple example and found that the rate variable uses
rate[rate>250]
pattern now:vivarium/src/vivarium/framework/utilities.py
Line 29 in 262c48b
I would like to change this to
np.clip(rate, -np.inf, 250.0)
, so that it works with scalars, but I thought I'd see if anyone sees a risk in this before making a PR.The text was updated successfully, but these errors were encountered: