v1.0.0 upgrade checklist¶
Use this checklist when migrating from any v0.11.x release to v1.0.0. Work through each topic in order; most items are verifiable with a one-line command.
The authoritative env var reference is
docs/foundations/how-to/configure_runtime.md.
The safe-defaults guide for production deployments is
docs/foundations/how-to/safe-defaults.md.
1. Environment variables¶
Full reference: configure_runtime.md covers all env vars, their pyproject.toml equivalents, accepted values, and the
export_effective()diagnostic pattern. This section summarises the points most often misconfigured during upgrades.
All 25 recognised env vars are listed below. Keys not set default to their pyproject.toml value or the library default.
Key |
Category |
Notes |
|---|---|---|
|
Plugin selection |
Alias for |
|
Plugin selection |
Identifier of the factual explanation plugin |
|
Plugin selection |
Identifier of the alternative explanation plugin |
|
Plugin selection |
Identifier of the fast explanation plugin |
|
Plugin selection |
Comma-separated fallback identifiers |
|
Plugin selection |
Comma-separated fallback identifiers |
|
Plugin selection |
Comma-separated fallback identifiers |
|
Plugin selection |
Identifier of the interval plugin |
|
Plugin selection |
Identifier of the fast interval plugin |
|
Plugin selection |
Comma-separated fallback identifiers |
|
Plugin selection |
Comma-separated fallback identifiers |
|
Plot |
Plot style identifier |
|
Plot |
Comma-separated fallback style identifiers |
|
Plot |
Plot renderer identifier |
|
Security |
Comma-separated trusted plugin identifiers (allowlist) |
|
Security |
Comma-separated denied plugin identifiers (denylist) |
|
Plugin |
JSON string of per-plugin configuration |
|
Observability |
|
|
Performance |
|
|
Performance |
|
|
Performance |
Standalone override for parallel minimum batch size |
|
Runtime |
Feature-filter expression; env-only key |
|
Observability |
|
|
Debug |
Direct |
|
Environment |
Detected by CI-aware heuristics; do not set explicitly |
|
Environment |
Detected by CI-aware heuristics; do not set explicitly |
Confirm no phantom keys: Cache and parallel sizing is provided inline
within the CE_CACHE and CE_PARALLEL values — there are no standalone
sizing keys for cache item count, byte limit, TTL, or parallel worker count.
Use the inline token syntax shown in topics 6 and 7 below.
To print the effective configuration of a running process:
from calibrated_explanations.core.config_manager import get_process_config_manager
snapshot = get_process_config_manager().export_effective()
# Resolved values live under "effective.<KEY>"; snapshot also contains
# "env.*", "pyproject.*", and "diagnostic.*" groups.
for key, value in snapshot.values.items():
print(f"{key}: {value!r} [{snapshot.sources[key]}]")
2. pyproject.toml configuration¶
Full reference: configure_runtime.md documents every
[tool.calibrated_explanations.*]section and field.
Minimum recommended pyproject.toml additions for v1.0.0:
[tool.calibrated_explanations.plugins]
trusted = ["your-plugin-id"] # empty list = no plugins trusted
[tool.calibrated_explanations.explanations]
# factual = "my_factual_plugin" # override default factual plugin
# alternative = "my_alt_plugin" # override default alternative plugin
ConfigManager reads pyproject.toml at process start. Changes require a process restart to take effect.
3. API changes from v0.11.x¶
The following symbols were removed in v0.11.x and are no longer present in the codebase. Replace all usages before upgrading.
Removed in v0.11.0¶
Removed symbol |
Canonical replacement |
|---|---|
|
|
|
|
|
Use the package façade |
|
|
Parameter aliases |
|
Parameter alias |
|
Top-level package exports ( |
Import from respective submodules |
|
|
Removed in v0.11.2¶
Removed symbol |
Canonical replacement |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Removed in v0.11.3¶
Removed symbol |
Canonical replacement |
|---|---|
|
|
|
|
|
|
Plugin |
|
Plugin |
|
Plugin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Removed in v0.11.3 (guarded wrapper methods)¶
Removed symbol |
Canonical replacement |
|---|---|
|
|
|
|
|
|
|
|
Removed in v0.11.3 (plugin metadata enforcement)¶
Entry-point plugins that omit the data_modalities key in their metadata are now
skipped with a UserWarning rather than defaulting to ('tabular',).
Action required |
Detail |
|---|---|
Declare |
Add |
Import: from calibrated_explanations.explanations.guarded_options import GuardedOptions
The guarded=True boolean kwarg is also deprecated (emits DeprecationWarning; removed v1.0.0).
Set CE_DEPRECATIONS=error in CI to surface any remaining uses as hard errors:
CE_DEPRECATIONS=error pytest your_tests/
4. Guarded explanation migration¶
The explain_guarded_factual / explore_guarded_alternatives methods were
removed in v0.11.3 (not merely deprecated). The guarded=True boolean
kwarg is deprecated as of v0.11.3 and will be removed in v1.0.0.
Before (v0.11.2 and earlier):
# Removed in v0.11.3 — raises AttributeError
result = wrapper.explain_guarded_factual(X_test)
result = wrapper.explore_guarded_alternatives(X_test)
Intermediate (v0.11.3 — deprecated, still works):
# Deprecated — emits DeprecationWarning; removed in v1.0.0
result = wrapper.explain_factual(X_test, guarded=True)
result = wrapper.explore_alternatives(X_test, guarded=True)
Canonical (v0.11.3+ and v1.0.0-compatible):
from calibrated_explanations.explanations.guarded_options import GuardedOptions
result = wrapper.explain_factual(X_test, guarded_options=GuardedOptions())
result = wrapper.explore_alternatives(X_test, guarded_options=GuardedOptions())
GuardedOptions fields (all optional): confidence=0.9, n_neighbors=None,
normalize=False, merge_adjacent=False.
5. ExplainerBuilder and ExplainerConfig wiring¶
ExplainerBuilder and ExplainerConfig are exported from the root namespace
as of v0.11.3.
Direct config construction:
from calibrated_explanations import ExplainerConfig, WrapCalibratedExplainer
config = ExplainerConfig(model=model, auto_encode=True)
wrapper = WrapCalibratedExplainer.from_config(config)
model is a required field on ExplainerConfig. from_config takes only the
config object — the model is already inside it.
Fluent builder:
from calibrated_explanations import ExplainerBuilder, WrapCalibratedExplainer
config = (
ExplainerBuilder(model)
.perf_cache(True, max_items=512, max_bytes=16_777_216, ttl=600)
.perf_parallel(True, workers=4, min_batch=16)
.build_config()
)
wrapper = WrapCalibratedExplainer.from_config(config)
Key points:
perf_cacheandperf_parallelrequireenabled: boolas the first positional argument.build_config()returns the assembledExplainerConfig; pass it toWrapCalibratedExplainer.from_config()to get the wrapper.CE_CACHEandCE_PARALLELenv vars take precedence over builder settings at runtime (applied after builder construction — ADR-034 §7).
6. Caching¶
Full reference: tune_runtime_performance.md
Caching is opt-in and disabled by default (ADR-003). To enable:
# Minimal — enable with defaults
CE_CACHE=on
# With inline sizing tokens (single env var value)
CE_CACHE=on,max_items=512,max_bytes=16777216,ttl=600
Accepted inline tokens: max_items=N, max_bytes=N, ttl=N,
namespace=<str>, version=<str>.
Enabled label values: 1, true, on, yes, enable.
All sizing is done inline within the CE_CACHE value (no standalone sizing
keys exist), or programmatically via ExplainerBuilder.perf_cache(...).
7. Parallel execution¶
Full reference: tune_runtime_performance.md
Parallel execution is opt-in and disabled by default (ADR-004). To enable:
# Minimal — enable with defaults
CE_PARALLEL=on
# With inline tokens (single env var value)
CE_PARALLEL=on,workers=4,min_batch=16,threads
Accepted inline tokens: workers=N, min_batch=N, min_instances=N,
tiny=N, instance_chunk=N, feature_chunk=N, task_bytes=N,
force_serial=, granularity=.
CE_PARALLEL_MIN_BATCH_SIZE is a supported standalone key for the minimum
batch size only. There is no standalone key for worker count — set it
inline: CE_PARALLEL=on,workers=4.
The granularity="feature" value was removed in v0.11.3. Only
granularity="instance" is accepted.
8. Plugin testing and diagnostics¶
Verify plugin trust and configuration using the get_process_config_manager
singleton (not a fresh ConfigManager.from_sources() snapshot):
from calibrated_explanations.core.config_manager import get_process_config_manager
snapshot = get_process_config_manager().export_effective()
# Resolved effective values use the "effective.<KEY>" namespace
print("trusted:", snapshot.values.get("effective.CE_TRUST_PLUGIN"))
print("denied:", snapshot.values.get("effective.CE_DENY_PLUGIN"))
# Plugin config is already a decoded dict in the snapshot (not a JSON string)
print("plugin config:", snapshot.values.get("effective.CE_PLUGIN_CONFIG_JSON"))
# Iterate all effective keys (also includes env.*, pyproject.*, diagnostic.* groups)
for key, value in snapshot.values.items():
print(f"{key}: {value!r} [{snapshot.sources[key]}]")
CLI equivalent (one-shot snapshot, does not inspect a running process):
python -m calibrated_explanations.cli config show
Production recommendation: set an explicit [tool.calibrated_explanations.plugins] trusted = [...] in pyproject.toml rather than relying on CE_TRUST_PLUGIN
env var. Env var overrides pyproject.toml if both are set.
9. Reject framework¶
The reject framework was stabilised in v0.11.x. The canonical enum members are:
RejectPolicy.FLAG— flag all, explain allRejectPolicy.ONLY_ACCEPTED— explain only accepted instancesRejectPolicy.ONLY_REJECTED— explain only rejected instancesRejectPolicy.NONE— disable reject logic entirely
The legacy aliases PREDICT_AND_FLAG, EXPLAIN_ALL, EXPLAIN_REJECTS,
EXPLAIN_NON_REJECTS, EXPLAIN_REJECTS, and SKIP_ON_REJECT were removed
in v0.11.3 and raise ValueError / AttributeError at runtime.
Use RejectPolicySpec for a type-safe factory:
from calibrated_explanations import WrapCalibratedExplainer, RejectPolicySpec
result = wrapper.explore_alternatives(X_test, reject_policy=RejectPolicySpec.flag())
result = wrapper.explain_factual(X_test, reject_policy=RejectPolicySpec.only_accepted())
The filter_by_target_confidence(confidence) method on
AlternativeExplanations provides post-hoc conformal decision-making: it
returns only the alternative intervals that survive the conformal threshold at
the given confidence level.
from calibrated_explanations import WrapCalibratedExplainer
result = wrapper.explore_alternatives(X_test)
high_confidence = result.filter_by_target_confidence(0.9)