-
Notifications
You must be signed in to change notification settings - Fork 5
/
check_setup.py
executable file
·84 lines (74 loc) · 2.4 KB
/
check_setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python
import os
import sys
def check_for_file(file_name, not_found_message):
if not os.path.exists(file_name):
sys.exit(file_name + ": " + not_found_message)
# Make sure an output directory exists to allow for the export of
# data frames in the notebook
if not os.path.exists("output"):
print("Did not find output directoty, creating one")
os.mkdir("output")
# Check for the notebooks
check_for_file(
"GrowthViz-pediatrics.ipynb",
"Unable to find the GrowthViz Pediatrics Jupyter Notebook.",
)
check_for_file(
"GrowthViz-adults.ipynb", "Unable to find the GrowthViz Adults Jupyter Notebook."
)
# Check for the function library
check_for_file(
"growthviz/charts.py",
"Unable to find visualization library functions for GrowthViz.",
)
check_for_file(
"growthviz/check_data.py",
"Unable to find data checks library functions for GrowthViz.",
)
check_for_file(
"growthviz/compare.py", "Unable to find comparison library functions for GrowthViz."
)
check_for_file(
"growthviz/processdata.py",
"Unable to find data processing library functions for GrowthViz.",
)
check_for_file(
"growthviz/sumstats.py",
"Unable to find summary statistics library functions for GrowthViz.",
)
# Check for the CDC growth charts
check_for_file(
"growthviz-data/ext/bmiagerev.csv",
"Unable to find pediatric CDC growth charts for BMI at age.",
)
check_for_file(
"growthviz-data/ext/statage.csv",
"Unable to find pediatric CDC growth charts for height / stature at age.",
)
check_for_file(
"growthviz-data/ext/wtage.csv",
"Unable to find pediatric CDC growth charts for weight at age.",
)
check_for_file(
"growthviz-data/ext/vdsmeasures.csv",
"Unable to find CDC growth charts for adult weight, height and BMI.",
)
# Check for the example csv files
check_for_file(
"growthviz-data/sample-data-cleaned.csv",
"Unable to find example pediatrics growthcleanr output for comparison.",
)
check_for_file(
"growthviz-data/sample-data-cleaned-with-ue.csv",
"Unable to find example pediatrics growthcleanr output with unit errors turned on for comparison.",
)
check_for_file(
"growthviz-data/sample-adults-data.csv",
"Unable to example adults growthcleanr output.",
)
check_for_file(
"growthviz-data/sample-pediatrics-data.csv",
"Unable to example pediatrics growthcleanr output.",
)
print("GrowthViz appears to be properly set up.")