Source code for cellrank.pl._cluster_trends

import logging
import pathlib
import types
from collections.abc import Sequence
from typing import Any

import matplotlib.pyplot as plt
import numpy as np
import scanpy as sc
from anndata import AnnData
from matplotlib.colors import ListedColormap, is_color_like
from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec
from sklearn.preprocessing import StandardScaler

from cellrank._utils import Lineage
from cellrank._utils._docs import d
from cellrank._utils._enum import DEFAULT_BACKEND, Backend_t
from cellrank._utils._parallelize import _get_n_cores
from cellrank._utils._utils import (
    _check_collection,
    _genesymbols,
    _unique_order_preserving,
    save_fig,
)
from cellrank.pl._utils import (
    _callback_type,
    _create_callbacks,
    _create_models,
    _fit_bulk,
    _get_backend,
    _get_sorted_colors,
    _input_model_type,
    _return_model_type,
    _time_range_type,
)

logger = logging.getLogger(__name__)
__all__ = ["cluster_trends"]