Skip to content

Commit bf2cbce

Browse files
committed
Fix two depreciation/future warnings
1 parent a641906 commit bf2cbce

File tree

9 files changed

+15
-21
lines changed

9 files changed

+15
-21
lines changed

dabest/_dabest_object.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,6 @@ def _check_errors(self, x, y, idx, experiment, experiment_label, x1_level):
486486
if x is None:
487487
error_msg = "If `delta2` is True. `x` parameter cannot be None. String or list expected"
488488
raise ValueError(error_msg)
489-
490-
if self.__is_proportional:
491-
mes1 = "Only mean_diff is supported for proportional data when `delta2` is True"
492-
warnings.warn(message=mes1, category=UserWarning)
493489

494490
# idx should not be specified
495491
if idx:

dabest/forest_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def get_kwargs(
223223
"widths": 0.5,
224224
"showextrema": False,
225225
"showmedians": False,
226-
"vert": not horizontal,
226+
"orientation": 'horizontal' if horizontal else 'vertical',
227227
}
228228
if violin_kwargs is None:
229229
violin_kwargs = default_violin_kwargs

dabest/misc_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def get_kwargs(
259259
# Violinplot kwargs.
260260
default_violinplot_kwargs = {
261261
"widths": 0.5,
262-
"vert": 'vertical',
262+
"orientation": 'vertical',
263263
"showextrema": False,
264264
"showmedians": False,
265265

dabest/plot_tools.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ def slopegraph_plotter(
13171317
# Jitter Kwargs
13181318
# With help from GitHub user: devMJBL
13191319
jitter = slopegraph_kwargs.pop("jitter")
1320-
if jitter >= 1:
1320+
if jitter > 1:
13211321
err0 = "Jitter value is too high. Defaulting to 1."
13221322
warnings.warn(err0)
13231323
jitter = 1
@@ -1447,7 +1447,7 @@ def extract_curve_data(dabest_object):
14471447
data, difference, ci_low, ci_high = extract_curve_data(dabest_object)
14481448

14491449
if horizontal:
1450-
violinplot_kwargs.update({'vert': False, 'widths': 1})
1450+
violinplot_kwargs.update({'orientation': 'horizontal', 'widths': 1})
14511451
position = max(rawdata_axes.get_yticks()) + 1
14521452
half = "bottom"
14531453
effsize_x, effsize_y = difference, [position]
@@ -1586,7 +1586,7 @@ def effect_size_curve_plotter(
15861586
def plot_effect_size(tick, group, control, bootstrap, effsize, ci_low, ci_high):
15871587
# Create the violinplot
15881588
if horizontal:
1589-
violinplot_kwargs.update({'vert': False, 'widths': 1})
1589+
violinplot_kwargs.update({'orientation': 'horizontal', 'widths': 1})
15901590

15911591
v = contrast_axes.violinplot(
15921592
bootstrap[~np.isinf(bootstrap)],
@@ -2112,14 +2112,15 @@ def barplotter(
21122112
zorder=1,
21132113
orient=orient,
21142114
)
2115+
21152116
bar2 = sns.barplot(
21162117
data=plot_data,
21172118
x=yvar if horizontal else xvar,
21182119
y=xvar if horizontal else yvar,
2120+
hue=xvar if color_col is None else color_col,
21192121
ax=rawdata_axes,
21202122
order=all_plot_groups,
21212123
palette=plot_palette_bar,
2122-
hue=color_col,
21232124
dodge=False,
21242125
zorder=1,
21252126
orient=orient,

nbs/API/dabest_object.ipynb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,6 @@
591591
" if x is None:\n",
592592
" error_msg = \"If `delta2` is True. `x` parameter cannot be None. String or list expected\"\n",
593593
" raise ValueError(error_msg)\n",
594-
" \n",
595-
" if self.__is_proportional:\n",
596-
" mes1 = \"Only mean_diff is supported for proportional data when `delta2` is True\"\n",
597-
" warnings.warn(message=mes1, category=UserWarning)\n",
598594
"\n",
599595
" # idx should not be specified\n",
600596
" if idx:\n",

nbs/API/forest_plot.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
" \"widths\": 0.5,\n",
283283
" \"showextrema\": False,\n",
284284
" \"showmedians\": False,\n",
285-
" \"vert\": not horizontal,\n",
285+
" \"orientation\": 'horizontal' if horizontal else 'vertical',\n",
286286
" }\n",
287287
" if violin_kwargs is None:\n",
288288
" violin_kwargs = default_violin_kwargs\n",

nbs/API/misc_tools.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
" # Violinplot kwargs.\n",
314314
" default_violinplot_kwargs = {\n",
315315
" \"widths\": 0.5,\n",
316-
" \"vert\": 'vertical',\n",
316+
" \"orientation\": 'vertical',\n",
317317
" \"showextrema\": False,\n",
318318
" \"showmedians\": False,\n",
319319
" \n",

nbs/API/plot_tools.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@
13671367
" # Jitter Kwargs \n",
13681368
" # With help from GitHub user: devMJBL\n",
13691369
" jitter = slopegraph_kwargs.pop(\"jitter\")\n",
1370-
" if jitter >= 1:\n",
1370+
" if jitter > 1:\n",
13711371
" err0 = \"Jitter value is too high. Defaulting to 1.\"\n",
13721372
" warnings.warn(err0)\n",
13731373
" jitter = 1\n",
@@ -1497,7 +1497,7 @@
14971497
" data, difference, ci_low, ci_high = extract_curve_data(dabest_object)\n",
14981498
"\n",
14991499
" if horizontal: \n",
1500-
" violinplot_kwargs.update({'vert': False, 'widths': 1})\n",
1500+
" violinplot_kwargs.update({'orientation': 'horizontal', 'widths': 1})\n",
15011501
" position = max(rawdata_axes.get_yticks()) + 1\n",
15021502
" half = \"bottom\"\n",
15031503
" effsize_x, effsize_y = difference, [position]\n",
@@ -1636,7 +1636,7 @@
16361636
" def plot_effect_size(tick, group, control, bootstrap, effsize, ci_low, ci_high):\n",
16371637
" # Create the violinplot\n",
16381638
" if horizontal: \n",
1639-
" violinplot_kwargs.update({'vert': False, 'widths': 1})\n",
1639+
" violinplot_kwargs.update({'orientation': 'horizontal', 'widths': 1})\n",
16401640
" \n",
16411641
" v = contrast_axes.violinplot(\n",
16421642
" bootstrap[~np.isinf(bootstrap)],\n",
@@ -2162,14 +2162,15 @@
21622162
" zorder=1,\n",
21632163
" orient=orient,\n",
21642164
" )\n",
2165+
"\n",
21652166
" bar2 = sns.barplot(\n",
21662167
" data=plot_data,\n",
21672168
" x=yvar if horizontal else xvar,\n",
21682169
" y=xvar if horizontal else yvar,\n",
2170+
" hue=xvar if color_col is None else color_col,\n",
21692171
" ax=rawdata_axes,\n",
21702172
" order=all_plot_groups,\n",
21712173
" palette=plot_palette_bar,\n",
2172-
" hue=color_col,\n",
21732174
" dodge=False,\n",
21742175
" zorder=1,\n",
21752176
" orient=orient,\n",

nbs/tests/mpl_image_tests/test_05_forest_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def test_513_deltadelta_violinkwargs_forest():
319319
labels=['Drug1', 'Drug2', 'Drug3'],
320320
violin_kwargs={
321321
"widths": 0.8, "showextrema": True,
322-
"showmedians": True, "vert": True
322+
"showmedians": True, "orientation": 'vertical'
323323
}
324324
)
325325

0 commit comments

Comments
 (0)