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

Clean up tox file and fix warnings #334

Merged
merged 2 commits into from
Mar 29, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion postreise/analyze/demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_demand_time_series(scenario, area, area_type=None):
)
loadzone_id_set = {grid.zone2id[lz] for lz in loadzone_set if lz in grid.zone2id}

return scenario.state.get_demand()[loadzone_id_set].sum(axis=1)
return scenario.state.get_demand()[list(loadzone_id_set)].sum(axis=1)


def get_net_demand_time_series(scenario, area, area_type=None):
Expand Down
14 changes: 8 additions & 6 deletions postreise/analyze/generation/curtailment.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ def calculate_curtailment_time_series(scenario):
grid = scenario.state.get_grid()
pg = scenario.state.get_pg()

plant_id = get_plant_id_for_resources(
grid.model_immutables.plants["renewable_resources"].intersection(
set(grid.plant.type)
),
grid,
plant_id = list(
get_plant_id_for_resources(
grid.model_immutables.plants["renewable_resources"].intersection(
set(grid.plant.type)
),
grid,
)
)
profiles = pd.concat(
[scenario.state.get_solar(), scenario.state.get_wind()], axis=1
Expand Down Expand Up @@ -120,7 +122,7 @@ def calculate_curtailment_percentage_by_resources(scenario, resources=None):

curtailment_percentage = (
sum(v for v in total_curtailment.values())
/ total_potential.loc[resources].sum()
/ total_potential.loc[list(resources)].sum()
)

return curtailment_percentage
Expand Down
2 changes: 1 addition & 1 deletion postreise/analyze/generation/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _groupby_state(index: str) -> str:
result.loc["Texas interconnection"] = ercot
result.loc["All"] = all

result = result.loc[:, filtered_colnames]
result = result.loc[:, list(filtered_colnames)]
result.rename(columns=mi.plants["type2label"], inplace=True)

return result
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ envlist = pytest, format, flake8
skipsdist = true

[testenv]
passenv =
CPPFLAGS
LDFLAGS
deps =
pytest: pipenv
{format,checkformatting}: black
Expand Down