From 8730a4d2c865efa703d8cbe2f472b3a275d011db Mon Sep 17 00:00:00 2001 From: Florez Ospina Juan Felipe Date: Thu, 2 Nov 2023 16:11:21 +0100 Subject: [PATCH] Improved comments --- demo_create_and_visualize_hdf5_file.ipynb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/demo_create_and_visualize_hdf5_file.ipynb b/demo_create_and_visualize_hdf5_file.ipynb index 5722df4..1142bfe 100644 --- a/demo_create_and_visualize_hdf5_file.ipynb +++ b/demo_create_and_visualize_hdf5_file.ipynb @@ -12,7 +12,9 @@ "# define input file directory\n", "\n", "input_file_path = './input_files\\\\BeamTimeMetaData.h5'\n", - "output_dir_path = './output_files'" + "output_dir_path = './output_files'\n", + "if not os.path.exists(output_dir_path):\n", + " os.makedirs(output_dir_path)" ] }, { @@ -74,7 +76,9 @@ "\n", "output_filename = 'test.h5'\n", "\n", - "h5lib.create_hdf5_file(os.path.join(output_dir_path,output_filename),\n", + "ofilepath = os.path.join(output_dir_path,output_filename)\n", + "\n", + "h5lib.create_hdf5_file(ofilepath,\n", " input_data_df, 'top-down', \n", " group_by_funcs = [group_by_sample, group_by_type, group_by_filenumber]\n", " )\n", @@ -84,9 +88,9 @@ " 'Startdate': str(input_data_df['lastModifiedDatestr'].min()),\n", " 'Enddate': str(input_data_df['lastModifiedDatestr'].max())\n", " }\n", - "h5lib.annotate_root_dir('test.h5',annotation_dict)\n", + "h5lib.annotate_root_dir(ofilepath,annotation_dict)\n", "\n", - "h5lib.display_group_hierarchy_on_a_treemap('test.h5')\n", + "h5lib.display_group_hierarchy_on_a_treemap(ofilepath)\n", "\n", "print(':)')\n" ]