Skip to content

Commit

Permalink
final bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grgmiller committed Nov 28, 2024
1 parent 134f3c0 commit 4f1fc4b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion notebooks/work_in_progress/sandbox.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"\n",
"import oge.download_data as download_data\n",
"import oge.load_data as load_data\n",
"from oge.column_checks import get_dtypes, apply_dtypes\n",
"from oge.column_checks import get_dtypes, apply_dtypes, DATA_COLUMNS\n",
"from oge.filepaths import *\n",
"import oge.impute_hourly_profiles as impute_hourly_profiles\n",
"import oge.data_cleaning as data_cleaning\n",
Expand Down
2 changes: 2 additions & 0 deletions src/oge/consumed.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ def _load_rates(self):
for f in os.listdir(
results_folder(f"{self.prefix}/power_sector_data/hourly/us_units/")
):
# TODO: delete this message, for testing
logger.info(f"Loading {f}")
if ".DS_Store" in f:
continue
this_ba = pd.read_csv(
Expand Down
14 changes: 0 additions & 14 deletions src/oge/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,20 +440,6 @@ def combine_subplant_data(
copy=False,
)

# to save memory, delete any rows where all of the data columns are zero
combined_subplant_data = combined_subplant_data[
combined_subplant_data[DATA_COLUMNS].sum(axis=1) != 0
]

# groupby subplant after combining in case subplant reported multiple places
combined_subplant_data = (
combined_subplant_data.groupby(KEY_COLUMNS, dropna=False, sort=False)[
DATA_COLUMNS
]
.sum(numeric_only=True)
.reset_index()
)

# re-order the columns
combined_subplant_data = combined_subplant_data[ALL_COLUMNS]

Expand Down

0 comments on commit 4f1fc4b

Please sign in to comment.