Skip to content

Commit bf1ee8b

Browse files
committed
Made review changes
1 parent eee780d commit bf1ee8b

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

scripts/1-fetch/smithsonian_fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def query_smithsonian(args, session):
219219
" API key is set in .env",
220220
1,
221221
)
222-
LOGGER.info("Fetch CC0 metrics and units from units from Smithsonain")
222+
LOGGER.info("Fetch CC0 metrics and units from units from Smithsonian")
223223
url = "https://api.si.edu/openaccess/api/v1.0/stats"
224224
params = {"api_key": DATA_GOV_API_KEY}
225225
try:

scripts/2-process/smithsonian_process.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ def process_totals_by_records(args, count_data):
109109
CC0_records_with_CC0_media = int(row.CC0_RECORDS_WITH_CC0_MEDIA)
110110
total_objects = int(row.TOTAL_OBJECTS)
111111

112-
if CC0_records == 0 and CC0_records_with_CC0_media == 0:
113-
continue
114-
115112
if unit not in data:
116113
data[unit] = {
117114
"CC0_records": 0,

scripts/3-report/smithsonian_report.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def plot_totals_by_top10_units(args):
179179
" distribution of top 10 institute member across"
180180
" Smithsonian Institute with an average of"
181181
f" {average_unit:,} objects across the top 10"
182-
"Institute members.",
182+
" Institute members.",
183183
)
184184

185185

@@ -244,13 +244,15 @@ def plot_totals_by_records(args):
244244
)
245245
LOGGER.info(f"data file: {file_path.replace(PATHS['repo'], '.')}")
246246
name_label = "Unit_name"
247+
data_label = "Total_objects"
247248
stack_labels = [
248249
"CC0_without_media_percentage",
249250
"CC0_with_media_percentage",
250251
"Others_percentage",
251252
]
252253
data = shared.open_data_file(LOGGER, file_path, index_col=name_label)
253-
data = data.head(10)
254+
data.sort_values(data_label, ascending=True, inplace=True)
255+
data = data.tail(10)
254256
title = "Totals by records"
255257
plt = plot.stacked_barh_plot(
256258
args=args,
@@ -275,7 +277,7 @@ def plot_totals_by_records(args):
275277
title,
276278
image_path,
277279
"Plots showing totals by CC0 records. This is the"
278-
" breakdown of top 10 records with highest CC0 records"
280+
" top 10 records with a breakdown of CC0 records"
279281
" without media, CC0 records with media and records"
280282
" that are not associated with CC0.",
281283
)

0 commit comments

Comments
 (0)