apply_profile#

scikitplot.cython.apply_profile(*, profile, annotate=None, compiler_directives, extra_compile_args, extra_link_args, language)[source]#

Apply a profile with strict, three-state precedence.

Every field follows the same contract:

  • The user passed an explicit value (not None) -> the user value wins.

  • The user left the value unset (None) -> the profile default applies.

For annotate this is the precedence fix: the parameter is bool | None so “user did not specify” (None) is distinguishable from “user explicitly disabled” (False). Previously annotate was a plain bool defaulting to False, so the "annotate" profile – whose sole purpose is to enable annotation – could never take effect unless the caller also passed annotate=True, which defeated the profile.

Parameters:
profilestr or None

Profile name, validated by resolve_profile.

annotatebool or None, default=None

None inherits the profile default; True/False are explicit and always win.

compiler_directivesMapping[str, Any] or None

None inherits the profile default; a mapping is merged on top of the profile default (user keys win).

extra_compile_argsSequence[str] or None

None inherits the profile default; otherwise normalized to a tuple.

extra_link_argsSequence[str] or None

None inherits the profile default; otherwise normalized to a tuple.

language{‘c’, ‘c++’} or None

None inherits the profile default.

Returns:
AppliedProfile

Named 5-tuple (annotate, compiler_directives, extra_compile_args, extra_link_args, language). extra_compile_args and extra_link_args are always tuples (empty means “no flags”, never None); compiler_directives is None only when neither the profile nor the user supplied any.

Parameters:
Return type:

AppliedProfile

Notes

The result is an AppliedProfile (a NamedTuple), so positional unpacking remains identical to the historical bare-tuple return while adding named access. User-supplied flag sequences are normalized to tuples but otherwise forwarded verbatim; argument safety is enforced by the security layer at build time, not here.