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, .yml or .json files.

pattern_risk{‘warn’, ‘ignore’, ‘refuse’}, optional

What to do when a pattern has a shape that can backtrack catastrophically (_pattern_risk). Defaults to CLEANPROMPT_PATTERN_RISK, else 'warn'. A pattern marked risk: accepted in its pack is never warned about or refused.

Returns:
Catalog

A partial catalog of only the custom definitions, every one validated. Its requires may name built-in packs; those are checked when it is merged by with_custom.

Raises:
PackError

If any definition is invalid, listing every problem in it, or pattern_risk is '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