Skip to content

Commit

Permalink
don't chunk links
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Rosenthal committed Oct 25, 2019
1 parent 73d0f47 commit d966fbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 0 additions & 2 deletions bca4abm/bca4abm.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ def read_assignment_spec(fname):
# generator for chunked iteration over dataframe by chunk_size
def chunked_df(df, rows_per_chunk, trace_rows=None):

logger.debug("rows_per_chunk ", rows_per_chunk)

assert df.shape[0] > 0

# generator to iterate over choosers in chunk_size chunks
Expand Down
15 changes: 4 additions & 11 deletions bca4abm/processors/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def add_tables_to_locals(data_dir, model_settings, locals_dict):

def eval_link_spec(link_spec, link_file_names, data_dir,
link_file_column_map, link_index_fields,
model_settings, chunk_size, trace_tag=None, trace_od=None):
model_settings, trace_tag=None, trace_od=None):

# accept a single string as well as a dict of {suffix: filename}
if isinstance(link_file_names, str):
Expand Down Expand Up @@ -144,7 +144,6 @@ def eval_link_spec(link_spec, link_file_names, data_dir,
links_df,
locals_dict,
df_alias='links',
chunk_size=chunk_size,
trace_rows=trace_rows)

results[scenario] = summary
Expand All @@ -171,9 +170,7 @@ def eval_link_spec(link_spec, link_file_names, data_dir,


@inject.step()
def link_processor(
link_spec,
chunk_size, data_dir):
def link_processor(link_spec, data_dir):

trace_label = 'link'
model_settings = config.read_model_settings('link.yaml')
Expand All @@ -191,8 +188,7 @@ def link_processor(
data_dir,
model_settings.get('link_table_column_map', None),
link_index_fields,
model_settings=model_settings,
chunk_size=chunk_size)
model_settings=model_settings)

assigned_column_names = row_results.columns.values
row_results.insert(loc=0, column='description', value=row.description)
Expand All @@ -210,9 +206,7 @@ def link_processor(


@inject.step()
def link_daily_processor(
link_daily_spec,
chunk_size, data_dir, trace_od):
def link_daily_processor(link_daily_spec, data_dir, trace_od):

trace_label = 'link_daily'
model_settings = config.read_model_settings('link_daily.yaml')
Expand All @@ -230,7 +224,6 @@ def link_daily_processor(
model_settings.get('link_daily_table_column_map', None),
model_settings.get('link_daily_index_fields', None),
model_settings=model_settings,
chunk_size=chunk_size,
trace_tag=trace_label,
trace_od=trace_od)

Expand Down

0 comments on commit d966fbf

Please sign in to comment.