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

Formatting and refactoring #110

Merged
merged 4 commits into from
Oct 1, 2020
Merged

Formatting and refactoring #110

merged 4 commits into from
Oct 1, 2020

Conversation

jenhagg
Copy link
Collaborator

@jenhagg jenhagg commented Oct 1, 2020

Purpose

Did some preliminary cleanup that can be reviewed separately from library changes. Fix docstring indentation, powersimdata imports, and refactor how we create the NREL url for downloading data.

What it does

Mostly described above, plus changing to https since I was getting errors when running the notebook. Also updated the setup.py, which adds the solar data file since I needed it for the notebook.

Time to review

5 min - I tested the url refactoring manually, and was using it in my other branch where it works successfully

@jenhagg jenhagg requested a review from rouille October 1, 2020 19:56
@jenhagg jenhagg self-assigned this Oct 1, 2020
@jenhagg jenhagg added this to the Welcome Drizzle milestone Oct 1, 2020
@@ -1,7 +1,7 @@
import os

import pandas as pd
from powersimdata.network.usa_tamu.constants.zones import id2state
from powersimdata.network.usa_tamu.constants.zones import id2abv
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can use from powersimdata.network.usa_tamu.constants.zones import abv

@@ -47,7 +46,7 @@ def get_pv_tracking_ratio_state(pv_info, state):
raise TypeError("state must be a list")

for s in state:
if s not in set(id2state.values()):
if s not in set(id2abv.values()):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Then if s not in abv

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We seem to be switching from state to state abbreviation, is that ok?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It was always abbreviation. The variable name was poorly chosen

Copy link
Collaborator

@rouille rouille left a comment

Choose a reason for hiding this comment

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

Looks great. I also reformatted the docstring in demanddata

@jenhagg jenhagg merged commit 7561e43 into develop Oct 1, 2020
@jenhagg jenhagg deleted the jon/pysam branch October 1, 2020 21:28
@ahurli ahurli mentioned this pull request Mar 16, 2021
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