Fix timezone inconsistencies in data shaping - #440
Merged
Merged
Conversation
grgmiller
force-pushed
the
complete_hourly
branch
from
August 7, 2026 19:00
2a61aa6 to
cf42b9e
Compare
grgmiller
marked this pull request as ready for review
August 9, 2026 00:38
sarahchute
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pipeline was raising warnings that certain plant-level and BA-level outputs had slightly more or less than 8760 timestamps in a year. It turns out that this was caused by a pervasive bug related to timezone mismatches in various hourly shaping and data aggregation processes.
Closes #326
Closes DAT-521
Plant-level data issue: Monthly EIA-923 data was being shaped to hourly using the hourly fleet profile for the appropriate fleet in the BA. However, the BA-fleet profiles used the BA's official reporting timezone: in the case that a plant was not located the same timezone as the official plant BA, this meant that the plant data was getting shifted an hour relative to its local time, which tended to drop an hour of data from the year. Example: SOCO spans both Eastern and Central time, but reports in Central, so a plant located in eastern time would have the wrong profile assigned to it.
Power-sector data issue: Again, because a BA can have plants from multiple time zones in it, when aggregating all the plant data to the fleet level, we end up with timeseries with more than 8760 hours, because it spans 8760 hours in two timezones.
National-average wind/solar imputation: When calculating profiles to shape wind and solar data, we first try to use that BA's profile; if that doesn't exist, we take an average profile from all neighboring BAs; if that doesn't exist, we take a national average. Because this data spans many timezones, our approach has been to create a tz-naive local time, then average together - this best reflects the same profile in each timezones' relative local time to get a pattern. However, there were two bugs in this process: 1) we didn't handle the DST transition, so there were some data gaps, and also a discontinous jump in profile at the boundary and 2) we were calculating these profiles on a per-month basis, resulting in some month-edge hourly data issues.
Testing
Used Claude to write a number of tests related to these bugs.
Where to look
filepaths.py and load_data.py have two trivial ruff format line-wraps — no logic changes, safe to skip.
Review estimate
30 minutes
Future work
None
Checklist
ruff