Skip to content

Module streamgen

๐Ÿ๐Ÿ“ฆ a framework and implementation for simulating stream datasets.

View Source
"""๐Ÿ๐Ÿ“ฆ a framework and implementation for simulating stream datasets."""

import importlib

from beartype import beartype

EXTRAS = {

    "examples": ["perlin_numpy", "polars", "ipymlp"],

    "cl": [

        # "avalanche",

        "continuum",

    ],

    "all": [

        "perlin_numpy",

        "polars",

        "ipympl",

        "avalanche",

        "continuum",

    ],

}

"""๐Ÿงพ Dictionary mapping pip EXTRAS to their corresponding dependencies.

This dictionary has to stay in sync with `[tool.poetry.EXTRAS]` in `pyproject.toml`.

"""

@beartype

def is_extra_installed(extra: str) -> bool:

    """๐Ÿ“ฆโ“ check if setuptools/pip extra is installed in the current Python environment.

    Args:

        extra (str): name of the extra.

    Returns:

        bool: True if extra is installed.

    """

    return all(importlib.util.find_spec(package) is not None for package in EXTRAS[extra])

Sub-modules

Variables

EXTRAS

๐Ÿงพ Dictionary mapping pip EXTRAS to their corresponding dependencies.

This dictionary has to stay in sync with [tool.poetry.EXTRAS] in pyproject.toml.

Functions

is_extra_installed

def is_extra_installed(
    extra: str
) -> bool

๐Ÿ“ฆโ“ check if setuptools/pip extra is installed in the current Python environment.

Parameters:

Name Type Description Default
extra str name of the extra. None

Returns:

Type Description
bool True if extra is installed.
View Source
@beartype

def is_extra_installed(extra: str) -> bool:

    """๐Ÿ“ฆโ“ check if setuptools/pip extra is installed in the current Python environment.

    Args:

        extra (str): name of the extra.

    Returns:

        bool: True if extra is installed.

    """

    return all(importlib.util.find_spec(package) is not None for package in EXTRAS[extra])