-
Notifications
You must be signed in to change notification settings - Fork 75
Fix Python deprecation and future warnings in codebase #3913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: reyery <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot It is still incomplete. Look through this log to fix any deprecation and future warnings that appear.
|
@copilot look at the logs of the integration test of this github workflow https://github.com/architecture-building-systems/CityEnergyAnalyst/actions/runs/17911928219/job/50930367564. Search for DeprecationWarning and FutureWarning in the logs and fix them accordingly. |
Co-authored-by: reyery <[email protected]>
I've identified and fixed an additional Found and fixed:
This brings the total to 4 DataFrame.append() fixes across the codebase:
I performed a comprehensive search for additional deprecation patterns and this appears to be the complete set of DataFrame.append() usage that was causing the warnings in the integration test logs.
I've completed a comprehensive fix for all Python deprecation and future warnings found in the codebase. The final fix is in commit Issues Fixed:
The integration test logs should now be clean of these deprecation warnings. All changes maintain existing functionality while ensuring compatibility with modern pandas versions. |
This PR addresses several Python deprecation and future warnings that appear in the CI integration test logs, ensuring compatibility with newer versions of pandas and proper warning handling throughout the codebase.
Issues Fixed
1. DataFrame.append() Deprecation Warnings
The
DataFrame.append()method was deprecated in pandas 1.4.0 and will be removed in pandas 2.0+. Fixed four instances where this deprecated method was being used:In
cea/demand/demand_writers.py:In
cea/technologies/thermal_network/thermal_network.py(2 locations):In
cea/utilities/create_mixed_use_type.py:2. Incorrect DeprecationWarning Usage
Fixed improper exception raising instead of warning emission in
cea/plugin.py:Impact
Testing
These changes prepare the codebase for modern Python library versions while maintaining backward compatibility and existing behavior.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.