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
annotatethis is the precedence fix: the parameter isbool | Noneso “user did not specify” (None) is distinguishable from “user explicitly disabled” (False). Previouslyannotatewas a plainbooldefaulting toFalse, so the"annotate"profile – whose sole purpose is to enable annotation – could never take effect unless the caller also passedannotate=True, which defeated the profile.- Parameters:
- profilestr or None
Profile name, validated by
resolve_profile.- annotatebool or None, default=None
Noneinherits the profile default;True/Falseare explicit and always win.- compiler_directivesMapping[str, Any] or None
Noneinherits the profile default; a mapping is merged on top of the profile default (user keys win).- extra_compile_argsSequence[str] or None
Noneinherits the profile default; otherwise normalized to a tuple.- extra_link_argsSequence[str] or None
Noneinherits the profile default; otherwise normalized to a tuple.- language{‘c’, ‘c++’} or None
Noneinherits the profile default.
- Returns:
- AppliedProfile
Named 5-tuple
(annotate, compiler_directives, extra_compile_args, extra_link_args, language).extra_compile_argsandextra_link_argsare always tuples (empty means “no flags”, neverNone);compiler_directivesisNoneonly when neither the profile nor the user supplied any.
- Parameters:
- Return type:
AppliedProfile
Notes
The result is an
AppliedProfile(aNamedTuple), 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.