Skip to content

Commit e5fbe1e

Browse files
committed
Remove useless precompilation, update new images, adapt new pandas parameters
1 parent 940d783 commit e5fbe1e

112 files changed

Lines changed: 8 additions & 17 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dabest/_dabest_object.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(
112112
# Determine the kind of estimation plot we need to produce.
113113
if all([isinstance(i, (str, int, float)) for i in idx]):
114114
# flatten out idx.
115-
all_plot_groups = pd.unique([t for t in idx]).tolist()
115+
all_plot_groups = pd.unique(pd.Series(idx)).tolist()
116116
if len(idx) > len(all_plot_groups):
117117
err0 = "`idx` contains duplicated groups. Please remove any duplicates and try again."
118118
raise ValueError(err0)
@@ -122,7 +122,7 @@ def __init__(
122122
self.__idx = (idx,)
123123

124124
elif all([isinstance(i, (tuple, list)) for i in idx]):
125-
all_plot_groups = pd.unique([tt for t in idx for tt in t]).tolist()
125+
all_plot_groups = pd.unique(pd.Series([tt for t in idx for tt in t])).tolist()
126126

127127
actual_groups_given = sum([len(i) for i in idx])
128128

dabest/_delta_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def __init__(self, effectsizedataframe, permutation_count,
388388
# compute the variances of each control group and each test group
389389
control_var=[]
390390
test_var=[]
391-
grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar)}
391+
grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar, observed=False)}
392392
for j, current_tuple in enumerate(idx):
393393
cname = current_tuple[0]
394394
control = grouped_data[cname]

dabest/_effsize_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ def __pre_calc(self):
731731
out = []
732732
reprs = []
733733

734-
grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar)}
734+
grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar, observed=False)}
735735
if self.__delta2:
736736
mixed_data = []
737737
for j, current_tuple in enumerate(idx):

nbs/API/dabest_object.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
" # Determine the kind of estimation plot we need to produce.\n",
181181
" if all([isinstance(i, (str, int, float)) for i in idx]):\n",
182182
" # flatten out idx.\n",
183-
" all_plot_groups = pd.unique([t for t in idx]).tolist()\n",
183+
" all_plot_groups = pd.unique(pd.Series(idx)).tolist()\n",
184184
" if len(idx) > len(all_plot_groups):\n",
185185
" err0 = \"`idx` contains duplicated groups. Please remove any duplicates and try again.\"\n",
186186
" raise ValueError(err0)\n",
@@ -190,7 +190,7 @@
190190
" self.__idx = (idx,)\n",
191191
"\n",
192192
" elif all([isinstance(i, (tuple, list)) for i in idx]):\n",
193-
" all_plot_groups = pd.unique([tt for t in idx for tt in t]).tolist()\n",
193+
" all_plot_groups = pd.unique(pd.Series([tt for t in idx for tt in t])).tolist()\n",
194194
"\n",
195195
" actual_groups_given = sum([len(i) for i in idx])\n",
196196
"\n",

nbs/API/delta_objects.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
" # compute the variances of each control group and each test group\n",
529529
" control_var=[]\n",
530530
" test_var=[]\n",
531-
" grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar)}\n",
531+
" grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar, observed=False)}\n",
532532
" for j, current_tuple in enumerate(idx):\n",
533533
" cname = current_tuple[0]\n",
534534
" control = grouped_data[cname]\n",

nbs/API/effsize_objects.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@
890890
" out = []\n",
891891
" reprs = []\n",
892892
"\n",
893-
" grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar)}\n",
893+
" grouped_data = {name: group[yvar].copy() for name, group in dat.groupby(xvar, observed=False)}\n",
894894
" if self.__delta2:\n",
895895
" mixed_data = []\n",
896896
" for j, current_tuple in enumerate(idx):\n",
-51 Bytes
-45 Bytes
1 Byte
77 Bytes

0 commit comments

Comments
 (0)