38 rntuple_file_path: str,
39 keys_to_compare: List[str],
40 fmd_keys_to_compare: List[str],
43 Compares metadata from two files to check if they are the same.
46 ttree_file_path (str): The path to the first metadata file.
47 rntuple_file_path (str): The path to the second metadata file.
48 keys_to_compare (list): List of keys to compare in the metadata.
49 fmd_keys_to_compare (list): List of keys to compare in the 'FileMetaData' section.
52 int: 0 if metadata is the same, 1 if metadata is different.
57 ttree_file_path, mode=
"full"
60 ttree_file_path, mode=
"peeker"
64 rntuple_metadata_full: Dict[str, any] =
read_metadata(rntuple_file_path)[
69 logging.error(f
"Error accessing metadata for file: {e}")
74 ttree_metadata_full, [
"EventFormat"]
77 ttree_metadata_peeker, keys_to_compare
80 rntuple_metadata_full, keys_to_compare
83 rntuple_metadata_full, [
"EventFormat"]
88 ttree_peeker_metadata.get(
"FileMetaData", {}), fmd_keys_to_compare
91 rntuple_metadata.get(
"FileMetaData", {}), fmd_keys_to_compare
96 ttree_peeker_metadata == rntuple_metadata
97 and ttree_event_format_metadata == rntuple_event_format_metadata
100 f
"Selected metadata keys ({keys_to_compare=}, {fmd_keys_to_compare=}) are the same"
105 f
"Selected metadata keys ({keys_to_compare=}, {fmd_keys_to_compare=}) are different"