Skip to content

Patch: Pandas 3.x Compatibility#239

Merged
RHammond2 merged 7 commits intomainfrom
patch/pandas-dtypes
Apr 8, 2026
Merged

Patch: Pandas 3.x Compatibility#239
RHammond2 merged 7 commits intomainfrom
patch/pandas-dtypes

Conversation

@RHammond2
Copy link
Copy Markdown
Collaborator

Fix Data Type Issues To Enable Pandas 3.x Compatibility

This PR fixes various issues relating to how data are accessed in Pandas DataFrames, changes to default datetime resolutions, and a previously unidentified metrics bug.

PR Checklist

  • CHANGELOG.md has been updated to describe the changes made in this PR
  • Documentation
    • Docstrings are up-to-date
    • Related docs/ files are up-to-date, or added when necessary
    • Documentation has been rebuilt successfully
    • Examples have been updated
  • Tests pass (If not, and this is expected, please elaborate in the tests section)
  • PR description thoroughly describes the new feature, bug fix, etc.

Related issues

N/A

Impacted areas of the software

  • wombat/core/library.py
    • format_weather: Manually casts datetime data to "ns" resolution for updated Pandas compatibility.
  • wombat/core/post_processor.py
    • Metrics._apply_inflation_rate: Converts all cost columns to float types for Pands 3.x incompatibility with implicit casting during mathematical operations.
    • Metrics.vessel_crew_hours_at_sea: Replaces group_cols with frequency.group_cols for total_hours grouping that was previously missed.
  • wombat/windfarm/windfarm.py
    • Windfarm._create_graph_layout: Repalces .values with .to_numpy() for turbine, substation, and electrolyzer id creation.

Additional supporting information

Python version: 3.13.11
WOMBAT version (wombat.__version__): 0.13.2

Test results, if applicable

Tests now pass with Pandas 2.x and 3.x

@RHammond2 RHammond2 added bug Something isn't working enhancement New feature or request labels Apr 8, 2026
@RHammond2 RHammond2 merged commit 4176d1f into main Apr 8, 2026
11 checks passed
@RHammond2 RHammond2 deleted the patch/pandas-dtypes branch April 8, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant