Skip to content

Commit 5473344

Browse files
committed
informative error for identical values
1 parent 3718ec9 commit 5473344

6 files changed

Lines changed: 20 additions & 12 deletions

File tree

dabest/_bootstrap_tools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ def __init__(
113113
wilcoxonresult = wilcoxon(x1, x2)[1]
114114
except ValueError as e:
115115
warnings.warn("Wilcoxon test could not be performed. This might be due "
116-
"to identical values under the same group. "
117-
"Details: {}".format(e))
116+
"to no variability in the difference of the paired groups. \n"
117+
"Error: {}\n"
118+
"For detailed information, please refer to https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html "
119+
.format(e))
118120
mannwhitneyresult = "NIL"
119121

120122
# Turns data into array, then tuple.

dabest/_delta_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def __repr__(self, header=True, sigfig=3):
555555
bs = bs1 + bs2
556556

557557
pval_def1 = "Any p-value reported is the probability of observing the" + \
558-
"effect size (or greater),\nassuming the null hypothesis of" + \
558+
"effect size (or greater),\nassuming the null hypothesis of " + \
559559
"zero difference is true."
560560
pval_def2 = "\nFor each p-value, 5000 reshuffles of the " + \
561561
"control and test labels were performed."

dabest/_effsize_objects.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def __repr__(self, show_resample_count=True, define_pval=True, sigfig=3):
219219

220220
pval_def1 = (
221221
"Any p-value reported is the probability of observing the"
222-
+ "effect size (or greater),\nassuming the null hypothesis of"
222+
+ "effect size (or greater),\nassuming the null hypothesis of "
223223
+ "zero difference is true."
224224
)
225225
pval_def2 = (
@@ -335,8 +335,10 @@ def _perform_statistical_test(self):
335335
self.__statistic_wilcoxon = wilcoxon.statistic
336336
except ValueError as e:
337337
warnings.warn("Wilcoxon test could not be performed. This might be due "
338-
"to identical values under the same group. "
339-
"Details: {}".format(e))
338+
"to no variability in the difference of the paired groups. \n"
339+
"Error: {}\n"
340+
"For detailed information, please refer to https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html "
341+
.format(e))
340342

341343
if self.__effect_size != "median_diff":
342344
# Paired Student's t-test.

nbs/API/bootstrap.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@
161161
" wilcoxonresult = wilcoxon(x1, x2)[1]\n",
162162
" except ValueError as e:\n",
163163
" warnings.warn(\"Wilcoxon test could not be performed. This might be due \"\n",
164-
" \"to identical values under the same group. \"\n",
165-
" \"Details: {}\".format(e))\n",
164+
" \"to no variability in the difference of the paired groups. \\n\"\n",
165+
" \"Error: {}\\n\"\n",
166+
" \"For detailed information, please refer to https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html \"\n",
167+
" .format(e))\n",
166168
" mannwhitneyresult = \"NIL\"\n",
167169
"\n",
168170
" # Turns data into array, then tuple.\n",

nbs/API/delta_objects.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@
697697
" bs = bs1 + bs2\n",
698698
"\n",
699699
" pval_def1 = \"Any p-value reported is the probability of observing the\" + \\\n",
700-
" \"effect size (or greater),\\nassuming the null hypothesis of\" + \\\n",
700+
" \"effect size (or greater),\\nassuming the null hypothesis of \" + \\\n",
701701
" \"zero difference is true.\"\n",
702702
" pval_def2 = \"\\nFor each p-value, 5000 reshuffles of the \" + \\\n",
703703
" \"control and test labels were performed.\"\n",

nbs/API/effsize_objects.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"\n",
282282
" pval_def1 = (\n",
283283
" \"Any p-value reported is the probability of observing the\"\n",
284-
" + \"effect size (or greater),\\nassuming the null hypothesis of\"\n",
284+
" + \"effect size (or greater),\\nassuming the null hypothesis of \"\n",
285285
" + \"zero difference is true.\"\n",
286286
" )\n",
287287
" pval_def2 = (\n",
@@ -397,8 +397,10 @@
397397
" self.__statistic_wilcoxon = wilcoxon.statistic\n",
398398
" except ValueError as e:\n",
399399
" warnings.warn(\"Wilcoxon test could not be performed. This might be due \"\n",
400-
" \"to identical values under the same group. \"\n",
401-
" \"Details: {}\".format(e))\n",
400+
" \"to no variability in the difference of the paired groups. \\n\"\n",
401+
" \"Error: {}\\n\"\n",
402+
" \"For detailed information, please refer to https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html \"\n",
403+
" .format(e))\n",
402404
"\n",
403405
" if self.__effect_size != \"median_diff\":\n",
404406
" # Paired Student's t-test.\n",

0 commit comments

Comments
 (0)