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 were deprecated in v0.11.1 and 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 before v1.0.0. 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) before v1.0.0.
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¶
All active deprecations were removed in v0.11.5. The Active deprecations section is intentionally empty.
Deprecated symbol |
Replacement |
Deprecated since |
Removal ETA |
Notes |
|---|
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. |
|
|
v0.10.x |
v0.11.3 |
Shim |
|
|
v0.10.x |
v0.11.3 |
Shim |
Imports from |
|
v0.10.x |
v0.11.3 |
Lazy |
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.10.x |
v0.11.3 |
|
|
|
v0.10.x |
v0.11.3 |
Same. |
|
|
v0.10.x |
v0.11.3 |
Same. |
|
|
v0.10.x |
v0.11.3 |
ADR-001 Stage 1a shims removed; import from the canonical calibration package. |
|
|
v0.11.1 |
v0.11.3 |
Public reject delegator removed; use the reject orchestrator directly. |
|
|
v0.11.1 |
v0.11.3 |
Public reject delegator removed; use the reject orchestrator directly. |
|
|
v0.11.1 |
v0.11.3 |
Wrapper delegator removed; use the wrapped explainer’s reject orchestrator. |
|
|
v0.11.1 |
v0.11.3 |
Wrapper delegator removed; use the wrapped explainer’s reject orchestrator. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential plugin-manager delegator removed. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential plugin-manager delegator removed. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential plugin-manager delegator removed. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential prediction-orchestrator delegator removed. |
|
|
v0.11.1 |
v0.11.3 |
Non-essential prediction-orchestrator delegator removed. |
|
|
v0.11.1 |
v0.11.3 |
Public plugin-manager state aliases removed from |
|
|
v0.11.1 |
v0.11.3 |
Public plugin-manager override aliases removed from |
|
|
v0.11.1 |
v0.11.3 |
Collection adapter removed after v0.11.2 core hook deletion. |
|
|
v0.11.1 |
v0.11.3 |
Collection adapter removed after v0.11.2 core hook deletion. |
|
|
v0.11.1 |
v0.11.3 |
List-path API removed; use identifier-based registry APIs. |
|
|
v0.11.1 |
v0.11.3 |
List-path API removed; use identifier-based trust APIs. |
|
|
v0.11.1 |
v0.11.3 |
List-path API removed; use descriptor-based resolution. |
|
|
v0.11.1 |
v0.11.3 |
List-path API removed; use descriptor-based resolution. |
|
|
v0.11.x |
v0.11.3 |
Group L resolved via deprecation reset path: removed active warning targeting v1.0.0-rc to comply with ADR-011 finalization exception. |
|
|
v0.11.3 |
v0.11.5 |
Replaced by typed |
|
|
v0.11.3 |
v0.11.5 |
Numeric value is inverted: |
|
|
v0.11.3 |
v0.11.5 |
Folded into |
|
|
v0.11.3 |
v0.11.5 |
Folded into |
|
|
v0.11.3 |
v0.11.5 |
Folded into |
|
|
v0.11.3 |
v0.11.5 |
Renamed to carry the tier qualifier required by ADR-038 §2d and avoid confusion with |
|
|
v0.11.x |
v0.11.5 |
Bool passthrough removed; use enum or string value. |
|
|
v0.11.x |
v0.11.5 |
Module shim deleted; functionality lives in |
|
|
v0.11.x |
v0.11.5 |
Legacy explain function shim removed. |
|
|
v0.11.3 |
v0.11.5 |
Returns raw underlying model; bypasses all |
|
Pass an explicit strategy: |
v0.11.4 |
v0.11.5 |
Now raises |
|
|
v0.11.4 |
v0.11.5 |
Category A remediation wrapper removed; use the internal |
|
Re-save state with |
v0.11.4 |
v0.11.5 |
ADR-031 JSON-safe primitive migration; schema v2 uses field-level JSON data. Loading v1 now raises |
|
Re-save state with |
v0.11.4 |
v0.11.5 |
ADR-031 JSON-safe primitive migration; schema v2 uses field-level JSON data. Loading v1 now raises |
|
Semantic plot kind names ( |
v0.11.4 |
v0.11.5 |
ADR-037 semantic metadata vocabulary. Category names removed from |
|
|
v0.11.3 |
v0.11.3 |
Introduced already-deprecated in Task 13; removed same milestone (ADR-032, ADR-011 finalization exception). |
|
|
v0.11.3 |
v0.11.3 |
Same. |
|
|
v0.11.3 |
v0.11.3 |
Same — wrapper delegates to |
|
|
v0.11.3 |
v0.11.3 |
Same. |
Entry-point plugin missing |
Declare |
v0.11.x |
v0.11.4 |
Enforcement closed: missing key now raises |
Breaking changes¶
Guarded entrypoints now fail on calibration-feature divergence (v0.11.1+)¶
explainer.explain_factual(..., guarded_options=GuardedOptions(...)) and
explainer.explore_alternatives(..., guarded_options=GuardedOptions(...))
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.Use
explain_factual(..., guarded_options=GuardedOptions())/explore_alternatives(..., guarded_options=GuardedOptions()).The removed
guarded=Truecall form now raisesConfigurationError; the oldexplain_guarded_factual/explore_guarded_alternativesmethods were removed in v0.11.3.
from calibrated_explanations import GuardedOptions
guarded = GuardedOptions(confidence=0.9, n_neighbors=25)
guarded_factual = explainer.explain_factual(X_sample, guarded_options=guarded)
guarded_alternatives = explainer.explore_alternatives(
X_sample[:2],
guarded_options=guarded,
)
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"is no longer accepted and now raisesValidationError; usencf="default"instead.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 (
development/current-work/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.