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

Update to OS v3.2.1 #240

Merged
merged 7 commits into from Aug 16, 2021
Merged

Update to OS v3.2.1 #240

merged 7 commits into from Aug 16, 2021

Conversation

joseph-robertson
Copy link
Contributor

@joseph-robertson joseph-robertson commented Jul 29, 2021

Pull Request Description

Companion PR: NREL/resstock#661 (ServerDirectoryCleanup updates).

This PR is necessary to work with resstock develop.

By setting skip_zip_results=True in the workflow generator, each datapoint's run directory contains all simulation files and they aren't contained in a data_point.zip. Also, the size of simulations_job0.tar.gz actually decreases.

BEFORE
image

image

image

AFTER
image

image

Checklist

Not all may apply

  • Code changes (must work)
  • Tests exercising your feature/bug fix (check coverage report on CircleCI build -> Artifacts)
  • All other unit tests passing
  • Update validation for project config yaml file changes
  • Update existing documentation
  • Run a small batch run to make sure it all works (local is fine, unless an Eagle specific feature)
  • Add to the changelog_dev.rst file and propose migration text in the pull request

@joseph-robertson joseph-robertson self-assigned this Jul 29, 2021
@nmerket
Copy link
Member

nmerket commented Jul 29, 2021

This is good. With the data_point.zip now gone, I was worried this code would break:

# Remove files already in data_point.zip
zipfilename = os.path.join(sim_dir, 'run', 'data_point.zip')
if os.path.isfile(zipfilename):
with zipfile.ZipFile(zipfilename, 'r') as zf:
for filename in zf.namelist():
for filepath in (os.path.join(sim_dir, 'run', filename), os.path.join(sim_dir, filename)):
if os.path.exists(filepath):
os.remove(filepath)

It was looks in data_point.zip and removes things from the directory that are already in there. But if data_point.zip isn't there it skips that block, so I guess it's not hurting anything. I'm not sure what's going on in ComStock so maybe we leave it for now.

In general, I'd say just go through that cleanup function to make sure it's still relevant with the organization of the files being written with your update.

@joseph-robertson
Copy link
Contributor Author

@nmerket I've updated the residential workflow generator to write argument values for ServerDirectoryCleanup. I'm not sure what else needs to be updated (e.g., pretty sure validation will now fail if server_directory_cleanup is found in a project yml file).

Copy link
Member

@nmerket nmerket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joseph-robertson This seems pretty straightforward and I like what you're doing with the server directory cleanup. You're right in that it will throw an error if that argument is there even though you're expecting it. That's easy enough to fix, though. Just add some yaml schema stuff here to tell it what to expect. It's even in the same file.

schema_yml = """
measures_to_ignore: list(str(), required=False)
residential_simulation_controls: map(required=False)
measures: list(include('measure-spec'), required=False)
reporting_measures: list(include('measure-spec'), required=False)
simulation_output: map(required=False)
timeseries_csv_export: map(required=False)
---
measure-spec:
measure_dir_name: str(required=True)
arguments: map(required=False)
"""

I haven't tried running it, but it sounds like @munank has and it worked for him, so that's pretty good.

A few things to update:

  • The residential workflow generator schema as mentioned above.
  • Documentation for the residential workflow generator to document the schema changes.
  • Changelog entry

@joseph-robertson
Copy link
Contributor Author

@nmerket Anything else that needs to be done here?

@asparke2
Copy link
Member

@joseph-robertson I think this is fine as-is and we can fix up the ComStock server directory cleanup as necessary. One thing to be aware of is that it won't work if custom_gems = True. I don't think you use that for ResStock, so probably not a big deal. This branch has additional changes to accommodate custom_gems with OS 3.x, but not going to worry about that until FY22.

@nmerket
Copy link
Member

nmerket commented Aug 16, 2021

Looks good to me. You okay if I merge then?

@joseph-robertson
Copy link
Contributor Author

Let me get review on NREL/resstock#661 and then I'll let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants