Skip to content

Small fixes: 1-sec FCAS columns, Excel close, Pandas deprecations#81

Merged
nick-gorman merged 4 commits into
masterfrom
small-fixes-fcas-excel-pandas
May 25, 2026
Merged

Small fixes: 1-sec FCAS columns, Excel close, Pandas deprecations#81
nick-gorman merged 4 commits into
masterfrom
small-fixes-fcas-excel-pandas

Conversation

@nick-gorman
Copy link
Copy Markdown
Member

Summary

Bundles three independent small fixes cherry-picked from #67, plus follow-ups.

# Commit Author What
1 Add 1-second FCAS columns to price/dispatch tables (#22) @mdavis-xyz Adds RAISE1SECRRP / LOWER1SECRRP and *1SECLOCALDISPATCH to the default column list of TRADINGLOAD, TRADINGPRICE, TRADINGREGIONSUM, DISPATCHPRICE, DISPATCHREGIONSUM. Auto-merged cleanly with master's existing 1-sec entries in DISPATCHLOAD/NEXT_DAY_DISPATCHLOAD (different tables).
2 close excel file when done @mdavis-xyz Wraps _pd.ExcelFile(...) in with — resource-leak fix. Straight pick.
3 address deprecation warnings in Pandas @mdavis-xyz Two fixes in custom_tables.py: groupby key access via .name instead of list(group[col])[0], and apply(...) now passes include_groups=False. Also freq="5T""5min" in test_performance_stats.py.
4 Extend Pandas freq fix + add 1-sec FCAS regression test me Two follow-ups (see below).

Follow-ups in commit 4

  • Extend freq="5T" rename to the two remaining call-sites in src/nemosis/custom_tables.py (plant_stats and trading_and_dispatch_cost). Commit 3 only fixed the test file; the library itself was still emitting the deprecation warning.
  • Add 1-sec FCAS regression test to tests/end_to_end_table_tests/test_dispatch_price.py. The commit-1 source change dropped its companion test (target file was deleted by Port test suite to offline fixture-based architecture #72). Replacement uses the 2024-12 fixture (post-October-2023 1-sec cutover, confirmed to contain RAISE1SECRRP/LOWER1SECRRP in the source CSV) and asserts both columns arrive in the output when no explicit select_columns is passed.

Test plan

  • uv run pytest tests/ — 368 pass, 1 skipped, 1 unrelated warning (existing pd.concat deprecation in test_processing_info_maps.py, untouched by this PR)
  • New test test_one_second_fcas_columns_included_by_default passes
  • CI green

Dropped from #67's commit set

mdavis-xyz and others added 4 commits May 25, 2026 11:50
Cherry-picked from #67 (commit 1b57257). The companion test in
tests/test_data_fetch_methods.py is dropped because PR #72 deleted that
file when porting the suite to the offline fixture architecture — a
fixture-based regression test is added in a follow-up commit on this
branch.

AEMO publishes 1-second contingency FCAS RRP and LOCALDISPATCH columns
in DISPATCHPRICE, DISPATCHREGIONSUM, TRADINGPRICE, TRADINGREGIONSUM and
TRADINGLOAD since the October 2023 introduction of the very-fast
service. Master already lists the bid-side LOWER1SEC/RAISE1SEC entries
in DISPATCHLOAD and NEXT_DAY_DISPATCHLOAD; this fills in the matching
price-side and region-side columns so they're included in the default
select_columns for those tables.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… test

Two follow-ups to the cherry-picked commits on this branch:

1. The Pandas freq="5T" → "5min" rename in the previous commit only
   touched tests/test_performance_stats.py. The same deprecated alias
   was still in src/nemosis/custom_tables.py in two places (plant_stats
   and trading_and_dispatch_cost). Apply the same rename there so the
   warning is silenced from the library side, not just the tests.

2. The 1-second FCAS commit dropped its companion test (target file was
   deleted by PR #72). Replace it with a fixture-based regression test
   in tests/end_to_end_table_tests/test_dispatch_price.py that uses the
   2024-12 fixture (post-October-2023 cutover) and confirms
   RAISE1SECRRP and LOWER1SECRRP arrive in the output when no explicit
   select_columns is passed — locking in the contract that the default
   column list for DISPATCHPRICE includes them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nick-gorman nick-gorman merged commit dee6203 into master May 25, 2026
16 checks passed
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