fix: Use native xgb.Booster to fix Py3.12 crash (keeps .ubj format) - #335
Open
astropedrocosta wants to merge 7 commits into
Open
fix: Use native xgb.Booster to fix Py3.12 crash (keeps .ubj format)#335astropedrocosta wants to merge 7 commits into
astropedrocosta wants to merge 7 commits into
Conversation
Author
|
Conflicts resolved and linting fixed. The PR is ready for review. Note: Workflows are awaiting approval to run. |
Author
|
Hi @peterdudfield, I'm following up on this! I’ve resolved the merge conflicts and fixed the linting W293 errors. The code is now using the native It looks like the workflows are still 'Awaiting Approval' to run. Ready for review whenever you have a moment! |
Contributor
|
Looks like the tests are failing? Can you have a look @astropedrocosta |
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.
Pull Request
Description
This PR resolves a critical compatibility issue with Python 3.12 where the
XGBRegressorScikit-Learn wrapper causes the application to crash with an_estimator_typeerror upon initialisation.Summary of Changes:
quartz_solar_forecast/forecasts/v2.pyto replace the deprecatedXGBRegressorwrapper with the nativexgb.Boosterengine.xgb.DMatrixfor data handling..ubjmodel format, eliminating the need to migrate to a larger JSON model file.Motivation and Context:
This work stems from the installation and runtime failures identified in Issue #333. It operates synthetically with the collaborative work done in PR #334 with @Raakshass, aimed at stabilising the package for newer Python environments.
Fixes #333
How Has This Been Tested?
I have verified these changes locally by running the full forecasting pipeline using real weather data for Porto, Portugal.
Test Configuration:
test_porto.py(Local validation script)Reproduction Instructions:
TryolabsSolarPowerPredictor.predict_power_output()with valid latitude/longitude data.Sanity Check:
I have plotted the output data and verified that the solar generation curve follows expected day/night cycles (0 kW at night, peak generation during daylight hours).
Checklist: