Drop the timely-beliefs forecast extra (sktime) from the dependencies - #2440
Open
Flix6x wants to merge 8 commits into
Open
Drop the timely-beliefs forecast extra (sktime) from the dependencies#2440Flix6x wants to merge 8 commits into
Flix6x wants to merge 8 commits into
Conversation
…tray docs/examples Signed-off-by: Stijn van Houwelingen <teadrinkingprogrammer@proton.me>
Context: - Most wheels ship their compiled extensions unstripped. The symbol tables and debug info they carry are never used at runtime, and openturns alone accounts for over a fifth of the weight Change: - Strip the shared objects in the builder stage, so only the stripped virtual environment is copied into the runtime image and no layer keeps the fat copy - --strip-unneeded retains everything dynamic linking needs, so the extensions stay loadable Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl> # Conflicts: # Dockerfile # documentation/changelog.rst
Context: - The forecast extra exists for timely-beliefs' own belief-formation model, which takes an sktime forecaster. FlexMeasures never calls it: its forecasting is the darts/lightgbm TrainPredictPipeline, and nothing imports sktime - timely-beliefs imports sktime only under TYPE_CHECKING and inside that one function, so plain timely-beliefs behaves identically for us Change: - Dropped the [forecast] extra from the dependency, which removes sktime and scikit-base (~28 MB in the image) - Hand-applied the lock edit rather than committing a full uv lock regeneration: the latter rewrites ~5200 lines of environment-marker serialization while changing no resolved version. uv lock --check passes, resolving 251 packages Signed-off-by: F.N. Claessen <felix@seita.nl>
Context: - All three image-shrinking PRs share one changelog entry Change: - Mentioned the dropped timely-beliefs forecast extra and appended PR #2440 Signed-off-by: F.N. Claessen <felix@seita.nl>
Documentation build overview
|
2 tasks
Signed-off-by: F.N. Claessen <felix@seita.nl> # Conflicts: # Dockerfile # documentation/changelog.rst
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.
Description
Depends on plain
timely-beliefsinstead oftimely-beliefs[forecast], which removessktimeandscikit-basefrom the image (~28 MB).Stacked on #2439 — branched off its head. It shares the same changelog entry as #2438 and #2439 rather than adding one, since all three shrink the image.
Why this is safe
The
forecastextra exists fortimely-beliefs' own belief-formation model, which accepts an sktime forecaster. FlexMeasures never calls it — our forecasting is the darts/lightgbmTrainPredictPipeline. There is no reference tosktime,form_beliefs,BaseForecasterorNaiveForecasteranywhere inflexmeasures/ortests/.On the pinned version (3.5.5),
timely-beliefsimports sktime only underif TYPE_CHECKING:and inside that one function, so it is never imported at runtime unless you call that API. Plaintimely-beliefstherefore behaves identically for us.About the lock file
The lock edit is hand-applied: it removes the two package blocks, the
forecastextra edge from our dependency, and the now-unselectedforecastblock ontimely-beliefs.Running
uv lockproduces the same resolution but rewrites ~5,200 lines of environment-marker serialization with zero version changes — unreviewable noise for a two-package removal. The hand-applied version is 40 lines, anduv lock --checkpasses on it, resolving the same 251 packages. (Same approach as #2407.)How to test
uv lock --check uv sync --frozen pytest flexmeasures/data/tests/test_forecasting_pipeline.py flexmeasures/data/tests/test_forecasting_jobs.py \ flexmeasures/api/v3_0/tests/test_forecasting_api.py flexmeasures/cli/tests/test_data_add.pyVerified by blocking
sktimeat the import hook and running FlexMeasures against it: 72 forecasting tests pass with the package entirely unimportable, andflexmeasures,timely_beliefsandTrainPredictPipelineall import cleanly.Related Items
Stacked on #2439, which is stacked on #2438. Part of #2437.
Sign-off
🤖 Generated with Claude Code