Repository navigation
Simplify CloudPredictor / FoundationModel signatures - #294
Merged
Merged
Conversation
- Move rarely used options (job_name, volume_size, custom_image_uri, timeout, instance_count, initial_instance_count) into typed **kwargs, validated against per-method TypedDicts; unknown keys raise TypeError. - Drop instance_count / leaderboard from training methods; passing them logs a warning and the value is ignored. - Move image_column / test_data_image_column to MultiModalCloudPredictor. - Make options keyword-only after the data arguments in predict, deploy, TimeSeriesFoundationModel.predict and TimeSeriesEndpoint.predict. - Make backend_overrides explicit on FoundationModel methods; add timeout to time series training. - Document the hidden options and backend_overrides under "Other Parameters", rendered as a separate section by napoleon.
…tance_count, tailored image-column errors - Restore the `backend_kwargs` entry in _REMOVED_KWARGS (lost in the **kwargs rename), with a test. - FoundationModel predict / predict_proba warn about and drop `instance_count` instead of raising. - Tabular predict / predict_proba point `test_data_image_column` to MultiModalCloudPredictor, like fit. - Caller-neutral _fit error messages; TimeSeriesCloudPredictor.fit returns Self. - check_backend_kwargs reads TypedDict keys via __required_keys__ / __optional_keys__.
|
Job PR-294-7d664fa is done. |
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.
Summary
Shorten the public signatures by moving rarely used options out of them.
**kwargs, validated against per-methodTypedDicts withUnpack, so IDEs still autocomplete them. Unknown keys raise aTypeErrorthat lists the supported ones.fit/fit_predict*, FMpredict/predict_proba):job_name,volume_size,custom_image_uri,timeoutpredict/predict_proba):job_name,instance_count,custom_image_urideploy):initial_instance_count,volume_size,custom_image_uriinstance_countandleaderboardfrom training methods. Training is always single-instance and the leaderboard is always saved. Passing either logs a warning and the value is ignored. FMpredict/predict_probahandleinstance_countthe same way.image_column/test_data_image_columntoMultiModalCloudPredictor. On tabular,fit/predict/predict_probaraise an error pointing toMultiModalCloudPredictor.predict/predict_proba, all of CP / FMdeploy,TimeSeriesCloudPredictor.predict,TimeSeriesFoundationModel.predict,TimeSeriesEndpoint.predict.framework_versionandbackend_overridesstay named everywhere.backend_overridesis now also named on the FM methods, where it used to go through**backend_kwargs.timeoutnow also works for time series training.fit_predictplumbing (test_data,extra_ag_args) moved fromfit(**kwargs)into a private_fit().Breaking changes
TypeError, e.g.predict(df, "s3://..."),deploy("s3://..."),TimeSeriesFoundationModel.predict(data, "target"),TimeSeriesCloudPredictor.predict(data, static_features),TimeSeriesEndpoint.predict(data, known_covariates). Pass these by keyword.**kwargs: same names, still keyword arguments, so keyword callers are unaffected. Keys that a method doesn't support now raiseTypeErrorinstead of being forwarded unchecked; this affects FM methods, which used to forward their extra keyword arguments to the backend without checking them.leaderboard=Falseon training methods is ignored with a warning; the leaderboard is always saved.instance_counton training methods (CPfit/fit_predict*, FMpredict/predict_proba) is ignored with a warning. It already had no effect.image_column/test_data_image_columnare only accepted byMultiModalCloudPredictor.backend_overridesis now a named parameter; passing it by keyword works as before.Docs
The hidden options and
backend_overridesare documented under a numpydoc Other Parameters section, after Returns.docs/conf.pyregisters it as a separate napoleon section; by default napoleon merges it into Parameters.Testing
tests/unittests/general/test_backend_kwargs.py: forwarding, unknown-key errors, ignored-kwarg warnings (CP and FM), image-column errors and split, the legacybackend_kwargs={...}migration hint, keyword-only calls.fit_predictunit tests now mock_fitinstead offit.