Skip to content

Commit 16eb1fb

Browse files
authored
Merge pull request #20 from josesho/v0.1.7
v0.1.7
2 parents 67e9672 + 0f2bb55 commit 16eb1fb

File tree

13 files changed

+44
-53
lines changed

13 files changed

+44
-53
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ install:
3434
- conda update conda --yes
3535
- conda create -n testenv --yes pip python=$PYTHON matplotlib
3636
- source activate testenv
37-
- pip install pytest==3.7
37+
- pip install pytest==4.0
3838
- pip install .
3939

4040
script: pytest

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ DABEST powers [estimationstats.com](https://www.estimationstats.com/), allowing
2222

2323
DABEST has been tested on Python 2.7, 3.5, 3.6, and 3.7.
2424

25+
_Python 2.7 will no longer be supported from dabest v0.2.0 onwards, as [Python 2.7 will no longer be supported after January 1 2020](https://python3statement.org/)._ dabest v.0.2.0 is under development, and will be released before the end of 2019.
26+
2527
In addition, the following packages are also required:
2628
- [numpy](https://www.numpy.org) (1.15)
2729
- [scipy](https://www.scipy.org) (1.1)

dabest/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from ._api import plot
22
from ._bootstrap_tools import bootstrap
33

4-
__version__="0.1.6"
4+
__version__="0.1.7"

dabest/_api.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def plot(
3434
ci_linewidth=3,
3535
summary_linewidth=3,
3636
multiplot_horizontal_spacing=0.75,
37+
cumming_vertical_spacing=0.1,
3738
font_scale=1,
3839
dpi=100,
3940
tick_length=10,
@@ -170,6 +171,12 @@ def plot(
170171
this determines the horizontal spacing between each plot. This
171172
number is a fraction of the axes width.
172173
174+
cumming_vertical_spacing: float, default 0.05
175+
The amount of height reserved for space between the swarmplot and
176+
the contrast plots, expressed as a fraction of the average axis
177+
height.
178+
179+
173180
font_scale: float, default 1.
174181
The font size will be scaled by this number. This value is passed
175182
on to seaborn.set().
@@ -529,6 +536,12 @@ def plot(
529536
else:
530537
ws = 0
531538

539+
# Set appropriate vertical spacing between subplots,
540+
# based on whether the contrast is floating.
541+
if float_contrast is False:
542+
hs = cumming_vertical_spacing
543+
else:
544+
hs = 0
532545

533546
# infer the figsize.
534547
if color_col is None:
@@ -553,7 +566,7 @@ def plot(
553566
if fig_size is None:
554567
fig_size = fsize
555568

556-
gridspecs = {'width_ratios': widthratio, 'wspace' : ws, 'hspace': 0}
569+
gridspecs = {'width_ratios': widthratio, 'wspace' : ws, 'hspace': hs}
557570
subplots_args = {'ncols': ncols, 'figsize':fig_size, 'dpi':dpi,
558571
'gridspec_kw': gridspecs}
559572

dabest/_bootstrap_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class bootstrap:
3030
3131
alpha: float, default 0.05
3232
Denotes the likelihood that the confidence interval produced
33-
_does not_ include the true summary statistic. When alpha = 0.05,
33+
does not include the true summary statistic. When alpha = 0.05,
3434
a 95% confidence interval is produced.
3535
3636
reps: int, default 5000

dabest/tests/test_bootstrap.py

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616

17-
@pytest.fixture
1817
def create_dummy_dataset(seed=None, n=30, base_mean=0, expt_groups=6,
1918
scale_means=2, scale_std=1.2):
2019
"""
@@ -53,58 +52,39 @@ def create_dummy_dataset(seed=None, n=30, base_mean=0, expt_groups=6,
5352
return random_seed, max_mean_diff, df
5453

5554

56-
@pytest.fixture
5755
def is_difference(result):
5856
assert result.is_difference == True
5957

60-
61-
@pytest.fixture
6258
def is_paired(result):
6359
assert result.is_paired == True
6460

65-
66-
@pytest.fixture
6761
def check_pvalue_1samp(result):
6862
assert result.pvalue_1samp_ttest != 'NIL'
6963

70-
71-
@pytest.fixture
7264
def check_pvalue_2samp_unpaired(result):
7365
assert result.pvalue_2samp_ind_ttest != 'NIL'
7466

75-
76-
@pytest.fixture
7767
def check_pvalue_2samp_paired(result):
7868
assert result.pvalue_2samp_related_ttest != 'NIL'
7969

80-
81-
@pytest.fixture
8270
def check_mann_whitney(result):
8371
"""Nonparametric unpaired"""
8472
assert result.pvalue_mann_whitney != 'NIL'
8573
assert result.pvalue_wilcoxon == 'NIL'
8674

87-
88-
@pytest.fixture
8975
def check_wilcoxon(result):
9076
"""Nonparametric Paired"""
9177
assert result.pvalue_wilcoxon != 'NIL'
9278
assert result.pvalue_mann_whitney == 'NIL'
9379

80+
# def test_mean_within_ci_bca(mean, result):
81+
# assert mean >= result.bca_ci_low
82+
# assert mean <= result.bca_ci_high
83+
#
84+
# def test_mean_within_ci_pct(mean, result):
85+
# assert mean >= result.pct_ci_low
86+
# assert mean <= result.pct_ci_high
9487

95-
@pytest.fixture
96-
def test_mean_within_ci_bca(mean, result):
97-
assert mean >= result.bca_ci_low
98-
assert mean <= result.bca_ci_high
99-
100-
101-
@pytest.fixture
102-
def test_mean_within_ci_pct(mean, result):
103-
assert mean >= result.pct_ci_low
104-
assert mean <= result.pct_ci_high
105-
106-
107-
@pytest.fixture
10888
def single_samp_stat_tests(sample, result):
10989

11090
assert result.is_difference == False
@@ -113,8 +93,6 @@ def single_samp_stat_tests(sample, result):
11393
ttest_result = sp.stats.ttest_1samp(sample, 0).pvalue
11494
assert result.pvalue_1samp_ttest == pytest.approx(ttest_result)
11595

116-
117-
@pytest.fixture
11896
def unpaired_stat_tests(control, expt, result):
11997
is_difference(result)
12098
check_pvalue_2samp_unpaired(result)
@@ -130,8 +108,6 @@ def unpaired_stat_tests(control, expt, result):
130108
alternative='two-sided').pvalue
131109
assert result.pvalue_mann_whitney == pytest.approx(mann_whitney_result)
132110

133-
134-
@pytest.fixture
135111
def paired_stat_tests(control, expt, result):
136112
is_difference(result)
137113
is_paired(result)
@@ -146,9 +122,7 @@ def paired_stat_tests(control, expt, result):
146122
wilcoxon_result = sp.stats.wilcoxon(control, expt).pvalue
147123
assert result.pvalue_wilcoxon == pytest.approx(wilcoxon_result)
148124

149-
150-
@pytest.fixture
151-
def does_ci_captures_mean_diff(control, expt, paired, nreps=100, alpha=0.05):
125+
def does_ci_capture_mean_diff(control, expt, paired, nreps=100, alpha=0.05):
152126
if expt is None:
153127
mean_diff = control.mean()
154128
else:
@@ -206,7 +180,7 @@ def test_single_sample_bootstrap(mean=100, sd=10, n=25, nreps=100, alpha=0.05):
206180
results = bst.bootstrap(sample, alpha_level=alpha)
207181
single_samp_stat_tests(sample, results)
208182

209-
does_ci_captures_mean_diff(sample, None, False, nreps, alpha)
183+
does_ci_capture_mean_diff(sample, None, False, nreps, alpha)
210184

211185

212186

@@ -225,7 +199,7 @@ def test_unpaired_difference(mean=100, sd=10, n=25, nreps=100, alpha=0.05):
225199
results = bst.bootstrap(sample1, sample2, paired=False, alpha_level=alpha)
226200
unpaired_stat_tests(sample1, sample2, results)
227201

228-
does_ci_captures_mean_diff(sample1, sample2, False, nreps, alpha)
202+
does_ci_capture_mean_diff(sample1, sample2, False, nreps, alpha)
229203

230204

231205

@@ -248,4 +222,4 @@ def test_paired_difference(mean=100, sd=10, n=25, nreps=100, alpha=0.05):
248222
results = bst.bootstrap(sample1, sample2, alpha_level=alpha, paired=True)
249223
paired_stat_tests(sample1, sample2, results)
250224

251-
does_ci_captures_mean_diff(sample1, sample2, True, nreps, alpha)
225+
does_ci_capture_mean_diff(sample1, sample2, True, nreps, alpha)

dabest/tests/test_plotting.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from .. import _api
1515

1616

17-
# Fixtures.
18-
@pytest.fixture
1917
def create_dummy_dataset(seed=None, n=30, base_mean=0, expt_groups=6,
2018
scale_means=2, scale_std=1.2):
2119
"""
@@ -56,7 +54,6 @@ def create_dummy_dataset(seed=None, n=30, base_mean=0, expt_groups=6,
5654

5755

5856

59-
@pytest.fixture
6057
def get_swarm_yspans(coll, round_result=False, decimals=12):
6158
"""
6259
Given a matplotlib Collection, will obtain the y spans
File renamed without changes.

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
# The short X.Y version.
5858
version = '0.1'
5959
# The full version, including alpha/beta/rc tags.
60-
release = '0.1.5'
60+
release = '0.1.7'
6161

6262
# The language for content autogenerated by Sphinx. Refer to documentation
6363
# for a list of supported languages.

docs/source/index.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,32 @@ DABEST
88
-----------------------------------------------
99
Data Analysis with Bootstrap-coupled ESTimation
1010
-----------------------------------------------
11-
*version 0.1.6*
11+
*version 0.1.7*
1212

1313
Analyze your data with effect sizes!
1414

1515
.. image:: _images/showpiece.png
1616

17+
1718
News
1819
----
20+
January 2019
21+
- Release of v0.1.7. *Added `cumming_vertical_spacing` option.* See the :doc:`release-notes`.
22+
1923
October 2018
2024
- Release of v0.1.6. *Added more keywords for control of plot elements.* See the :doc:`release-notes`.
2125

22-
2326
July 2018
2427
- Release of v0.1.5. *bugfix for setup and package management*
2528
- Release of v0.1.4.
2629

27-
2830
June 2018
2931
- Release of v0.1.3.
30-
- Added a short tutorial :doc:`dabest-r`!
3132

3233
December 2017
3334
- We have made a `webapp <https://www.estimationstats.com>`_ that produces Gardner-Altman and Cumming plots!
3435

36+
3537
Contents
3638
--------
3739

@@ -41,7 +43,6 @@ Contents
4143
background
4244
getting-started
4345
tutorial
44-
dabest-r
4546
release-notes
4647
about
4748
api

0 commit comments

Comments
 (0)