Skip to content

Python package for OpenEI EULP downloads#1300

Closed
cpaulgilman wants to merge 13 commits into
patchfrom
open_ei_load_data_patch
Closed

Python package for OpenEI EULP downloads#1300
cpaulgilman wants to merge 13 commits into
patchfrom
open_ei_load_data_patch

Conversation

@cpaulgilman

Copy link
Copy Markdown
Collaborator

Add Python package to SAM samples folder to provide a way for SAM users to get load data from OpenEI End User Load Profiles database to use in SAM.

Partially address #539

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change modifies variables in existing compute modules. Please see Checking for PySAM Incompatible API Changes.

Checklist:

If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Python modules with functions for downloading, plotting, and calculating statistics from the End Use Load Profile data on OpenEI.

Sample Python script with documentation to test modules.

Readme with general instructions.

This addresses #539 while we work with REopt and DGen teams on a process to identify a smaller set of representative buildings.
@cpaulgilman cpaulgilman added the requires help revision Requires a Help revision before releasing public version label Dec 9, 2022
@cpaulgilman cpaulgilman added this to the 2022.11.21 Patch 1 milestone Dec 9, 2022
@cpaulgilman cpaulgilman requested a review from brtietz December 9, 2022 23:45
@cpaulgilman cpaulgilman self-assigned this Dec 9, 2022

@brtietz brtietz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code looks well organized and well commented, but I got bogged down testing with missing dependencies. Please either add a complete list of dependencies to the README or add a conda environment yml file:

image

image

I'll take another run at testing once that's there.


* `stats`: Functions to calculate total and peak load values from the downloaded data.

To use the package, copy the `eulp` folder to the folder containing your Python script, and import the package with:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I always appreciate when packages explicitly state what they depend upon. I'm open to either a list in the README, or a conda yml file: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point. How about adding a requirements.txt file along with a list of required packages in the readme? See 74da475.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, I added two additional packages I needed to run it.

D = plot.clean_plot_data(df, bldg_id)
df = D['df_clean']

plot.plot_full_year(df.filter(items=['total']), bldg_id, 'Total Load') # total load over year

@brtietz brtietz Dec 12, 2022

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like having plots here, but can you add units? I think its kW, but having the explicit axis labels would be super helpful.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, thanks for pointing out that omission. I added a "kW" label to the y-axis for all plots.

Fix clean_plot() parameters in plot.py main() function.

@brtietz brtietz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding the requirements and labels! Ready to merge.

@brtietz

brtietz commented Jan 26, 2023

Copy link
Copy Markdown
Collaborator

@cpaulgilman The test failures look like they're due to a problem that's already been solved on patch. I think I might be able to fix it by cherry-picking the commits from 12/9 and 12/12 to a branch from the latest patch. Any objections to me closing this PR and trying that approach?

@brtietz brtietz mentioned this pull request Jan 26, 2023
@brtietz

brtietz commented Jan 26, 2023

Copy link
Copy Markdown
Collaborator

I've moved the commits that aren't merge commits to #1331. Fingers crossed that the tests pass, closing this with a sense of optimism.

@brtietz brtietz closed this Jan 26, 2023
@cpaulgilman cpaulgilman removed the requires help revision Requires a Help revision before releasing public version label Feb 16, 2023
@cpaulgilman cpaulgilman deleted the open_ei_load_data_patch branch October 3, 2023 16:55
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.

2 participants