load_custom#
- scikitplot.cleanprompt.load_custom(paths, pattern_risk=None)[source]#
Load user definitions from one or more files into a catalog of their own.
- Parameters:
- pathspath or iterable of paths
.yaml,.ymlor.jsonfiles.- pattern_risk{‘warn’, ‘ignore’, ‘refuse’}, optional
What to do when a pattern has a shape that can backtrack catastrophically (
_pattern_risk). Defaults toCLEANPROMPT_PATTERN_RISK, else'warn'. A pattern markedrisk: acceptedin its pack is never warned about or refused.
- Returns:
- Catalog
A partial catalog of only the custom definitions, every one validated. Its
requiresmay name built-in packs; those are checked when it is merged bywith_custom.
- Raises:
- PackError
If any definition is invalid, listing every problem in it, or
pattern_riskis'refuse'and a pattern has an open finding.- CleanPromptError
If a file is missing, too large, of an unknown type, or two files define the same name.
- ValueError
If
pattern_risk(or the environment variable) is not a mode.
- Warns:
- PatternRiskWarning
Under
'warn', once per open finding, with rewrites and the ways to accept or silence it.
- Parameters:
- Return type:
Catalog
Gallery examples#
Cleanprompt Packs and Formats: Records, Configs and Whole Folders