Skip to content

Commit 10b0c5c

Browse files
committed
rename and add docstrings
1 parent 917c003 commit 10b0c5c

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

qiita_pet/handlers/study_handlers/listing_handlers.py

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,21 @@ def _get_shared_links_for_study(study):
4444

4545

4646
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+
"""
4862
PI = StudyPerson(info['principal_investigator_id'])
4963
status = study.status
5064
if info['pmid'] is not None:
@@ -64,8 +78,27 @@ def _build_single_study_info(study, info):
6478
return info
6579

6680

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+
"""
69102
proc_data_info = []
70103
for pid in study_proc[study.id]:
71104
proc_data = ProcessedData(pid)
@@ -143,8 +176,8 @@ def _build_study_info(user, study_proc=None, proc_samples=None):
143176

144177
study_info = _build_single_study_info(study, info)
145178
# 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)
148181

149182
infolist.append(study_info)
150183
return infolist

0 commit comments

Comments
 (0)