Deprecation & Migration Guide¶
This guide documents the deprecations introduced as part of the ADR-011 policy work and provides concrete migration steps, timelines, and a status table to help library users and downstream integrators.
Goals¶
Centralise deprecation emission and behaviour via
deprecate()so messages are consistent and can be toggled to raise in CI (CE_DEPRECATIONS).Provide clear migration examples for common deprecated symbols and aliases.
Inform maintainers about the default two-minor-release deprecation window, plus the binding pre-v1.0 finalization exception that requires full closure by v0.11.3.
Where the helper lives¶
The new helper is implemented at:
src/calibrated_explanations/utils/deprecations.py
Use from calibrated_explanations.utils.deprecations import deprecate, deprecate_alias.
Recommended migration steps for callers¶
Replace use of deprecated APIs as documented below. Where you control the calling code, update to the canonical API.
If you rely on third-party libraries that emit deprecation warnings, pin those libraries or file an issue requesting they adopt the central helper.
For CI enforcement, set
CE_DEPRECATIONS=errortemporarily to catch any remaining deprecation uses during migration.
ADR-034 centralized configuration migration (v0.11.1)¶
Runtime modules now resolve environment and
pyproject.tomlconfig throughConfigManagersnapshots, not live ad-hoc reads.Snapshot behavior is intentional: changes to process env vars after manager construction are only visible after reconstructing the owning runtime object.
CLI configuration diagnostics are available via:
ce config showce config export
Plugin registration list-path API (closed by v0.11.3)¶
The legacy list-path plugin APIs are deprecated in v0.11.1 and will be
removed in v0.11.3.
Legacy API |
Replacement |
|---|---|
|
|
|
Register with |
|
|
|
|
# register(plugin)
# before
registry.register(plugin)
# after
registry.register_explanation_plugin(
identifier=plugin.plugin_meta["name"],
plugin=plugin,
metadata=plugin.plugin_meta,
)
# trust_plugin(plugin)
# before
registry.register(plugin)
registry.trust_plugin(plugin)
# after
meta = dict(plugin.plugin_meta)
meta["trusted"] = True
registry.register_explanation_plugin(
identifier=meta["name"],
plugin=plugin,
metadata=meta,
)
# find_for(model)
# before
plugins = registry.find_for(model)
# after
identifier, plugin = registry.find_explanation_plugin_for(
"tabular",
mode="factual",
task="classification",
model=model,
trusted_only=False,
)
plugins = (plugin,)
# find_for_trusted(model)
# before
trusted_plugins = registry.find_for_trusted(model)
# after
identifier, trusted_plugin = registry.find_explanation_plugin_for(
"tabular",
mode="factual",
task="classification",
model=model,
trusted_only=True,
)
trusted_plugins = (trusted_plugin,)
Common deprecated items and migration examples¶
CalibratedExplanations.get_explanation(index)was removed → Use indexing:explanations[index].Example:
# old e = explanations.get_explanation(0) # new e = explanations[0]
WrapCalibratedExplainer.explain_counterfactual(...)was removed →explore_alternatives(...).# old alt = explainer.explain_counterfactual(x) # new alt = explainer.explore_alternatives(x)
calibrated_explanations.coreno longer emits the legacy module deprecation warning.Parameter aliases
alpha/alphaswere removed in v0.11.0 → uselow_high_percentiles.register_plot_plugin(...)was removed → useregister_plot_builder(...)andregister_plot_renderer(...)separately.Parameter alias
n_jobswas removed in v0.11.0 → useparallel_workers:# old explainer.explain_factual(x, n_jobs=4) # new explainer.explain_factual(x, parallel_workers=4)
calibrated_explanations.core.calibrationimport → top-level:# old from calibrated_explanations.core.calibration import IntervalRegressor, VennAbers # new from calibrated_explanations.calibration import IntervalRegressor, VennAbers
RejectPolicyrenamed aliases:# old from calibrated_explanations import RejectPolicy policy = RejectPolicy.PREDICT_AND_FLAG # or EXPLAIN_ALL policy = RejectPolicy.EXPLAIN_REJECTS policy = RejectPolicy.EXPLAIN_NON_REJECTS # or SKIP_ON_REJECT # new policy = RejectPolicy.FLAG policy = RejectPolicy.ONLY_REJECTED policy = RejectPolicy.ONLY_ACCEPTED
Migration timeline and policy¶
Deprecation messages are emitted once-per-session by default and can be elevated to errors by setting
CE_DEPRECATIONS=errorin CI.Default policy: a deprecation introduced in
vX.Y.Zremains for at least two minor releases before removal.Finalization override: for the v1.0.0 cleanup window, all active deprecations must be removed by v0.11.3. No deprecation remains active in v1.0.0.
Status table¶
Binding rule for this table: every row in Active deprecations must move to Removed deprecations (history) by the end of v0.11.3.
Task 21 inventory (v0.11.1): core-surface LIME/SHAP deprecations¶
The v0.11.1 API-bloat removal program inventories ten LIME/SHAP core-surface entry points.
All ten now emit deprecate() warnings and are assigned to explicit pre-v1.0 removal milestones.
Active deprecations¶
Symbols listed here still emit warnings. Stop using them — they will be removed on the date shown.
Deprecated symbol |
Replacement |
Deprecated since |
Removal ETA |
Notes |
|---|---|---|---|---|
|
|
v0.10.x |
v0.11.3 |
ADR-001 Stage 1a. Shims in |
|
|
v0.10.x |
v0.11.3 |
Shim in |
|
|
v0.10.x |
v0.11.3 |
Shim in |
Imports from |
|
v0.10.x |
v0.11.3 |
Lazy |
|
|
v0.10.x |
v0.11.3 |
Aliases in |
|
|
v0.10.x |
v0.11.3 |
Same files. |
|
|
v0.10.x |
v0.11.3 |
Same files. |
Plugin |
|
v0.10.x |
v0.11.3 |
|
Plugin |
|
v0.10.x |
v0.11.3 |
Same. |
Plugin |
|
v0.10.x |
v0.11.3 |
Same. |
|
|
v0.10.x |
v0.11.3 |
|
|
|
v0.11.1 |
v0.11.3 |
Compatibility wrapper retained for migration; emits |
|
|
v0.11.1 |
v0.11.3 |
Compatibility wrapper retained for migration; emits |
|
|
v0.11.1 |
v0.11.3 |
Wrapper parity deprecation aligned with explainer-level deprecation. |
|
|
v0.11.1 |
v0.11.3 |
Wrapper parity deprecation aligned with explainer-level deprecation. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential delegator retained for transition; major-release removal gate under ADR-020. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential delegator retained for transition; major-release removal gate under ADR-020. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential delegator retained for transition; major-release removal gate under ADR-020. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential delegator retained for transition; major-release removal gate under ADR-020. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential delegator retained for transition; major-release removal gate under ADR-020. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Explainer alias mirrors plugin-manager state; direct manager access preferred. |
|
|
v0.11.1 |
v0.11.3 |
Task-21 inventory item; collection adapter removed after v0.11.2 core hook deletion. |
|
|
v0.11.1 |
v0.11.3 |
Task-21 inventory item; collection adapter removed after v0.11.2 core hook deletion. |
|
|
v0.11.1 |
v0.11.3 |
List-path API; emits deprecation warning via |
|
|
v0.11.1 |
v0.11.3 |
List-path API; emits deprecation warning via |
|
|
v0.11.1 |
v0.11.3 |
List-path API; emits deprecation warning via |
|
|
v0.11.1 |
v0.11.3 |
List-path API; emits deprecation warning via |
Removed deprecations (history)¶
Symbols listed here have been deleted. Any remaining usage will raise AttributeError or ImportError.
Deprecated symbol |
Replacement |
Deprecated since |
Removed in |
Notes |
|---|---|---|---|---|
|
|
v0.9.0 |
v0.11.0 |
Removed from the base collection API. |
|
|
v0.9.0 |
v0.11.0 |
Removed alias from wrapper API. |
|
package façade |
v0.9.0 |
v0.11.0 |
Legacy deprecation warning removed. |
|
|
v0.9.0 |
v0.11.0 |
Compatibility shim removed. |
Parameter aliases |
|
v0.9.0 |
v0.11.0 |
Removed alias mapping/warning path; calls now fail fast with |
Parameter alias |
|
v0.9.0 |
v0.11.0 |
Removed alias mapping/warning path; calls now fail fast with |
Top-level package exports ( |
Import from respective submodules |
v0.9.0 |
v0.11.0 |
Verified by |
|
|
v0.10.x |
v0.11.0 |
|
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; core helper preload path deleted. |
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; core helper preload path deleted. |
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; runtime explanation path is plugin-only. |
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; runtime explanation path is plugin-only. |
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; core helper toggle removed. |
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; core helper toggle removed. |
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; wrapper forwarding hook deleted. |
|
|
v0.11.1 |
v0.11.2 |
Task-21 inventory item removed in Task 5A; wrapper forwarding hook deleted. |
Breaking changes¶
Guarded entrypoints now fail on calibration-feature divergence (v0.11.1+)¶
explain_guarded_factual(...) and explore_guarded_alternatives(...) now raise
ValidationError when the active prediction backend is not using the same
calibration feature matrix as explainer.x_cal.
Why: Guarded filtering and interval predictions must share the same calibration-feature values to preserve the guarded exchangeability assumption.
Migration:
Recalibrate the explainer before calling guarded entrypoints if you have rebuilt or swapped interval learners.
Do not mutate or replace the backend calibration features independently of
explainer.x_cal.
Reject NCF public contract simplified (v0.11.1+)¶
Reject NCF user-facing inputs are now limited to default and ensured.
ncf="default": task-dependent internal score (hingefor binary + thresholded regression,marginfor multiclass).ncf="ensured":score = (1 - w) * interval_width + w * default_score.Legacy
ncf="entropy"remains accepted and is silently normalized toncf="default".Explicit
ncf="hinge"andncf="margin"are no longer accepted and now raiseValidationError.
Default condition_source changed to "prediction" (v0.11.0)¶
Starting in v0.11.0, the default value for the condition_source parameter in CalibratedExplainer has changed from "observed" to "prediction". This change enhances the consistency of calibrated explanations by basing condition labels on model predictions rather than observed labels.
Migration:
If your code previously relied on the default behavior (condition labels derived from observed labels), you must now explicitly set condition_source="observed" when initializing the explainer:
# Before (implicitly used "observed")
explainer = CalibratedExplainer(model, x_cal, y_cal)
# After (explicitly retain old behavior)
explainer = CalibratedExplainer(model, x_cal, y_cal, condition_source="observed")
# New default behavior (recommended)
explainer = CalibratedExplainer(model, x_cal, y_cal) # Uses "prediction"
A warning is issued when condition_source is not provided, guiding users to the new default. This change does not affect existing code that explicitly sets condition_source="observed". For more details, see the API documentation.
For maintainers¶
When introducing a deprecation, use
deprecate(message, key="unique:key", stacklevel=3)and prefer a stablekeyvalue.Add a line to this document and update the release plan (
docs/improvement/RELEASE_PLAN_v1.md) under ADR-011 when new items are introduced.In the v0.11.x finalization window, each new/remaining deprecation entry must include explicit removal ownership in v0.11.2 or v0.11.3.
Add a unit test in
tests/unit/validating the desired behaviour ofdeprecate()if you change its semantics.
Troubleshooting¶
If CI shows a
DeprecationWarningraised due toCE_DEPRECATIONS=error, run locally with that env var set to reproduce and update callsites accordingly.
Contact¶
If you’re unsure about a migration, open an issue.