Skip to content

Commit 749758e

Browse files
committed
2 parents 5ee1153 + 9daeee0 commit 749758e

79 files changed

Lines changed: 1313 additions & 518 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.

dev/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ services:
5050
- db
5151

5252
woken_db_setup:
53-
image: "hbpmip/woken-db-setup:1.1.0"
53+
image: "hbpmip/woken-db-setup:1.2.1"
5454
container_name: "woken-db-setup"
5555
restart: "no"
5656
environment:

java-rapidminer-knn/tests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ services:
4848
- db
4949

5050
woken_db_setup:
51-
image: "hbpmip/woken-db-setup:1.1.0"
51+
image: "hbpmip/woken-db-setup:1.2.1"
5252
container_name: "woken-db-setup"
5353
restart: "no"
5454
environment:

java-rapidminer-naivebayes/tests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ services:
4848
- db
4949

5050
woken_db_setup:
51-
image: "hbpmip/woken-db-setup:1.1.0"
51+
image: "hbpmip/woken-db-setup:1.2.1"
5252
container_name: "woken-db-setup"
5353
restart: "no"
5454
environment:

python-anova/.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.4.3
2+
current_version = 0.4.4
33
commit = True
44
tag = True
55
tag_name = python-anova-{new_version}

python-anova/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ FROM hbpmip/python-mip:0.6.1
2121

2222
MAINTAINER mirco.nasuti@chuv.ch
2323

24-
ENV DOCKER_IMAGE=hbpmip/python-anova:0.4.3 \
24+
ENV DOCKER_IMAGE=hbpmip/python-anova:0.4.4 \
2525
FUNCTION=python-anova
2626

2727
COPY requirements.txt /requirements.txt

python-anova/anova.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ def format_output(statsmodels_dict):
6969
def compute_anova(dep_var, indep_vars, data, design='factorial'):
7070
formula = generate_formula(dep_var, indep_vars, design)
7171
logging.info("Formula: %s" % formula)
72-
lm = ols(data=DataFrame(data), formula=formula).fit()
72+
data = DataFrame(data)
73+
74+
if data.empty:
75+
raise errors.UserError('SQL returned no data, check your dataset and null values.')
76+
77+
lm = ols(data=data, formula=formula).fit()
7378
logging.info(lm.summary())
7479
return anova_lm(lm)
7580

python-anova/tests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ services:
4848
- db
4949

5050
woken_db_setup:
51-
image: "hbpmip/woken-db-setup:1.1.0"
51+
image: "hbpmip/woken-db-setup:1.2.1"
5252
container_name: "woken-db-setup"
5353
restart: "no"
5454
environment:
Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import pytest
2-
from anova import generate_formula
2+
import mock
3+
import json
4+
from anova import generate_formula, main
35
from mip_helper import errors
6+
from mip_helper import testing as t
47

58

69
def test_generate_formula():
@@ -9,3 +12,52 @@ def test_generate_formula():
912
indep_vars = [{'name': str(i)} for i in range(10)]
1013
with pytest.raises(errors.UserError):
1114
generate_formula(dep_var, indep_vars, 'factorial')
15+
16+
17+
@mock.patch('anova.io_helper.fetch_data')
18+
@mock.patch('anova.io_helper.save_results')
19+
def test_main(mock_save_results, mock_fetch_data):
20+
mock_fetch_data.return_value = t.inputs_regression(include_nominal=False)
21+
main()
22+
result = json.loads(mock_save_results.call_args[0][0])
23+
assert t.round_dict(result) == {
24+
'Residual': {
25+
'F': 'NaN',
26+
'PR(>F)': 'NaN',
27+
'df': 1.0,
28+
'mean_sq': 0.019,
29+
'sum_sq': 0.019
30+
},
31+
'minimentalstate': {
32+
'F': 12.831,
33+
'PR(>F)': 0.173,
34+
'df': 1.0,
35+
'mean_sq': 0.248,
36+
'sum_sq': 0.248
37+
},
38+
'subjectage': {
39+
'F': 0.958,
40+
'PR(>F)': 0.507,
41+
'df': 1.0,
42+
'mean_sq': 0.019,
43+
'sum_sq': 0.019
44+
},
45+
'subjectage:minimentalstate': {
46+
'F': 0.096,
47+
'PR(>F)': 0.808,
48+
'df': 1.0,
49+
'mean_sq': 0.002,
50+
'sum_sq': 0.002
51+
}
52+
}
53+
54+
55+
@mock.patch('anova.io_helper.fetch_data')
56+
@mock.patch('anova.io_helper.save_error')
57+
@mock.patch('sys.exit')
58+
def test_main_empty_input(mock_exit, mock_save_error, mock_fetch_data):
59+
mock_fetch_data.return_value = t.inputs_regression(limit_to=0)
60+
main()
61+
62+
mock_exit.assert_called_once_with(1)
63+
mock_save_error.assert_called_once()
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.3.0
2+
current_version = 0.4.0
33
commit = True
44
tag = True
55
tag_name = python-correlation-heatmap-{new_version}
@@ -8,3 +8,5 @@ serialize = {major}.{minor}.{patch}
88

99
[bumpversion:file:Dockerfile]
1010

11+
[bumpversion:file:Dockerfile.pca]
12+

python-correlation-heatmap/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FROM hbpmip/python-mip:0.6.1
2020

2121
MAINTAINER mirco.nasuti@chuv.ch
2222

23-
ENV DOCKER_IMAGE=hbpmip/python-correlation-heatmap:0.3.0 \
23+
ENV DOCKER_IMAGE=hbpmip/python-correlation-heatmap:0.4.0 \
2424
FUNCTION=python-correlation-heatmap
2525

2626
COPY requirements.txt /requirements.txt

0 commit comments

Comments
 (0)