diff --git a/README.md b/README.md index 37a8f29a..7fd79e06 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## Recent Version Update -**✨ DABEST “Bingka” v2025.10.20 for Python is now released! ✨** +**✨ DABEST "Bingka" v2025.10.20 for Python is now released! ✨** Dear DABEST users, The latest version of the DABEST Python library brings new visualizations, refined plots, and improved accuracy. @@ -20,7 +20,7 @@ The latest version of the DABEST Python library brings new visualizations, refin Introducing **Whorlmap**, a new way to visualize effect sizes from multiple comparisons in a compact, grid-based format. - Whorlmaps condense information from the full bootstrap distributions of many contrast objects into a **2D heatmap-style grid of “whorled” cells**. This provides an overview of the entire dataset while preserving the underlying distributional detail. + Whorlmaps condense information from the full bootstrap distributions of many contrast objects into a **2D heatmap-style grid of "whorled" cells**. This provides an overview of the entire dataset while preserving the underlying distributional detail. They are especially useful for large-scale or multi-condition experiments, serving as a **space-efficient alternative to stacked forest plots**. diff --git a/dabest/misc_tools.py b/dabest/misc_tools.py index 4060b7ca..8b4c09ab 100644 --- a/dabest/misc_tools.py +++ b/dabest/misc_tools.py @@ -546,6 +546,7 @@ def get_color_palette( # Create color palette that will be shared across subplots. color_col = plot_kwargs["color_col"] + if color_col is None: color_groups = pd.unique(plot_data[xvar]) bootstraps_color_by_group = True @@ -556,12 +557,22 @@ def get_color_palette( bootstraps_color_by_group = False if show_pairs: if plot_kwargs["custom_palette"] is not None: - if delta2 or sankey: + if delta2: + bootstraps_color_by_group = False + elif sankey: bootstraps_color_by_group = False else: - bootstraps_color_by_group = True + if color_col is None: + color_groups = pd.unique(plot_data[xvar]) + bootstraps_color_by_group = True + else: + if color_col not in plot_data.columns: + raise KeyError("``{}`` is not a column in the data.".format(color_col)) + color_groups = pd.unique(plot_data[color_col]) + bootstraps_color_by_group = False else: bootstraps_color_by_group = False + # Handle the color palette. filled = True diff --git a/nbs/API/misc_tools.ipynb b/nbs/API/misc_tools.ipynb index 3e28644e..c8e97c67 100644 --- a/nbs/API/misc_tools.ipynb +++ b/nbs/API/misc_tools.ipynb @@ -597,6 +597,7 @@ "\n", " # Create color palette that will be shared across subplots.\n", " color_col = plot_kwargs[\"color_col\"]\n", + "\n", " if color_col is None:\n", " color_groups = pd.unique(plot_data[xvar])\n", " bootstraps_color_by_group = True\n", @@ -607,12 +608,22 @@ " bootstraps_color_by_group = False\n", " if show_pairs:\n", " if plot_kwargs[\"custom_palette\"] is not None:\n", - " if delta2 or sankey:\n", + " if delta2:\n", + " bootstraps_color_by_group = False\n", + " elif sankey:\n", " bootstraps_color_by_group = False\n", " else:\n", - " bootstraps_color_by_group = True\n", + " if color_col is None:\n", + " color_groups = pd.unique(plot_data[xvar])\n", + " bootstraps_color_by_group = True\n", + " else:\n", + " if color_col not in plot_data.columns:\n", + " raise KeyError(\"``{}`` is not a column in the data.\".format(color_col))\n", + " color_groups = pd.unique(plot_data[color_col])\n", + " bootstraps_color_by_group = False \n", " else:\n", " bootstraps_color_by_group = False\n", + " \n", "\n", " # Handle the color palette.\n", " filled = True\n", diff --git a/pyproject.toml b/pyproject.toml index 533ba62c..289d1cf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dev = ['pytest~=8.3.4', 'pytest-mpl~=0.17.0'] version = {attr = "dabest.__version__"} [tool.setuptools.packages.find] -include = ["dabest"] +include = ["dabest", "dabest.*"] [tool.nbdev] branch = 'master'