PlatformCapabilities#
- class scikitplot.cython.PlatformCapabilities(platform, is_browser_wasm, can_compile_at_runtime, prebuilt_only, wasm_package_suffix)[source]#
Declarative contract describing what the current platform supports.
Runtime Cython compilation requires an out-of-process C/C++ compiler. In a browser/WASM runtime (Emscripten — e.g. Pyodide / JupyterLite / xeus) there is no subprocess compiler, so on-the-fly compilation is unavailable and only prebuilt
emscripten-wasm32extensions can be imported. Exposing this as an explicit contract lets callers branch deterministically instead of discovering the limitation through an opaque build failure (CYTHON-WASM-001).- Parameters:
- platformstr
The value of
sys.platform.- is_browser_wasmbool
Trueon an Emscripten/WASM runtime (browser).- can_compile_at_runtimebool
Truewhen an out-of-process compiler toolchain can be invoked. AlwaysFalseon browser/WASM.- prebuilt_onlybool
Truewhen only prebuilt extensions may be imported (no runtime build). The complement ofcan_compile_at_runtime.- wasm_package_suffixstr or None
The platform tag for prebuilt browser packages (
"emscripten-wasm32") on a browser runtime, elseNone.
- Parameters:
See also
platform_capabilitiesConstruct the contract for the current process.
Examples
>>> caps = platform_capabilities() >>> if not caps.can_compile_at_runtime: ... ... # import a prebuilt artifact instead of compiling
- count(value, /)#
Return number of occurrences of value.
- index(value, start=0, stop=sys.maxsize, /)#
Return first index of value.
Raises ValueError if the value is not present.