Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ brings new visualizations, refined plots, and improved accuracy.

You can generate a Whorlmap directly from multi-dimensional DABEST
objects using the `.whorlmap()` method. See the [Whorlmap
tutorial](10-whorlmap.html) for more details.
tutorial](https://acclab.github.io/DABEST-python/tutorials/10-whorlmap.html)
for more details.

2. **Slopegraphs 📈: Enhanced summaries for paired data**

Expand All @@ -52,7 +53,8 @@ brings new visualizations, refined plots, and improved accuracy.
- Customize appearance with `group_summaries_kwargs`.

See the Group Summaries section in the [Plot Aesthetics
tutorial](08-plot_aesthetics.html) for more details.
tutorial](https://acclab.github.io/DABEST-python/tutorials/08-plot_aesthetics.html)
for more details.

3. **Mini-meta Weighted Delta Fix 🧮**

Expand All @@ -69,7 +71,8 @@ brings new visualizations, refined plots, and improved accuracy.
now color contrast bars and effect-size curves.

See the Custom Palette section in the [Plot Aesthetics
tutorial](08-plot_aesthetics.html) for examples.
tutorial](https://acclab.github.io/DABEST-python/tutorials/08-plot_aesthetics.html)
for examples.

Thank you for your continued support!

Expand Down
4 changes: 1 addition & 3 deletions dabest/_dabest_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,12 @@ def _check_errors(self, x, y, idx, experiment, experiment_label, x1_level):
self.__x1_level = x1_level

if self.__is_paired and self.__output_data.isnull().values.any():
warn1 = f"NaN values detected under paired setting and removed,"
warn1 = f"NaN values detected under paired setting,"
warn2 = f" please check your data."
warnings.warn(warn1 + warn2)
if x is not None and y is not None:
rmname = self.__output_data[self.__output_data[y].isnull()][self.__id_col].tolist()
self.__output_data = self.__output_data[~self.__output_data[self.__id_col].isin(rmname)]
elif x is None and y is None:
self.__output_data.dropna(inplace=True)

# Check if there is a typo on paired
if self.__is_paired and self.__is_paired not in ("baseline", "sequential"):
Expand Down
4 changes: 1 addition & 3 deletions nbs/API/dabest_object.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -664,14 +664,12 @@
" self.__x1_level = x1_level\n",
"\n",
" if self.__is_paired and self.__output_data.isnull().values.any():\n",
" warn1 = f\"NaN values detected under paired setting and removed,\"\n",
" warn1 = f\"NaN values detected under paired setting,\"\n",
" warn2 = f\" please check your data.\"\n",
" warnings.warn(warn1 + warn2)\n",
" if x is not None and y is not None:\n",
" rmname = self.__output_data[self.__output_data[y].isnull()][self.__id_col].tolist()\n",
" self.__output_data = self.__output_data[~self.__output_data[self.__id_col].isin(rmname)]\n",
" elif x is None and y is None:\n",
" self.__output_data.dropna(inplace=True)\n",
"\n",
" # Check if there is a typo on paired\n",
" if self.__is_paired and self.__is_paired not in (\"baseline\", \"sequential\"):\n",
Expand Down
6 changes: 3 additions & 3 deletions nbs/read_me.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"\n",
" They are especially useful for large-scale or multi-condition experiments, serving as a **space-efficient alternative to stacked forest plots**.\n",
"\n",
" You can generate a Whorlmap directly from multi-dimensional DABEST objects using the `.whorlmap()` method. See the [Whorlmap tutorial](10-whorlmap.html) for more details.\n",
" You can generate a Whorlmap directly from multi-dimensional DABEST objects using the `.whorlmap()` method. See the [Whorlmap tutorial](https://acclab.github.io/DABEST-python/tutorials/10-whorlmap.html) for more details.\n",
"\n",
"2. **Slopegraphs 📈: Enhanced summaries for paired data**\n",
" \n",
Expand All @@ -55,7 +55,7 @@
" \n",
" - Customize appearance with `group_summaries_kwargs`.\n",
"\n",
" See the Group Summaries section in the [Plot Aesthetics tutorial](08-plot_aesthetics.html) for more details.\n",
" See the Group Summaries section in the [Plot Aesthetics tutorial](https://acclab.github.io/DABEST-python/tutorials/08-plot_aesthetics.html) for more details.\n",
"\n",
"3. **Mini-meta Weighted Delta Fix 🧮**\n",
" \n",
Expand All @@ -69,7 +69,7 @@
" - **Slopegraphs (paired, non-proportional):**\n",
" `custom_palette` can now color contrast bars and effect-size curves.\n",
"\n",
" See the Custom Palette section in the [Plot Aesthetics tutorial](08-plot_aesthetics.html) for examples.\n",
" See the Custom Palette section in the [Plot Aesthetics tutorial](https://acclab.github.io/DABEST-python/tutorials/08-plot_aesthetics.html) for examples.\n",
"\n",
"Thank you for your continued support! \n",
"\n",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions nbs/tests/mpl_image_tests/test_03_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,34 @@ def test_32_multigroups_baseline_change_palette():
plt.rcdefaults()
return multi_groups_baseline.mean_diff.plot(custom_palette="Dark2", delta_text=True)

@pytest.mark.mpl_image_compare(tolerance=8)
def test_33_multi_paired_different_sizes():
# Test for GitHub issue #216: multi-group paired data with different sample sizes
plt.rcdefaults()
np.random.seed(9999)

# Create three test pairs with different sample sizes (20, 10, 40)
c1DF = pd.DataFrame({'Test 1_pre': norm.rvs(loc=3, scale=0.4, size=20)})
t1DF = pd.DataFrame({'Test 1_post': norm.rvs(loc=3.5, scale=0.5, size=20)})
t2DF = pd.DataFrame({'Test 2_pre': norm.rvs(loc=2.5, scale=0.6, size=10)})
t3DF = pd.DataFrame({'Test 2_post': norm.rvs(loc=3, scale=0.75, size=10)})
t4DF = pd.DataFrame({'Test 3_pre': norm.rvs(loc=3.5, scale=0.75, size=40)})
t5DF = pd.DataFrame({'Test 3_post': norm.rvs(loc=3.25, scale=0.4, size=40)})

df = pd.concat([c1DF, t1DF, t2DF, t3DF, t4DF, t5DF], axis=1)
df["ID"] = pd.Series(range(1, len(df)+1))

multi_paired_diff_sizes = load(
df,
idx=(("Test 1_pre", "Test 1_post"),
("Test 2_pre", "Test 2_post"),
("Test 3_pre", "Test 3_post")),
paired="baseline",
id_col="ID"
)

return multi_paired_diff_sizes.mean_diff.plot()

@pytest.mark.mpl_image_compare(tolerance=8)
def test_99_style_sheets():
# Perform this test last so we don't have to reset the plot style.
Expand Down