compile_and_load_result#
- scikitplot.cython.compile_and_load_result(source, *, module_name=None, cache_dir=None, use_cache=True, force_rebuild=False, verbose=0, profile=None, annotate=False, view_annotate=False, numpy_support=True, numpy_required=False, include_dirs=None, library_dirs=None, libraries=None, define_macros=None, extra_compile_args=None, extra_link_args=None, compiler_directives=None, extra_sources=None, support_files=None, support_paths=None, include_cwd=True, lock_timeout_s=60.0, language=None)[source]#
Compile and import a Cython extension module from source text.
- Parameters:
- sourcestr
Cython source text (
.pyx-like).- module_namestr or None, default=None
Module name to compile/import. If None, a unique deterministic name is derived from the full cache key (which includes compiler options). This avoids module-name collisions when building the same source under different flags in the same Python session.
- cache_dir, use_cache, force_rebuild, verbose
Cache and logging controls.
- profile{‘fast-debug’, ‘release’, ‘annotate’} or None, default=None
Build profile preset. Explicit arguments always override profile defaults.
- annotate, view_annotate
Cython annotation controls.
- numpy_supportbool, default=True
If True, try to include NumPy headers if NumPy is available.
- numpy_requiredbool, default=False
If True, raise if NumPy is not available.
- include_dirs, library_dirs, libraries, define_macros, extra_compile_args, extra_link_args
Compilation parameters passed to setuptools/compilers.
- compiler_directivesMapping[str, Any] or None, default=None
Cython compiler directives.
- extra_sourcessequence of path-like, optional
Extra C/C++ source files to compile and link.
- support_filesMapping[str, str|bytes] or None, default=None
Extra support files written into the build directory.
- support_pathssequence of path-like, optional
Extra support files copied into the build directory.
- include_cwdbool, default=True
Include current working directory in include paths.
- lock_timeout_sfloat, default=60.0
Max seconds to wait for the per-key build lock.
- language{‘c’, ‘c++’} or None, default=None
Optional language override.
- Returns:
- scikitplot.cython.BuildResult
Structured build/import result.
- Parameters:
source (str)
module_name (str | None)
use_cache (bool)
force_rebuild (bool)
verbose (int)
profile (str | None)
annotate (bool)
view_annotate (bool)
numpy_support (bool)
numpy_required (bool)
include_dirs (str | bytes | Path | PathLike[str] | PathLike[bytes] | None)
library_dirs (str | bytes | Path | PathLike[str] | PathLike[bytes] | None)
extra_sources (str | bytes | Path | PathLike[str] | PathLike[bytes] | None)
support_paths (str | bytes | Path | PathLike[str] | PathLike[bytes] | None)
include_cwd (bool)
lock_timeout_s (float)
language (str | None)
- Return type:
Gallery examples#
Multi-file builds: .pxi includes and external headers
Vector ops without NumPy: array(‘d’) + memoryviews
Workflow templates (train / hpo / predict) + CLI entry template