Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure all_ts_cols is always a set #263

Merged
merged 2 commits into from Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildstockbatch/postprocessing.py
Expand Up @@ -201,7 +201,7 @@ def clean_up_results_df(df, cfg, keep_upgrade_id=False):
def get_cols(fs, filename):
with fs.open(filename, 'rb') as f:
schema = parquet.read_schema(f)
return schema.names
return set(schema.names)


def read_results_json(fs, filename):
Expand Down Expand Up @@ -271,7 +271,7 @@ def combine_results(fs, results_dir, cfg, do_timeseries=True):
logger.info("Collecting all the columns in timeseries parquet files.")
ts_filenames = fs.glob(f'{ts_in_dir}/up*/bldg*.parquet')
all_ts_cols = db.from_sequence(ts_filenames, partition_size=100).map(partial(get_cols, fs)).\
fold(lambda x, y: set(x).union(y)).compute()
fold(lambda x, y: x.union(y)).compute()

# Sort the columns
all_ts_cols_sorted = ['building_id'] + sorted(x for x in all_ts_cols if x.startswith('time'))
Expand Down
14 changes: 14 additions & 0 deletions docs/changelog/changelog_dev.rst
Expand Up @@ -65,3 +65,17 @@ Development Changelog
:tickets:

For ResStock the OpenStudio version has changed to v3.3.0.

.. change::
:tags: bugfix
:pullreq: 258, 262
:tickets: 253

Fixes an issue that caused out of memory error when postprocessing large run with many upgrades.

.. change::
:tags: bugfix
:pullreq: 263
:tickets: 261

Fixes a bug that caused postprocessing to crash when there is only one datapoint.