Skip to content

Commit

Permalink
Make _TableSourceWrapper a private class.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiffyclub committed Aug 5, 2014
1 parent 3c733d1 commit e0a90be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions urbansim/sim/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def clear_cached(self):
self.name))


class TableSourceWrapper(TableFuncWrapper):
class _TableSourceWrapper(TableFuncWrapper):
"""
Wraps a function that returns a DataFrame. After the function
is evaluated the returned DataFrame replaces the function in the
Expand Down Expand Up @@ -714,7 +714,7 @@ def _collect_injectables(names):
for name, thing in dicts.items():
if isinstance(thing, _InjectableFuncWrapper):
dicts[name] = thing()
elif isinstance(thing, TableSourceWrapper):
elif isinstance(thing, _TableSourceWrapper):
dicts[name] = thing.convert()

return dicts
Expand Down Expand Up @@ -787,10 +787,10 @@ def add_table_source(table_name, func):
Returns
-------
wrapped : `TableSourceWrapper`
wrapped : `_TableSourceWrapper`
"""
wrapped = TableSourceWrapper(table_name, func)
wrapped = _TableSourceWrapper(table_name, func)
logger.debug('registering table source {}'.format(table_name))
_TABLES[table_name] = wrapped
return wrapped
Expand Down Expand Up @@ -819,7 +819,7 @@ def get_table(table_name):
Returns
-------
table : `DataFrameWrapper`, `TableFuncWrapper`, or `TableSourceWrapper`
table : `DataFrameWrapper`, `TableFuncWrapper`, or `_TableSourceWrapper`
"""
if table_name in _TABLES:
Expand Down
4 changes: 2 additions & 2 deletions urbansim/sim/tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def source():
return df

table = sim.get_table('source')
assert isinstance(table, sim.TableSourceWrapper)
assert isinstance(table, sim._TableSourceWrapper)

test_df = table.to_frame()
pdt.assert_frame_equal(test_df, df)
Expand All @@ -497,7 +497,7 @@ def source():
return df

table = sim.get_table('source')
assert isinstance(table, sim.TableSourceWrapper)
assert isinstance(table, sim._TableSourceWrapper)

table = table.convert()
assert isinstance(table, sim.DataFrameWrapper)
Expand Down

0 comments on commit e0a90be

Please sign in to comment.