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 reference tables #394

Draft
wants to merge 4 commits into
base: development
Choose a base branch
from
Draft

Update reference tables #394

wants to merge 4 commits into from

Conversation

rouille
Copy link
Collaborator

@rouille rouille commented Nov 19, 2024

Purpose

Update reference tables. Also, fix the notebook used to manually update the BA reference table.

What the code is doing

Regarding the notebook used to update the BA reference table, I did not have the "Allowable Entries for Balancing Authorities and Hubs" file from FERC so I could not run the notebook. After downloading the file, I preprocessed it and refactor the notebook to be able to updated the existing BA reference table. Existing and updated file are identical as the FERC data have not changed since last release.

Testing

Ran the notebook and then:

>>> import pandas as pd
>>> ba_reference = (
...     pd.read_csv("../../src/oge/reference_tables/ba_reference.csv")
...     .sort_values(by=["ba_code"])
... )
>>> ba_reference
    ba_code                                         ba_name      ba_category  ... retirement_date_ferc      source ba_number
0      AEBN                                AESC, LLC - AEBN              NaN  ...                  NaN        FERC         1
1       AEC                   PowerSouth Energy Cooperative              NaN  ...                  NaN  EIA & FERC         2
2      AECI           Associated Electric Cooperative, Inc.              NaN  ...                  NaN  EIA & FERC         3
3      AEGL                             AESC, LLC - Gleason              NaN  ...                  NaN        FERC         4
4      AELC                      AESC, LLC - Lincoln Center              NaN  ...                  NaN        FERC         5
..      ...                                             ...              ...  ...                  ...         ...       ...
206     WPS            Wisconsin Public Service Corporation              NaN  ...                  NaN        FERC       207
207      WR             Western Resources dba Westar Energy              NaN  ...                  NaN        FERC       208
208     WWA                       NaturEner Wind Watch, LLC  generation_only  ...                  NaN  EIA & FERC       209
209     YAD  Alcoa Power Generating, Inc. - Yadkin Division  generation_only  ...                  NaN  EIA & FERC       210
239     NaN                          No Balancing Authority    miscellaneous  ...                  NaN         NaN       999

[240 rows x 13 columns]
>>> ba_reference_updated = pd.read_csv(
...     "../../src/oge/reference_tables/ba_reference.csv"
... ).sort_values(by=["ba_code"])[ba_reference.columns]
ba_reference_updated>>> ba_reference_updated
    ba_code                                         ba_name      ba_category  ... retirement_date_ferc      source ba_number
0      AEBN                                AESC, LLC - AEBN              NaN  ...                  NaN        FERC         1
1       AEC                   PowerSouth Energy Cooperative              NaN  ...                  NaN  EIA & FERC         2
2      AECI           Associated Electric Cooperative, Inc.              NaN  ...                  NaN  EIA & FERC         3
3      AEGL                             AESC, LLC - Gleason              NaN  ...                  NaN        FERC         4
4      AELC                      AESC, LLC - Lincoln Center              NaN  ...                  NaN        FERC         5
..      ...                                             ...              ...  ...                  ...         ...       ...
206     WPS            Wisconsin Public Service Corporation              NaN  ...                  NaN        FERC       207
207      WR             Western Resources dba Westar Energy              NaN  ...                  NaN        FERC       208
208     WWA                       NaturEner Wind Watch, LLC  generation_only  ...                  NaN  EIA & FERC       209
209     YAD  Alcoa Power Generating, Inc. - Yadkin Division  generation_only  ...                  NaN  EIA & FERC       210
239     NaN                          No Balancing Authority    miscellaneous  ...                  NaN         NaN       999

[240 rows x 13 columns]
>>> ba_reference.equals(ba_reference_updated)
True 

Where to look

  • In the ba_reference.csv file, several retirement dates have been updated using the EIA list of Balancing Authorities
  • In the notebook used to update the BA reference table, add documentation and code to guide the user to process the FERC data before merging it to the existing BA reference table.
  • Add one entry and delete 2 existing entries in eGRID_crosswalk_of_EIA_ID_to_EPA_ID.csv

Usage Example/Visuals

N/A

Review estimate

10min

Future work

Clear outputs of notebook after review

Checklist

  • Update the documentation to reflect changes made in this PR
  • Format all updated python files using ruff
  • Clear outputs from all notebooks modified
  • Add docstrings and type hints to any new functions created

@rouille rouille self-assigned this Nov 19, 2024
@rouille rouille changed the title Update BA reference table Update reference tables Nov 19, 2024
@rouille rouille marked this pull request as draft November 19, 2024 01:23
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.

1 participant