Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/test-pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
cache: "pip"
cache-dependency-path: settings.ini
- name: Run pytest
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,50 @@

<!-- do not remove -->

## v2025.03.14

### New Features

- **Horizontal Plots**: This new feature allows users to create horizontal plots instead of the regular vertical plots, providing a more compact visualization of data. This can be utilized by setting `horizontal=True` in the `plot()` method.

- **Forest Plots**: This new feature allows users to create forest plots! Forest plots provide a simple and intuitive way to visualize many delta-delta (or Deltas' g) or mini-meta effect sizes at once from multiple different dabest objects without presenting the raw data.

- **Gridkey**: This new feature allows users to create a gridkey to represent the labels of the groups in the plot. This can be utilized with the `gridkey_rows` argument in the `plot()` method.

- **Aesthetic Updates**: We have made several aesthetic improvements to the plots, including:
- **Swarm, Contrast, and Summary bars**: We have added bars to better highlight the various groups and their differences. These bars can be customized to suit the user's needs. The swarm and contrast bars are provided by default, while the summary bars can be added by the user.

- **Delta-Delta Plots**: We have modified the delta-delta plot format to be more compact and easier to read. The new format brings the delta-delta (or Deltas' g) effect size closer to the regular effect sizes. In addition, a gap has been added to the zeroline to separate the delta-delta and regular effect sizes.

- **Delta-delta Effect Sizes for Proportion Plots**: Delta-delta effect sizes for proportion plots are now available.

- **Mini-Meta Plots**: We have modified the mini-meta plot format to be more compact and easier to read. The new format brings the mini-meta effect size closer to the regular effect sizes.

- **Proportion Plots Sample Sizes**: We have updated the proportion plots to show sample sizes for each group. These can be toggled on or off via the `prop_sample_counts` parameter.

- **Effect Size Lines for Paired Plots**: Effect size lines for paired plots are now available. These can be toggled on or off via the `es_paired_lines` parameter.

- **Baseline Error Curves**: Plots now include a baseline error dot and curve to show the error of the baseline/control group. By default, the dot is shown, while the curve can be added by the user (via the `show_baseline_ec` parameter).

- **Delta Text**: There is now an option to display delta text on the contrast axes. It displays the effect size of the contrast group relative to the reference group. This can be toggled on or off via the `delta_text` parameter. It is on by default.

- **Empty Circle Color Palette**: A new swarmplot color palette modification is available for unpaired plots via the `empty_circle` parameter in the `plot()` method. This option modifies the two-group swarmplots to have empty circles for the control group and filled circles for the experimental group.

### Enhancement

- **Python 3.13 Support**: DABEST now supports Python 3.10-3.13.

- **Numba for Speed Improvements**: We have included Numba to speed up the various calculations in DABEST. This should make the calculations faster and more efficient. Importing DABEST may take a little longer than before, and a progress bar will appear during the import process to show the calculations being performed. Once imported, loading and plotting data should now be faster.

- **Terminology Updates**: We have made several updates to the documentation and terminology to improve clarity and consistency. For example:
- The method to utilise the Deltas' g effect size is now via the `.hedges_g.plot()` method now rather than creating a whole new `Delta_g` object as before. The functionality remains the same, it plots hedges_g effect sizes and then the Deltas' g effect size alongside these (if a delta-delta experiment was loaded correctly).

- **Updated Tutorial Pages**: We have updated the tutorial pages to reflect the new features and changes. The tutorial pages are now more comprehensive and hopefully more intuitive!.

- **Results Dataframe for Delta-delta and Mini-meta Plots**: A results dataframe can now be extracted for both the delta-delta and mini-meta effect size data (similar to the results dataframe for the regular effect sizes). These can be found via the `.results` attribute of the `.delta_delta` or `.mini_meta` object.



## v2024.03.29

### New Features
Expand Down
149 changes: 111 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

[![minimal Python
version](https://img.shields.io/badge/Python%3E%3D-3.9-6666ff.svg)](https://www.anaconda.com/distribution/)
version](https://img.shields.io/badge/Python%3E%3D-3.10-6666ff.svg)](https://www.anaconda.com/distribution/)
[![PyPI
version](https://badge.fury.io/py/dabest.svg)](https://badge.fury.io/py/dabest)
[![Downloads](https://img.shields.io/pepy/dt/dabest.svg)](https://pepy.tech/project/dabest)
Expand All @@ -14,37 +14,110 @@ citation](https://zenodo.org/badge/DOI/10.1038/s41592-019-0470-3.svg)](https://r

## Recent Version Update

We are proud to announce **DABEST Version Ondeh (v2024.03.29)**. This
new version of the DABEST Python library provides several new features
and includes performance improvements.

1. **New Paired Proportion Plot**: This feature builds upon the
existing proportional analysis capabilities by introducing advanced
aesthetics and clearer visualization of changes in proportions
between different groups, inspired by the informative nature of
Sankey Diagrams. It’s particularly useful for studies that require
detailed examination of how proportions shift in paired
observations.

2. **Customizable Swarm Plot**: Enhancements allow for tailored swarm
plot aesthetics, notably the adjustment of swarm sides to produce
asymmetric swarm plots. This customization enhances data
representation, making visual distinctions more pronounced and
interpretations clearer.

3. **Standardized Delta-delta Effect Size**: We added a new metric akin
to a Hedges’ g for delta-delta effect size, which allows comparisons
between delta-delta effects generated from metrics with different
units.

4. **Miscellaneous Improvements**: This version also encompasses a
broad range of miscellaneous enhancements, including bug fixes,
Bootstrapping speed improvements, new templates for raising issues,
and updated unit tests. These improvements are designed to
streamline the user experience, increase the software’s stability,
and expand its versatility. By addressing user feedback and
identified issues, DABEST continues to refine its functionality and
reliability.
We are proud to announce **DABEST Version TBC (v2025.03.14)** This new
version of the DABEST Python library provides several new features and
includes performance improvements. It’s a big one!

1. **Python 3.13 Support**: DABEST now supports Python 3.10-3.13.

2. **Horizontal Plots**: This new feature allows users to create
horizontal plots instead of the regular vertical plots, providing a
more compact visualization of data. This can be utilized by setting
`horizontal=True` in the `plot()` method. See the [Horizontal
Plots](../tutorials/08-horizontal_plot.html) tutorial for more
details.

3. **Forest Plots**: This new feature allows users to create forest
plots! Forest plots provide a simple and intuitive way to visualize
many delta-delta (or Deltas’ g) or mini-meta effect sizes at once
from multiple different dabest objects without presenting the raw
data. See the [Forest Plots](../tutorials/07-forest_plot.html)
tutorial for more details.

4. **Gridkey**: This new feature allows users to create a gridkey to
represent the labels of the groups in the plot. This can be utilized
with the `gridkey_rows` argument in the `plot()` method. See the
gridkey section in the [Plot
Aesthetics](../tutorials/09-plot_aesthetics.html) tutorial for more
details.

5. **Aesthetic Updates**: We have made several aesthetic improvements
to the plots, including:

- **Swarm, Contrast, and Summary bars**: We have added bars to
better highlight the various groups and their differences. These
bars can be customized to suit the user’s needs. The swarm and
contrast bars are provided by default, while the summary bars can
be added by the user. See the relevant sections in the [Plot
Aesthetics](../tutorials/09-plot_aesthetics.html) tutorial for
more details.

- **Delta-Delta Plots**: We have modified the delta-delta plot
format to be more compact and easier to read. The new format
brings the delta-delta (or Deltas’ g) effect size closer to the
regular effect sizes. In addition, a gap has been added to the
zeroline to separate the delta-delta and regular effect sizes.

- **Delta-delta Effect Sizes for Proportion Plots**: Delta-delta
effect sizes for proportion plots are now available.

- **Mini-Meta Plots**: We have modified the mini-meta plot format to
be more compact and easier to read. The new format brings the
mini-meta effect size closer to the regular effect sizes.

- **Proportion Plots Sample Sizes**: We have updated the proportion
plots to show sample sizes for each group. These can be toggled on
or off via the `prop_sample_counts` parameter.

- **Effect Size Lines for Paired Plots**: Effect size lines for
paired plots are now available. These can be toggled on or off via
the `es_paired_lines` parameter.

- **Baseline Error Curves**: Plots now include a baseline error dot
and curve to show the error of the baseline/control group. By
default, the dot is shown, while the curve can be added by the
user (via the `show_baseline_ec` parameter).

- **Delta Text**: There is now an option to display delta text on
the contrast axes. It displays the effect size of the contrast
group relative to the reference group. This can be toggled on or
off via the `delta_text` parameter. It is on by default.

- **Empty Circle Color Palette**: A new swarmplot color palette
modification is available for unpaired plots via the
`empty_circle` parameter in the `plot()` method. This option
modifies the two-group swarmplots to have empty circles for the
control group and filled circles for the experimental group.

6. **Miscellaneous Improvements & Adjustments**

- **Numba for Speed Improvements**: We have included Numba to speed
up the various calculations in DABEST. This should make the
calculations faster and more efficient. Importing DABEST may take
a little longer than before, and a progress bar will appear during
the import process to show the calculations being performed. Once
imported, loading and plotting data should now be faster.

- **Terminology Updates**: We have made several updates to the
documentation and terminology to improve clarity and consistency.
For example:

- The method to utilise the Deltas’ g effect size is now via the
`.hedges_g.plot()` method now rather than creating a whole new
`Delta_g` object as before. The functionality remains the same,
it plots hedges_g effect sizes and then the Deltas’ g effect
size alongside these (if a delta-delta experiment was loaded
correctly).

- **Updated Tutorial Pages**: We have updated the tutorial pages to
reflect the new features and changes. The tutorial pages are now
more comprehensive and hopefully more intuitive!.

- **Results Dataframe for Delta-delta and Mini-meta Plots**: A
results dataframe can now be extracted for both the delta-delta
and mini-meta effect size data (similar to the results dataframe
for the regular effect sizes). These can be found via the
`.results` attribute of the `.delta_delta` or `.mini_meta` object.

## Contents

Expand Down Expand Up @@ -92,7 +165,7 @@ allowing everyone access to high-quality estimation plots.

## Installation

This package is tested on Python 3.8 and onwards. It is highly
This package is tested on Python 3.10 and onwards. It is highly
recommended to download the [Anaconda
distribution](https://www.continuum.io/downloads) of Python in order to
obtain the dependencies easily.
Expand Down Expand Up @@ -161,17 +234,17 @@ page](https://github.com/ACCLAB/DABEST-python/issues/new).
## Contributing

All contributions are welcome; please read the [Guidelines for
contributing](CONTRIBUTING.md) first.
contributing](../CONTRIBUTING.md) first.

We also have a [Code of Conduct](CODE_OF_CONDUCT.md) to foster an
We also have a [Code of Conduct](../CODE_OF_CONDUCT.md) to foster an
inclusive and productive space.

### A wish list for new features

If you have any specific comments and ideas for new features that you
would like to share with us, please read the [Guidelines for
contributing](CONTRIBUTING.md), create a new issue using Feature request
template or create a new post in [our Google
contributing](../CONTRIBUTING.md), create a new issue using Feature
request template or create a new post in [our Google
Group](https://groups.google.com/g/estimationstats).

## Acknowledgements
Expand All @@ -198,7 +271,7 @@ The test suite ensures that the bootstrapping functions and the plotting
functions perform as expected.

For detailed information, please refer to the [test
folder](nbs/tests/README.md)
folder](../nbs/tests/README.md)

## DABEST in other languages

Expand Down
2 changes: 1 addition & 1 deletion dabest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
if not _NUMBA_COMPILED:
precompile_all()

__version__ = "2024.03.30"
__version__ = "2025.03.14"
2 changes: 1 addition & 1 deletion dabest/_delta_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# %% ../nbs/API/delta_objects.ipynb 6
class DeltaDelta(object):
"""
r"""
A class to compute and store the delta-delta statistics for experiments with a 2-by-2 arrangement where two independent variables, A and B, each have two categorical values, 1 and 2. The data is divided into two pairs of two groups, and a primary delta is first calculated as the mean difference between each of the pairs:
Expand Down
2 changes: 1 addition & 1 deletion dabest/forest_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def get_kwargs(
"widths": 0.5,
"showextrema": False,
"showmedians": False,
"vert": not horizontal
"vert": not horizontal,
}
if violin_kwargs is None:
violin_kwargs = default_violin_kwargs
Expand Down
2 changes: 1 addition & 1 deletion dabest/misc_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def get_kwargs(
# Violinplot kwargs.
default_violinplot_kwargs = {
"widths": 0.5,
"vert": True,
"vert": 'vertical',
"showextrema": False,
"showmedians": False,

Expand Down
2 changes: 1 addition & 1 deletion dabest/plot_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,7 @@ def _swarm(
bad_x_offsets.append(True)
else:
bad_x_offsets.append(False)
potential_x_offsets[bad_x_offsets] = np.infty
potential_x_offsets[bad_x_offsets] = np.inf
abs_potential_x_offsets = [abs(_) for _ in potential_x_offsets]
valid_x_offset = potential_x_offsets[
abs_potential_x_offsets.index(min(abs_potential_x_offsets))
Expand Down
1 change: 0 additions & 1 deletion dabest/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def effectsize_df_plotter(effectsize_df: object, **plot_kwargs) -> matplotlib.fi
set_xaxis_ticks_and_lims,
show_legend,
gardner_altman_adjustments,
# Cumming_Plot_Aesthetic_Adjustments,
extract_group_summaries,
draw_zeroline,
redraw_dependent_spines,
Expand Down
13 changes: 7 additions & 6 deletions nbs/01-getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,16 @@
"source": [
"\n",
"\n",
"Python 3.10 is strongly recommended. DABEST has also been tested with Python 3.8 and onwards.\n",
"Python 3.11 is strongly recommended. DABEST has also been tested with Python 3.10 and onwards.\n",
"\n",
"In addition, the following packages are also required (listed with their minimal versions):\n",
"\n",
"* [numpy 1.23.5](https://www.numpy.org)\n",
"* [scipy 1.9.3](https://www.scipy.org)\n",
"* [matplotlib 3.6.3](https://www.matplotlib.org)\n",
"* [pandas 1.5.0](https://pandas.pydata.org)\n",
"* [seaborn 0.12.2](https://seaborn.pydata.org)\n",
"* [numpy 2.1.3](https://www.numpy.org)\n",
"* [scipy 1.15.2](https://www.scipy.org)\n",
"* [matplotlib 3.10.0](https://www.matplotlib.org)\n",
"* [pandas 2.2.3](https://pandas.pydata.org)\n",
"* [seaborn 0.13.2](https://seaborn.pydata.org)\n",
"* [numba 0.61.0](https://numba.pydata.org)\n",
"* [lqrt 0.3.3](https://github.com/alyakin314/lqrt)\n",
"\n",
"To obtain these package dependencies easily, it is highly recommended to download the [Anaconda](https://www.continuum.io/downloads) distribution of Python.\n"
Expand Down
8 changes: 8 additions & 0 deletions nbs/02-about.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"\n",
"DABEST is written in Python by [Joses W. Ho](https://twitter.com/jacuzzijo), with design and input from [Adam Claridge-Chang](https://twitter.com/adamcchang) and other [lab members](https://www.claridgechang.net/people.html).\n",
"\n",
"Features in v2025.03.14 were added by [Jonathan Anns](https://github.com/JAnns98), [Zinan Lu](https://github.com/Jacobluke-), [Kah Seng Lian](https://github.com/sunroofgod), and [Lucas Wang Zhuoyu](https://github.com/Lucas1213WZY).\n",
"\n",
"Features in v2024.03.29 were added by [Zinan Lu](https://github.com/Jacobluke-), [Kah Seng Lian](https://github.com/sunroofgod), [Ana Rosa Castillo](https://github.com/cyberosa).\n",
"\n",
"Features in v2023.02.14 were added by [Yixuan Li](https://github.com/LI-Yixuan), [Zinan Lu](https://github.com/Jacobluke-) and [Rou Zhang](https://github.com/ZHANGROU-99).\n",
Expand Down Expand Up @@ -83,6 +85,12 @@
"POSSIBILITY OF SUCH DAMAGE.\n",
"</div>\n"
]
},
{
"cell_type": "markdown",
"id": "e1dcfc63",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion nbs/API/delta_objects.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"source": [
"#| export\n",
"class DeltaDelta(object):\n",
" \"\"\"\n",
" r\"\"\"\n",
" A class to compute and store the delta-delta statistics for experiments with a 2-by-2 arrangement where two independent variables, A and B, each have two categorical values, 1 and 2. The data is divided into two pairs of two groups, and a primary delta is first calculated as the mean difference between each of the pairs:\n",
"\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/API/forest_plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
" \"widths\": 0.5,\n",
" \"showextrema\": False,\n",
" \"showmedians\": False,\n",
" \"vert\": not horizontal\n",
" \"vert\": not horizontal,\n",
" }\n",
" if violin_kwargs is None:\n",
" violin_kwargs = default_violin_kwargs\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/API/misc_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
" # Violinplot kwargs.\n",
" default_violinplot_kwargs = {\n",
" \"widths\": 0.5,\n",
" \"vert\": True,\n",
" \"vert\": 'vertical',\n",
" \"showextrema\": False,\n",
" \"showmedians\": False,\n",
" \n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/API/plot_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,7 @@
" bad_x_offsets.append(True)\n",
" else:\n",
" bad_x_offsets.append(False)\n",
" potential_x_offsets[bad_x_offsets] = np.infty\n",
" potential_x_offsets[bad_x_offsets] = np.inf\n",
" abs_potential_x_offsets = [abs(_) for _ in potential_x_offsets]\n",
" valid_x_offset = potential_x_offsets[\n",
" abs_potential_x_offsets.index(min(abs_potential_x_offsets))\n",
Expand Down
Loading