Skip to content

Commit

Permalink
Merge pull request #5 from UDST/cache_fix
Browse files Browse the repository at this point in the history
Enables setting cache=False in size variables
  • Loading branch information
jessicacamacho authored Feb 17, 2020
2 parents cecc3b9 + 99309b5 commit 4d2a57e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions variable_generators/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ def func():
return func


def make_size_var(agent, geog, geog_id, cache_scope='step', prefix_agent='total'):
def make_size_var(agent, geog, geog_id, cache=True, cache_scope='step', prefix_agent='total'):
"""
Generator function for size variables. Registers with orca.
"""
var_name = prefix_agent + '_' + agent

@orca.column(geog, var_name, cache=True, cache_scope=cache_scope)
@orca.column(geog, var_name, cache=cache, cache_scope=cache_scope)
def func():
agents = orca.get_table(agent)
print('Calculating number of {} for {}'.format(agent, geog))
Expand Down

0 comments on commit 4d2a57e

Please sign in to comment.