Skip to content

Commit 87b45e9

Browse files
author
Blake Rosenthal
committed
Allow inject.add_table to replace existing
1 parent 367d414 commit 87b45e9

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

activitysim/core/inject.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ def add_step(name, func):
8484
return orca.add_step(name, func)
8585

8686

87-
def add_table(table_name, table):
88-
89-
if orca.is_table(table_name) and orca.table_type(table_name) == 'dataframe':
87+
def add_table(table_name, table, replace=False):
88+
"""
89+
Add new table and raise assertion error if the table already exists.
90+
Silently replace if replace=True.
91+
"""
92+
if not replace and orca.is_table(table_name) and orca.table_type(table_name) == 'dataframe':
9093
logger.warning("inject add_table replacing existing table %s" % table_name)
9194
assert False
9295

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='activitysim',
8-
version='0.9',
8+
version='0.9.1',
99
description='Activity-Based Travel Modeling',
1010
author='contributing authors',
1111
author_email='ben.stabler@rsginc.com',

0 commit comments

Comments
 (0)