Skip to content

Modernize for Python 3.11+, pandas 3.0, numpy 2.x, pvlib 0.15#19

Open
MaykThewessen wants to merge 1 commit intorenewables-ninja:mainfrom
MaykThewessen:fix/modernize-python-pandas-compat
Open

Modernize for Python 3.11+, pandas 3.0, numpy 2.x, pvlib 0.15#19
MaykThewessen wants to merge 1 commit intorenewables-ninja:mainfrom
MaykThewessen:fix/modernize-python-pandas-compat

Conversation

@MaykThewessen
Copy link
Copy Markdown

Summary

Test plan

  • All 19 existing tests pass on Python 3.14 with pandas 3.0.1, numpy 2.4.3, pvlib 0.15.0, ephem 4.2.1
  • End-to-end PV model validation: 1 kW c-Si panel in Zurich produces ~1652 kWh/year (realistic)
  • Legacy (ephem) and modern (pvlib) paths produce results within 0.02% of each other

🤖 Generated with Claude Code

Addresses issues renewables-ninja#18, renewables-ninja#12, renewables-ninja#11 (pandas deprecations), renewables-ninja#9 (azimuth docs),
and renewables-ninja#14 (installation on modern Python).

Changes:
- Fix fillna(inplace=True) deprecated in pandas 3.0
- Fix .date() indexing in legacy sun_angles for pandas compat
- Fix freq alias "1H" -> "1h" (pandas 3.0 requires lowercase)
- Fix tz-aware/naive mismatch in _daily_dtindex and sun_rise_set_times
- Update deps: pandas>=2.0, pvlib>=0.11, numpy>=2.0, ephem>=4.2
- Set requires-python>=3.11, update black target versions
- Clarify azimuth docstrings (180=South, auto-corrected for S. hemisphere)
- Fix 2-axis tracking panel_tilt to derive from sun_alt (from PR renewables-ninja#10)
- Fix wind speed unit typo (m/2 -> m/s) and docstring param name
- Remove stale FIXME, commented-out code, unnecessary super().__init__()
- Use f-strings and modern class syntax

All 19 existing tests pass on Python 3.14, pandas 3.0.1, numpy 2.4.3,
pvlib 0.15.0, ephem 4.2.1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant