Skip to content

Commit

Permalink
Don't attempt to do any births and deaths in c version yet, not even …
Browse files Browse the repository at this point in the history
…pass through to working numpy code.
  • Loading branch information
Jonathan Bloedow committed Jan 19, 2024
1 parent d4f8bcf commit 4fa9a08
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sql_modeling/src/sir_numpy_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,18 @@ def update_ages_c( ages ):
update_ages_lib.update_ages(len(ages), ages)
return ages

data['age'] = update_ages_c( data['age'] )
#data['age'] = update_ages_c( data['age'] )
import sir_numpy
#data = sir_numpy.births( data )
#data = sir_numpy.deaths( data )
return data
#return update_births_deaths( data )

def update_births_deaths( data ):
# Births
# Calculate number of women of child-bearing age: constant across nodes
# Add new babies as percentage of that.
# TBD NOT IMPLEMENTED YET
update_ages_lib.update_ages(len(ages), ages)
# Non-disease deaths
return data
Expand Down Expand Up @@ -204,6 +209,7 @@ def handle_new_infections_c(new_infections):

def handle_transmission( data_in, new_infections_in ):
# We want to do this in parallel;
print( f"DEBUG: New Infections: {new_infections_in}" )
htbn = partial( handle_transmission_by_node, data_in, new_infections_in )
with concurrent.futures.ThreadPoolExecutor() as executor:
results = list(executor.map(htbn, settings.nodes))
Expand Down

0 comments on commit 4fa9a08

Please sign in to comment.