with_custom#
- scikitplot.cleanprompt.with_custom(paths, conflict='error', base=None, pattern_risk=None)[source]#
Return the built-in catalog with custom definitions merged in.
- Parameters:
- pathspath, iterable of paths, or None
Definition files.
Noneor empty returnsbaseunchanged.- conflict{‘error’, ‘replace’}, default=’error’
What to do when a custom definition differs from a built-in of the same name.
- baseCatalog, optional
Defaults to
builtin_catalog.- pattern_risk{‘warn’, ‘ignore’, ‘refuse’}, optional
Passed to
load_custom.
- Returns:
- Catalog
Validated as a whole, including every
requires.
- Parameters:
- Return type:
Catalog
Examples
>>> import json, tempfile, pathlib >>> folder = pathlib.Path(tempfile.mkdtemp()) >>> _ = (folder / "hr.json").write_text( ... json.dumps( ... { ... "name": "hr", ... "version": 1, ... "summary": "HR ids.", ... "requires": ["personal"], ... "fields": [ ... {"names": ["badge_id"], "kind": "EMPLOYEE", "role": "id"} ... ], ... } ... ) ... ) >>> [p.name for p in with_custom(folder / "hr.json").resolve_packs("hr")] ['personal', 'hr']