Skip to content

Commit f17626f

Browse files
committed
Adapt to updated nbdev3
1 parent 869a479 commit f17626f

32 files changed

+671
-84
lines changed

.github/workflows/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ on:
1111
jobs:
1212
deploy:
1313
runs-on: ubuntu-latest
14-
steps: [uses: fastai/workflows/quarto-ghp@master]
14+
steps: [uses: fastai/workflows/quarto-ghp3@master]

.github/workflows/test-nbdev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ on: [workflow_dispatch, pull_request, push]
44
jobs:
55
test-nbdev:
66
runs-on: ubuntu-latest
7-
steps: [uses: fastai/workflows/nbdev-ci@master]
7+
steps: [uses: fastai/workflows/nbdev3-ci@master]

dabest/_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/API/load.ipynb.
44

5-
# %% auto 0
5+
# %% auto #0
66
__all__ = ['load', 'prop_dataset']
77

8-
# %% ../nbs/API/load.ipynb 4
8+
# %% ../nbs/API/load.ipynb #3c3d8162
99
def load(
1010
data,
1111
idx=None,
@@ -112,7 +112,7 @@ def load(
112112
ps_adjust,
113113
)
114114

115-
# %% ../nbs/API/load.ipynb 5
115+
# %% ../nbs/API/load.ipynb #0046e04c
116116
import numpy as np
117117
from typing import Union, Optional
118118
import pandas as pd

dabest/_bootstrap_tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/API/bootstrap.ipynb.
22

3-
# %% auto 0
3+
# %% auto #0
44
__all__ = ['bootstrap', 'jackknife_indexes', 'bca']
55

6-
# %% ../nbs/API/bootstrap.ipynb 3
6+
# %% ../nbs/API/bootstrap.ipynb #4231300f
77
import numpy as np
88
import pandas as pd
99
import seaborn as sns
@@ -12,7 +12,7 @@
1212
from scipy.stats import mannwhitneyu, wilcoxon, norm
1313
import warnings
1414

15-
# %% ../nbs/API/bootstrap.ipynb 4
15+
# %% ../nbs/API/bootstrap.ipynb #e86b4b8d
1616
class bootstrap:
1717
"""
1818
Computes the summary statistic and a bootstrapped confidence interval.
@@ -230,7 +230,7 @@ def __repr__(self):
230230
b = "[{} CI: {}, {}]".format(self.ci, self.bca_ci_low, self.bca_ci_high)
231231
return "\n".join([a, b])
232232

233-
# %% ../nbs/API/bootstrap.ipynb 5
233+
# %% ../nbs/API/bootstrap.ipynb #00c814b9
234234
def jackknife_indexes(data):
235235
# Taken without modification from scikits.bootstrap package.
236236
"""

dabest/_dabest_object.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/API/dabest_object.ipynb.
44

5-
# %% auto 0
5+
# %% auto #0
66
__all__ = ['Dabest']
77

8-
# %% ../nbs/API/dabest_object.ipynb 5
8+
# %% ../nbs/API/dabest_object.ipynb #d3c6f47a
99
# Import standard data science libraries
1010
import warnings
1111
from numpy import array, repeat, random, issubdtype, number
@@ -14,7 +14,7 @@
1414
from scipy.stats import norm
1515
from scipy.stats import randint
1616

17-
# %% ../nbs/API/dabest_object.ipynb 7
17+
# %% ../nbs/API/dabest_object.ipynb #350b12c1
1818
class Dabest(object):
1919

2020
"""

dabest/_delta_objects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/API/delta_objects.ipynb.
44

5-
# %% auto 0
5+
# %% auto #0
66
__all__ = ['DeltaDelta', 'MiniMetaDelta']
77

8-
# %% ../nbs/API/delta_objects.ipynb 5
8+
# %% ../nbs/API/delta_objects.ipynb #af15ef59
99
from scipy.stats import norm
1010
import pandas as pd
1111
import numpy as np
@@ -15,7 +15,7 @@
1515
import warnings
1616
import datetime as dt
1717

18-
# %% ../nbs/API/delta_objects.ipynb 6
18+
# %% ../nbs/API/delta_objects.ipynb #2df37fab
1919
class DeltaDelta(object):
2020
r"""
2121
A class to compute and store the delta-delta statistics for experiments with a 2-by-2 arrangement where two independent variables, A and B, each have two categorical values, 1 and 2. The data is divided into two pairs of two groups, and a primary delta is first calculated as the mean difference between each of the pairs:
@@ -382,7 +382,7 @@ def results(self):
382382
self.__compute_results()
383383
return self.__results
384384

385-
# %% ../nbs/API/delta_objects.ipynb 10
385+
# %% ../nbs/API/delta_objects.ipynb #c3198a65
386386
class MiniMetaDelta(object):
387387
"""
388388
A class to compute and store the weighted delta.

dabest/_effsize_objects.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/API/effsize_objects.ipynb.
44

5-
# %% auto 0
5+
# %% auto #0
66
__all__ = ['TwoGroupsEffectSize', 'EffectSizeDataFrame', 'PermutationTest']
77

8-
# %% ../nbs/API/effsize_objects.ipynb 5
8+
# %% ../nbs/API/effsize_objects.ipynb #2220814e
99
import pandas as pd
1010
import lqrt
1111
from scipy.stats import norm
@@ -23,7 +23,7 @@
2323
from string import Template
2424
import scipy.stats as spstats
2525

26-
# %% ../nbs/API/effsize_objects.ipynb 6
26+
# %% ../nbs/API/effsize_objects.ipynb #083e0298
2727
class TwoGroupsEffectSize(object):
2828

2929
"""
@@ -818,7 +818,7 @@ def bec_pct_high(self):
818818
return self.__bec_pct_high
819819

820820

821-
# %% ../nbs/API/effsize_objects.ipynb 10
821+
# %% ../nbs/API/effsize_objects.ipynb #1f25c41c
822822
class EffectSizeDataFrame(object):
823823
"""A class that generates and stores the results of bootstrapped effect
824824
sizes for several comparisons."""
@@ -1658,7 +1658,7 @@ def delta2(self):
16581658
def is_delta_delta(self):
16591659
return self.__delta2
16601660

1661-
# %% ../nbs/API/effsize_objects.ipynb 29
1661+
# %% ../nbs/API/effsize_objects.ipynb #b9ad9e32
16621662
class PermutationTest:
16631663
"""
16641664
A class to compute and report permutation tests.

dabest/_stats_tools/confint_1group.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/API/confint_1group.ipynb.
44

5-
# %% auto 0
5+
# %% auto #0
66
__all__ = ['create_bootstrap_indexes', 'compute_1group_jackknife', 'compute_1group_acceleration', 'compute_1group_bootstraps',
77
'compute_1group_bias_correction', 'summary_ci_1group']
88

9-
# %% ../../nbs/API/confint_1group.ipynb 4
9+
# %% ../../nbs/API/confint_1group.ipynb #9181f236
1010
import numpy as np
1111
from numpy.random import PCG64, RandomState
1212
from scipy.stats import norm
1313
from numpy import sort as npsort
1414

15-
# %% ../../nbs/API/confint_1group.ipynb 5
15+
# %% ../../nbs/API/confint_1group.ipynb #bac09924
1616
def create_bootstrap_indexes(array, resamples=5000, random_seed=12345):
1717
"""Given an array-like, returns a generator of bootstrap indexes
1818
to be used for resampling.

dabest/_stats_tools/confint_2group_diff.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/API/confint_2group_diff.ipynb.
44

5-
# %% auto 0
5+
# %% auto #0
66
__all__ = ['create_jackknife_indexes', 'create_repeated_indexes', 'compute_meandiff_jackknife', 'bootstrap_indices',
77
'compute_bootstrapped_diff', 'delta2_bootstrap_loop', 'compute_delta2_bootstrapped_diff',
88
'compute_meandiff_bias_correction', 'compute_interval_limits', 'calculate_group_var',
99
'calculate_bootstraps_var', 'calculate_weighted_delta']
1010

11-
# %% ../../nbs/API/confint_2group_diff.ipynb 4
11+
# %% ../../nbs/API/confint_2group_diff.ipynb #fa733643
1212
import numpy as np
1313
from numpy import arange, delete, errstate
1414
from numpy import mean as npmean
@@ -18,7 +18,7 @@
1818
from scipy.stats import norm
1919
from numpy import isnan
2020

21-
# %% ../../nbs/API/confint_2group_diff.ipynb 5
21+
# %% ../../nbs/API/confint_2group_diff.ipynb #8cf9b1fc
2222
@njit(cache=True, parallel=True)
2323
def create_jackknife_indexes(data):
2424
"""

dabest/_stats_tools/effsize.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/API/effsize.ipynb.
44

5-
# %% ../../nbs/API/effsize.ipynb 4
5+
# %% ../../nbs/API/effsize.ipynb #9d92d449
66
from __future__ import annotations
77
import numpy as np
88
from numba import njit
@@ -11,10 +11,10 @@
1111
from scipy.stats import mannwhitneyu
1212

1313

14-
# %% auto 0
14+
# %% auto #0
1515
__all__ = ['two_group_difference', 'func_difference', 'cohens_d', 'cohens_h', 'hedges_g', 'cliffs_delta', 'weighted_delta']
1616

17-
# %% ../../nbs/API/effsize.ipynb 5
17+
# %% ../../nbs/API/effsize.ipynb #0547f8a7
1818
def two_group_difference(control:list|tuple|np.ndarray, #Accepts lists, tuples, or numpy ndarrays of numeric types.
1919
test:list|tuple|np.ndarray, #Accepts lists, tuples, or numpy ndarrays of numeric types.
2020
is_paired=None, #If not None, returns the paired Cohen's d
@@ -99,7 +99,7 @@ def two_group_difference(control:list|tuple|np.ndarray, #Accepts lists, tuples,
9999
return cliffs_delta(control, test)
100100

101101

102-
# %% ../../nbs/API/effsize.ipynb 6
102+
# %% ../../nbs/API/effsize.ipynb #c93f36d4
103103
def func_difference(control:list|tuple|np.ndarray, # NaNs are automatically discarded.
104104
test:list|tuple|np.ndarray, # NaNs are automatically discarded.
105105
func, # Summary function to apply.
@@ -135,7 +135,7 @@ def func_difference(control:list|tuple|np.ndarray, # NaNs are automatically disc
135135
return func(test) - func(control)
136136

137137

138-
# %% ../../nbs/API/effsize.ipynb 7
138+
# %% ../../nbs/API/effsize.ipynb #c6dd20e4
139139
@njit(cache=True)
140140
def cohens_d(control:list|tuple|np.ndarray,
141141
test:list|tuple|np.ndarray,
@@ -210,7 +210,7 @@ def cohens_d(control:list|tuple|np.ndarray,
210210

211211
return M / divisor
212212

213-
# %% ../../nbs/API/effsize.ipynb 8
213+
# %% ../../nbs/API/effsize.ipynb #93688770
214214
# @njit(cache=True) # It uses np.seterr which is not supported by Numba
215215
def cohens_h(control:list|tuple|np.ndarray,
216216
test:list|tuple|np.ndarray
@@ -247,7 +247,7 @@ def cohens_h(control:list|tuple|np.ndarray,
247247
return phi_test - phi_control
248248

249249

250-
# %% ../../nbs/API/effsize.ipynb 9
250+
# %% ../../nbs/API/effsize.ipynb #bcd77c32
251251
def hedges_g(control:list|tuple|np.ndarray,
252252
test:list|tuple|np.ndarray,
253253
is_paired:str=None)->float:
@@ -271,7 +271,7 @@ def hedges_g(control:list|tuple|np.ndarray,
271271
correction_factor = _compute_hedges_correction_factor(len_c, len_t)
272272
return correction_factor * d
273273

274-
# %% ../../nbs/API/effsize.ipynb 10
274+
# %% ../../nbs/API/effsize.ipynb #8fafb111
275275
@njit(cache=True)
276276
def _mann_whitney_u(x, y):
277277
"""Numba-optimized Mann-Whitney U calculation"""
@@ -307,7 +307,7 @@ def cliffs_delta(control:list|tuple|np.ndarray,
307307
return _cliffs_delta_core(c, t)
308308

309309

310-
# %% ../../nbs/API/effsize.ipynb 11
310+
# %% ../../nbs/API/effsize.ipynb #7a772510
311311
@njit(cache=True)
312312
def _compute_standardizers(control, test):
313313
"""
@@ -356,7 +356,7 @@ def _compute_standardizers(control, test):
356356

357357
return pooled, average
358358

359-
# %% ../../nbs/API/effsize.ipynb 12
359+
# %% ../../nbs/API/effsize.ipynb #4529e82c
360360
def _compute_hedges_correction_factor(n1,
361361
n2
362362
)->float:
@@ -390,7 +390,7 @@ def _compute_hedges_correction_factor(n1,
390390

391391
return out
392392

393-
# %% ../../nbs/API/effsize.ipynb 13
393+
# %% ../../nbs/API/effsize.ipynb #249e5375
394394
@njit(cache=True)
395395
def weighted_delta(difference, bootstrap_dist_var):
396396
'''

0 commit comments

Comments
 (0)