mixle.utils.optional_deps module

Optional-dependency shims so the base install works without the heavy extras.

numba: when installed, the real module is re-exported. When missing, a no-op stand-in is provided whose jit/njit decorators return the function unchanged and whose prange is range - the jitted code paths then run as pure Python (correct, but slow). Install the accelerated paths with:

pip install mixle[numba]

pyspark: pyspark is None when missing and RDD_TYPES is an empty tuple, so isinstance(data, RDD_TYPES) is simply False and the estimation helpers fall through to their local implementations. Install with:

pip install mixle[spark]

zarr / h5py: the array-store data sources (mixle.data.sources.array_source) read lazily from on-disk zarr and HDF5 volumes without materializing them. Both are None when missing and HAS_ZARR / HAS_H5PY are False, so the connectors raise the standard require(...) message instead of an ImportError on import. numpy-memmap volumes need no extra dependency. Install with:

pip install mixle[arrays]

pandas: mixle.data.sources.pandas_source reads a caller-supplied DataFrame by duck-typing (it never imports pandas itself), but the write-side result-egress methods (ParameterPosterior.to_dataframe, CalibrationReport.to_dataframe, MarkovChainLatentPosterior.to_dataframe, and each type’s to_parquet) construct a real pandas.DataFrame, so they need the library itself. pandas is None when missing and HAS_PANDAS is False, so those methods raise the standard require(...) message at call time instead of an ImportError on import. Install with:

pip install mixle[pandas]

require(name, extra)[source]

Raise a helpful error for a feature that needs an uninstalled extra.

Parameters: