Skip to content

Commit cd48026

Browse files
authored
Merge pull request #34 from brain-image-library/26-genotype-frequency
Update get.py
2 parents eefec85 + c091496 commit cd48026

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

braininventory/get.py

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
def today():
88
"""
9-
Get today's snapshot of Brain Image Library.
10-
"""
9+
Get today's snapshot of Brain Image Library.
10+
"""
1111

1212
server = "https://download.brainimagelibrary.org/inventory/daily/reports/"
1313
filename = "today.json"
@@ -54,9 +54,11 @@ def __get_contributor(df):
5454
def __get_affilation(df):
5555
return df["affiliation"].value_counts().to_dict()
5656

57+
5758
def __get_awards(df):
5859
return df["award_number"].unique()
5960

61+
6062
def __get_award_number(df):
6163
return df["award_number"].value_counts().to_dict()
6264

@@ -69,12 +71,18 @@ def __get_cnbtaxonomy(df):
6971
return df["cnbtaxonomy"].value_counts().to_dict()
7072

7173

72-
def __get_samplelocalid(df):
73-
return df["samplelocalid"].value_counts().to_dict()
74+
def __get_genotypes(df):
75+
"""
76+
Write documentation here.
77+
"""
78+
return df["genotype"].unique()
7479

7580

76-
def __get_genotype(df):
77-
return df["genotype"].value_counts().to_dict()
81+
def __get_genotype_frequency(df):
82+
"""
83+
Write documentation here.
84+
"""
85+
return df["genotypes"].value_counts().to_dict()
7886

7987

8088
def __get_generalmodality(df):
@@ -88,41 +96,35 @@ def __get_technique(df):
8896
def __get_locations(df):
8997
return df["locations"].value_counts().to_dict()
9098

99+
91100
def __get_contributors(df):
92101
"""
93102
This returns an array of contributor names from the contributorname column.
94103
"""
95104
return df["contributorname"].unique()
96105

97106

98-
def __get_project_names(df):
99-
'''
100-
Gets the unique list of project names.
101-
102-
Input: dataframe
103-
Output: list
104-
'''
105-
return df['project'].unique()
106-
107107
def __get_list_of_projects(df):
108-
'''
108+
"""
109109
Get the list of names for unique projects
110110
111111
Input parameter: dataframe
112112
Output: list of projects
113-
'''
114-
115-
return df['project'].unique().to_dict()
113+
"""
114+
115+
return df["project"].unique().to_dict()
116+
116117

117118
def __get_number_of_projects(df):
118-
'''
119+
"""
119120
Get the number of unique projects
120121
121122
Input parameter: dataframe
122123
Output: number of projects
123-
'''
124-
125-
return len(df['project'].unique())
124+
"""
125+
126+
return len(df["project"].unique())
127+
126128

127129
def report():
128130
# Get today's date

0 commit comments

Comments
 (0)