@@ -150,7 +150,7 @@ def plot_totals_by_top10_units(args):
150150 data .sort_values (data_label , ascending = True , inplace = True )
151151 data = data .tail (10 )
152152 average_unit = data ["Total_objects" ].mean ()
153- title = "Top 10 Units"
153+ title = "Totals by 10 Units"
154154 plt = plot .combined_plot (
155155 args = args ,
156156 data = data ,
@@ -233,11 +233,11 @@ def plot_totals_by_lowest10_units(args):
233233 )
234234
235235
236- def plot_totals_by_records (args ):
236+ def plot_totals_by_top10_unit_records (args ):
237237 """
238- Create plots showing totals by records
238+ Create plots showing breakdown of CC0 records by top 10 units
239239 """
240- LOGGER .info (plot_totals_by_records .__doc__ .strip ())
240+ LOGGER .info (plot_totals_by_top10_unit_records .__doc__ .strip ())
241241 file_path = shared .path_join (
242242 PATHS ["data_2-process" ],
243243 "smithsonian_totals_by_records.csv" ,
@@ -253,7 +253,7 @@ def plot_totals_by_records(args):
253253 data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
254254 data .sort_values (data_label , ascending = True , inplace = True )
255255 data = data .tail (10 )
256- title = "Totals by records"
256+ title = "Breakdown of CC0 records by top 10 units "
257257 plt = plot .stacked_barh_plot (
258258 args = args ,
259259 data = data ,
@@ -262,7 +262,7 @@ def plot_totals_by_records(args):
262262 stack_labels = stack_labels ,
263263 )
264264 image_path = shared .path_join (
265- PATHS ["data_phase" ], "smithsonian_by_records .png"
265+ PATHS ["data_phase" ], "smithsonian_by_top10_unit_records .png"
266266 )
267267 LOGGER .info (f"image file: { image_path .replace (PATHS ['repo' ], '.' )} " )
268268 if args .enable_save :
@@ -283,6 +283,56 @@ def plot_totals_by_records(args):
283283 )
284284
285285
286+ def plot_totals_by_lowest10_unit_records (args ):
287+ """
288+ Create plots showing breakdown of CC0 records by lowest 10 units
289+ """
290+ LOGGER .info (plot_totals_by_lowest10_unit_records .__doc__ .strip ())
291+ file_path = shared .path_join (
292+ PATHS ["data_2-process" ],
293+ "smithsonian_totals_by_records.csv" ,
294+ )
295+ LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
296+ name_label = "Unit_name"
297+ data_label = "Total_objects"
298+ stack_labels = [
299+ "CC0_without_media_percentage" ,
300+ "CC0_with_media_percentage" ,
301+ "Others_percentage" ,
302+ ]
303+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
304+ data .sort_values (data_label , ascending = True , inplace = True )
305+ data = data .head (10 )
306+ title = "Breakdown of CC0 records by lowest 10 units"
307+ plt = plot .stacked_barh_plot (
308+ args = args ,
309+ data = data ,
310+ title = title ,
311+ name_label = name_label ,
312+ stack_labels = stack_labels ,
313+ )
314+ image_path = shared .path_join (
315+ PATHS ["data_phase" ], "smithsonian_by_lowest10_unit_records.png"
316+ )
317+ LOGGER .info (f"image file: { image_path .replace (PATHS ['repo' ], '.' )} " )
318+ if args .enable_save :
319+ # Create the directory if it does not exist
320+ os .makedirs (PATHS ["data_phase" ], exist_ok = True )
321+ plt .savefig (image_path )
322+
323+ shared .update_readme (
324+ args ,
325+ SECTION_FILE ,
326+ SECTION_TITLE ,
327+ title ,
328+ image_path ,
329+ "Plots showing totals by CC0 records. This is the"
330+ " lowest 10 units with a breakdown of CC0 records"
331+ " without media, CC0 records with media and records"
332+ " that are not associated with CC0." ,
333+ )
334+
335+
286336def main ():
287337 args = parse_arguments ()
288338 shared .paths_log (LOGGER , PATHS )
@@ -294,7 +344,8 @@ def main():
294344 smithsonian_intro (args )
295345 plot_totals_by_top10_units (args )
296346 plot_totals_by_lowest10_units (args )
297- plot_totals_by_records (args )
347+ plot_totals_by_top10_unit_records (args )
348+ plot_totals_by_lowest10_unit_records (args )
298349
299350 # Add and commit changes
300351 args = shared .git_add_and_commit (
0 commit comments