@@ -44,7 +44,21 @@ def _get_shared_links_for_study(study):
44
44
45
45
46
46
def _build_single_study_info (study , info ):
47
- # Clean up and add to the study info for HTML purposes
47
+ """Clean up and add to the study info for HTML purposes
48
+
49
+ Parameters
50
+ ----------
51
+ study : Study object
52
+ The study to build information for
53
+ info : dict
54
+ Information from Study.get_info
55
+
56
+ Returns
57
+ -------
58
+ dict
59
+ info-information + extra information for the study,
60
+ slightly HTML formatted
61
+ """
48
62
PI = StudyPerson (info ['principal_investigator_id' ])
49
63
status = study .status
50
64
if info ['pmid' ] is not None :
@@ -64,8 +78,27 @@ def _build_single_study_info(study, info):
64
78
return info
65
79
66
80
67
- def _build_proc_data_info (study , study_proc , proc_samples ):
68
- # Build the proc data info list for the child row in datatable
81
+ def _build_single_proc_data_info (study , study_proc , proc_samples ):
82
+ """Build the proc data info list for the child row in datatable
83
+
84
+
85
+ Parameters
86
+ ----------
87
+ study : Study object
88
+ The study to build information for
89
+ study_proc : dict of lists
90
+ The processed data attached to he study, in the form
91
+ {study_id: [proc_data_id, proc_data_id, ...], ...}
92
+ proc_samples : dict of lists
93
+ The samples available in the processed data, in the form
94
+ {proc_data_id: [samp1, samp2, ...], ...}
95
+
96
+ Returns
97
+ -------
98
+ dict of dicts
99
+ The information for the processed data, in the form
100
+ {proc_data_id: {info: value, ...}, ...}
101
+ """
69
102
proc_data_info = []
70
103
for pid in study_proc [study .id ]:
71
104
proc_data = ProcessedData (pid )
@@ -143,8 +176,8 @@ def _build_study_info(user, study_proc=None, proc_samples=None):
143
176
144
177
study_info = _build_single_study_info (study , info )
145
178
# Build the proc data info list for the child row in datatable
146
- study_info ["proc_data_info" ] = _build_proc_data_info ( study , study_proc ,
147
- proc_samples )
179
+ study_info ["proc_data_info" ] = _build_single_proc_data_info (
180
+ study , study_proc , proc_samples )
148
181
149
182
infolist .append (study_info )
150
183
return infolist
0 commit comments