From b6a02f0dba7cee9cf7fb91a73357e52c7224960e Mon Sep 17 00:00:00 2001 From: Jacobluke- Date: Tue, 16 Apr 2024 11:10:20 +0800 Subject: [PATCH 1/4] Fixed some docstring issues --- dabest/plotter.py | 36 ------------ nbs/API/plotter.ipynb | 80 +++++++++++++------------- nbs/tutorials/03-proportion_plot.ipynb | 2 +- nbs/tutorials/04-mini_meta_delta.ipynb | 2 +- 4 files changed, 43 insertions(+), 77 deletions(-) diff --git a/dabest/plotter.py b/dabest/plotter.py index fcd65ee5..f0a72f85 100644 --- a/dabest/plotter.py +++ b/dabest/plotter.py @@ -17,42 +17,6 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs): """ Custom function that creates an estimation plot from an EffectSizeDataFrame. - Keywords - -------- - Parameters - ---------- - effectsize_df - A `dabest` EffectSizeDataFrame object. - plot_kwargs - color_col=None - raw_marker_size=6, es_marker_size=9, - swarm_label=None, contrast_label=None, delta2_label=None, - swarm_ylim=None, contrast_ylim=None, delta2_ylim=None, - custom_palette=None, swarm_desat=0.5, halfviolin_desat=1, - halfviolin_alpha=0.8, - face_color = None, - bar_label=None, bar_desat=0.8, bar_width = 0.5,bar_ylim = None, - ci=None, ci_type='bca', err_color=None, - float_contrast=True, - show_pairs=True, - show_delta2=True, - group_summaries=None, - group_summaries_offset=0.1, - fig_size=None, - dpi=100, - ax=None, - gridkey_rows=None, - swarmplot_kwargs=None, - violinplot_kwargs=None, - slopegraph_kwargs=None, - sankey_kwargs=None, - reflines_kwargs=None, - group_summary_kwargs=None, - legend_kwargs=None, - title=None, fontsize_title=16, - fontsize_rawxlabel=12, fontsize_rawylabel=12, - fontsize_contrastxlabel=12, fontsize_contrastylabel=12, - fontsize_delta2label=12 """ from .misc_tools import merge_two_dicts from .plot_tools import ( diff --git a/nbs/API/plotter.ipynb b/nbs/API/plotter.ipynb index 7e054ea4..c120d9b6 100644 --- a/nbs/API/plotter.ipynb +++ b/nbs/API/plotter.ipynb @@ -76,42 +76,6 @@ "def effectsize_df_plotter(effectsize_df, **plot_kwargs):\n", " \"\"\"\n", " Custom function that creates an estimation plot from an EffectSizeDataFrame.\n", - " Keywords\n", - " --------\n", - " Parameters\n", - " ----------\n", - " effectsize_df\n", - " A `dabest` EffectSizeDataFrame object.\n", - " plot_kwargs\n", - " color_col=None\n", - " raw_marker_size=6, es_marker_size=9,\n", - " swarm_label=None, contrast_label=None, delta2_label=None,\n", - " swarm_ylim=None, contrast_ylim=None, delta2_ylim=None,\n", - " custom_palette=None, swarm_desat=0.5, halfviolin_desat=1,\n", - " halfviolin_alpha=0.8,\n", - " face_color = None,\n", - " bar_label=None, bar_desat=0.8, bar_width = 0.5,bar_ylim = None,\n", - " ci=None, ci_type='bca', err_color=None,\n", - " float_contrast=True,\n", - " show_pairs=True,\n", - " show_delta2=True,\n", - " group_summaries=None,\n", - " group_summaries_offset=0.1,\n", - " fig_size=None,\n", - " dpi=100,\n", - " ax=None,\n", - " gridkey_rows=None,\n", - " swarmplot_kwargs=None,\n", - " violinplot_kwargs=None,\n", - " slopegraph_kwargs=None,\n", - " sankey_kwargs=None,\n", - " reflines_kwargs=None,\n", - " group_summary_kwargs=None,\n", - " legend_kwargs=None,\n", - " title=None, fontsize_title=16,\n", - " fontsize_rawxlabel=12, fontsize_rawylabel=12,\n", - " fontsize_contrastxlabel=12, fontsize_contrastylabel=12,\n", - " fontsize_delta2label=12\n", " \"\"\"\n", " from .misc_tools import merge_two_dicts\n", " from .plot_tools import (\n", @@ -1665,11 +1629,49 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "id": "7355251f", "metadata": {}, - "outputs": [], + "source": [ + "For details on how to control the aesthetic of the generated estimation plot by modifying the **plot_kwargs**, please refer to [Controlling Plot Aesthetics](../tutorials/06-plot_aesthetics.ipynb)\n", + "\n", + "- **effectsize_df**: A `dabest` `EffectSizeDataFrame` object.\n", + "- **plot_kwargs**:\n", + " - color_col=None\n", + " - raw_marker_size=6, es_marker_size=9,\n", + " - swarm_label=None, contrast_label=None, delta2_label=None,\n", + " - swarm_ylim=None, contrast_ylim=None, delta2_ylim=None,\n", + " - custom_palette=None, swarm_desat=0.5, halfviolin_desat=1,\n", + " - halfviolin_alpha=0.8,\n", + " - face_color = None,\n", + " - bar_label=None, bar_desat=0.8, bar_width = 0.5,bar_ylim = None,\n", + " - ci=None, ci_type='bca', err_color=None,\n", + " - float_contrast=True,\n", + " - show_pairs=True,\n", + " - show_delta2=True,\n", + " - group_summaries=None,\n", + " - group_summaries_offset=0.1,\n", + " - fig_size=None,\n", + " - dpi=100,\n", + " - ax=None,\n", + " - gridkey_rows=None,\n", + " - swarmplot_kwargs=None,\n", + " - violinplot_kwargs=None,\n", + " - slopegraph_kwargs=None,\n", + " - sankey_kwargs=None,\n", + " - reflines_kwargs=None,\n", + " - group_summary_kwargs=None,\n", + " - egend_kwargs=None,\n", + " - title=None, fontsize_title=16,\n", + " - fontsize_rawxlabel=12, fontsize_rawylabel=12,\n", + " - fontsize_contrastxlabel=12, fontsize_contrastylabel=12,\n", + " - fontsize_delta2label=12" + ] + }, + { + "cell_type": "markdown", + "id": "f1cc27d4", + "metadata": {}, "source": [] } ], diff --git a/nbs/tutorials/03-proportion_plot.ipynb b/nbs/tutorials/03-proportion_plot.ipynb index 3ec2f34e..ffaa1ccb 100644 --- a/nbs/tutorials/03-proportion_plot.ipynb +++ b/nbs/tutorials/03-proportion_plot.ipynb @@ -452,7 +452,7 @@ "To generate a proportion plot, the **dabest** library features two effect sizes:\n", "\n", " - the mean difference (``mean_diff``)\n", - " - [Cohen's h](https://en.wikipedia.org/wiki/Cohen%27s_h) (``cohens_h``)\n", + " - [Cohen's h](https://en.wikipedia.org/wiki/Cohen's_h) (`cohens_h`)\n", "\n", "These are attributes of the ``Dabest`` object." ] diff --git a/nbs/tutorials/04-mini_meta_delta.ipynb b/nbs/tutorials/04-mini_meta_delta.ipynb index 595432d9..dcac4a8e 100644 --- a/nbs/tutorials/04-mini_meta_delta.ipynb +++ b/nbs/tutorials/04-mini_meta_delta.ipynb @@ -47,7 +47,7 @@ "\n", "Additionally, be aware that as of v2023.02.14, DABEST can only compute weighted effect size *for mean difference only*, and not for standardized measures such as Cohen's *d*.\n", "\n", - "For more information on meta-analysis, please refer to Chapter 10 of the Cochrane handbook: https://training.cochrane.org/handbook/current/chapter-10\n" + "For more information on meta-analysis, please refer to [Chapter 10 of the Cochrane handbook](https://training.cochrane.org/handbook/current/chapter-10)" ] }, { From 4bf8313182659ce9e67eed9a4307c1368c365611 Mon Sep 17 00:00:00 2001 From: Jacobluke- Date: Mon, 3 Jun 2024 15:43:11 +0800 Subject: [PATCH 2/4] Fix link reference error --- dabest/_stats_tools/effsize.py | 2 +- nbs/API/effsize.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dabest/_stats_tools/effsize.py b/dabest/_stats_tools/effsize.py index 32f965b1..bb941389 100644 --- a/dabest/_stats_tools/effsize.py +++ b/dabest/_stats_tools/effsize.py @@ -221,7 +221,7 @@ def cohens_h(control:list|tuple|np.ndarray, )->float: ''' Computes Cohen's h for test v.s. control. - See [here](https://en.wikipedia.org/wiki/Cohen%27s_h for reference.) + See [here](https://en.wikipedia.org/wiki/Cohen%27s_h) for reference. `Notes`: diff --git a/nbs/API/effsize.ipynb b/nbs/API/effsize.ipynb index b2232515..9d8dc5d2 100644 --- a/nbs/API/effsize.ipynb +++ b/nbs/API/effsize.ipynb @@ -301,7 +301,7 @@ " )->float:\n", " '''\n", " Computes Cohen's h for test v.s. control.\n", - " See [here](https://en.wikipedia.org/wiki/Cohen%27s_h for reference.)\n", + " See [here](https://en.wikipedia.org/wiki/Cohen%27s_h) for reference.\n", " \n", " `Notes`:\n", " \n", From f8b955ca9ee193c2f7a52f748db1d5a8158e386b Mon Sep 17 00:00:00 2001 From: Jacobluke- Date: Mon, 23 Sep 2024 15:41:40 +0800 Subject: [PATCH 3/4] Update readme min Python badge --- README.md | 24 ++++++++++++++---------- nbs/read_me.ipynb | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e8966a6f..0319939c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![minimal Python -version](https://img.shields.io/badge/Python%3E%3D-3.8-6666ff.svg)](https://www.anaconda.com/distribution/) +version](https://img.shields.io/badge/Python%3E%3D-3.9-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) @@ -49,15 +49,19 @@ and includes performance improvements. -- [About](#about) -- [Installation](#installation) -- [Usage](#usage) -- [How to cite](#how-to-cite) -- [Bugs](#bugs) -- [Contributing](#contributing) -- [Acknowledgements](#acknowledgements) -- [Testing](#testing) -- [DABEST in other languages](#dabest-in-other-languages) +- [DABEST-Python](#dabest-python) + - [Recent Version Update](#recent-version-update) + - [Contents](#contents) + - [About](#about) + - [Installation](#installation) + - [Usage](#usage) + - [How to cite](#how-to-cite) + - [Bugs](#bugs) + - [Contributing](#contributing) + - [A wish list for new features](#a-wish-list-for-new-features) + - [Acknowledgements](#acknowledgements) + - [Testing](#testing) + - [DABEST in other languages](#dabest-in-other-languages) diff --git a/nbs/read_me.ipynb b/nbs/read_me.ipynb index 216b7426..3812368c 100644 --- a/nbs/read_me.ipynb +++ b/nbs/read_me.ipynb @@ -13,7 +13,7 @@ "id": "5164f940", "metadata": {}, "source": [ - "[![minimal Python version](https://img.shields.io/badge/Python%3E%3D-3.8-6666ff.svg)](https://www.anaconda.com/distribution/)\n", + "[![minimal Python version](https://img.shields.io/badge/Python%3E%3D-3.9-6666ff.svg)](https://www.anaconda.com/distribution/)\n", "[![PyPI version](https://badge.fury.io/py/dabest.svg)](https://badge.fury.io/py/dabest)\n", "[![Downloads](https://img.shields.io/pepy/dt/dabest.svg\n", ")](https://pepy.tech/project/dabest)\n", From 8e278d11ca984edbeb1046c228d59391d7015b83 Mon Sep 17 00:00:00 2001 From: Jacobluke- Date: Tue, 24 Sep 2024 15:01:47 +0800 Subject: [PATCH 4/4] Fix README.md table of content --- README.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0319939c..1779b8e5 100644 --- a/README.md +++ b/README.md @@ -49,19 +49,15 @@ and includes performance improvements. -- [DABEST-Python](#dabest-python) - - [Recent Version Update](#recent-version-update) - - [Contents](#contents) - - [About](#about) - - [Installation](#installation) - - [Usage](#usage) - - [How to cite](#how-to-cite) - - [Bugs](#bugs) - - [Contributing](#contributing) - - [A wish list for new features](#a-wish-list-for-new-features) - - [Acknowledgements](#acknowledgements) - - [Testing](#testing) - - [DABEST in other languages](#dabest-in-other-languages) +- [About](#about) +- [Installation](#installation) +- [Usage](#usage) +- [How to cite](#how-to-cite) +- [Bugs](#bugs) +- [Contributing](#contributing) +- [Acknowledgements](#acknowledgements) +- [Testing](#testing) +- [DABEST in other languages](#dabest-in-other-languages)