CorpusPolicyBundle#
- class scikitplot.corpus.CorpusPolicyBundle(name='default', runtime=None, backend=None, download=None, errors=ErrorPolicy.COLLECT)[source]#
Typed composition of the independent Corpus policy dimensions.
- Parameters:
- namestr, optional
Human-facing label used only in diagnostics/serialization.
- runtimeRuntimePolicy, str, mapping or None, optional
Source-execution policy.
- backendBackendPolicy, str, mapping or None, optional
Optional-backend orchestration policy.
- downloadDownloadPolicy, str, mapping or None, optional
Transport/resource policy.
- errorsErrorPolicy or str, optional
Per-document pipeline error behaviour.
- Parameters:
name (str)
runtime (RuntimePolicy | str | Mapping[str, Any] | None)
backend (BackendPolicy | str | Mapping[str, Any] | None)
download (DownloadPolicy | str | Mapping[str, Any] | None)
errors (ErrorPolicy | str)
Notes
The fields remain independent on purpose. For example, allowing URL source execution does not imply that an ASR backend may download a model, and an offline source policy does not require every pipeline error to raise.
- builder_config(**kwargs)[source]#
Construct
BuilderConfigwith this bundle’s download policy.Other bundle dimensions remain explicit at their own execution seams; this method must not pretend that
CorpusBuildercontrols reader ASR orRuntimeCorpusURL-source permission.
- classmethod docs_ci()[source]#
Return bounded, local-only defaults suitable for docs/CI.
- Return type:
- errors: ErrorPolicy | str = 'collect'[source]#
- classmethod from_config(config)[source]#
Build from nested configuration with strict unknown-key rejection.
- Parameters:
- Return type:
- classmethod networked()[source]#
Permit URL sources while retaining secure transfer defaults.
- Return type:
- reader_kwargs(**overrides)[source]#
Return reader kwargs carrying this bundle’s backend policy.
This helper is intended for readers that expose
backend_policysuch asAudioReaderandVideoReader. It deliberately does not inject the value into every reader automatically because many formats do not have interchangeable optional backends.
- classmethod safe_local()[source]#
Return an explicitly local/offline, fail-observable preset.
- Return type:
- classmethod strict_local()[source]#
Return local-only policies that raise instead of degrading.
- Return type:
- with_overrides(*, name=None, runtime=None, backend=None, download=None, errors=None)[source]#
Return a typed copy with explicitly selected policy dimensions changed.
- Parameters:
name (str | None)
runtime (RuntimePolicy | str | Mapping[str, Any] | None)
backend (BackendPolicy | str | Mapping[str, Any] | None)
download (DownloadPolicy | str | Mapping[str, Any] | None)
errors (ErrorPolicy | str | None)
- Return type: