From af78333c9c55a261a6b1f9c234638bcb1618c110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:39:47 +0200 Subject: [PATCH 1/4] Support numbered AOD origins --- Scripts/find_dependencies.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Scripts/find_dependencies.py b/Scripts/find_dependencies.py index 87e07897aff..74a11fb429c 100755 --- a/Scripts/find_dependencies.py +++ b/Scripts/find_dependencies.py @@ -81,11 +81,11 @@ def load_workflows_from_json(): return db_wf -def format_table_name(description: str, subspec: int): - """Format table description name, including potential versions.""" - if not subspec: - return description - return f"{description}_{subspec:03d}" +def format_table_name(description: str, subspec: int, origin: str): + """Format table description name, including origin and potential versions.""" + if subspec > 0: + description += f"_{subspec:03d}" + return f"{origin}/{description}" def get_devices(specs_wf: dict): @@ -101,7 +101,7 @@ def get_inputs(specs_wf: dict, device=""): if device and dev["name"] != device: continue list_inputs += [ - format_table_name(i["description"], i["subspec"]) for i in dev["inputs"] if i["origin"] == "AOD" + format_table_name(i["description"], i["subspec"], i["origin"]) for i in dev["inputs"] if i["origin"].startswith("AOD") ] return list(dict.fromkeys(list_inputs)) # Remove duplicities @@ -115,7 +115,7 @@ def get_outputs(specs_wf: dict, device=""): if device and dev["name"] != device: continue list_outputs += [ - format_table_name(i["description"], i["subspec"]) for i in dev["outputs"] if i["origin"] == "AOD" + format_table_name(i["description"], i["subspec"], i["origin"]) for i in dev["outputs"] if i["origin"].startswith("AOD") ] return list(dict.fromkeys(list_outputs)) # Remove duplicities @@ -323,9 +323,11 @@ def main(): for t, reverse in zip((tables, tables_rev), (False, True)): if t: for table in t: - print(f"\nTable: {table}\n") if not table: msg_fatal("Bad table") + if "/" not in table: + table = "AOD/" + table + print(f"\nTable: {table}\n") # producers = get_table_producers(table, dic_wf_all_simple, case_sensitive) # if not producers: # print("No producers found") From 6b6fe1f88d89d8092ab4e67313d40ac26ae50f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 14 Apr 2026 13:50:44 +0200 Subject: [PATCH 2/4] Support regex in exclude patterns --- Scripts/find_dependencies.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Scripts/find_dependencies.py b/Scripts/find_dependencies.py index 74a11fb429c..ee882f062e2 100755 --- a/Scripts/find_dependencies.py +++ b/Scripts/find_dependencies.py @@ -34,6 +34,7 @@ import hashlib import json import os +import re import subprocess as sp # nosec B404 import sys @@ -101,7 +102,9 @@ def get_inputs(specs_wf: dict, device=""): if device and dev["name"] != device: continue list_inputs += [ - format_table_name(i["description"], i["subspec"], i["origin"]) for i in dev["inputs"] if i["origin"].startswith("AOD") + format_table_name(i["description"], i["subspec"], i["origin"]) + for i in dev["inputs"] + if i["origin"].startswith("AOD") ] return list(dict.fromkeys(list_inputs)) # Remove duplicities @@ -115,7 +118,9 @@ def get_outputs(specs_wf: dict, device=""): if device and dev["name"] != device: continue list_outputs += [ - format_table_name(i["description"], i["subspec"], i["origin"]) for i in dev["outputs"] if i["origin"].startswith("AOD") + format_table_name(i["description"], i["subspec"], i["origin"]) + for i in dev["outputs"] + if i["origin"].startswith("AOD") ] return list(dict.fromkeys(list_outputs)) # Remove duplicities @@ -229,7 +234,7 @@ def get_tree_for_table(tab: str, dic_wf_all: dict, dic_wf_tree=None, case_sensit for p in producers: get_tree_for_workflow(p, dic_wf_all, dic_wf_tree, case_sensitive, 0, levels_max, reverse) else: - print(f'No {"consumers" if reverse else "producers"} found') + print(f"No {'consumers' if reverse else 'producers'} found") return dic_wf_tree @@ -272,7 +277,7 @@ def main(): dest="exclude", type=str, nargs="+", - help="tables and workflows to exclude", + help="name patterns of tables and workflows to exclude", ) parser.add_argument( "-l", @@ -299,7 +304,7 @@ def main(): dic_wf_all_simple = {} for wf, dic_wf in dic_wf_all_full.items(): # Skip excluded workflows - if list_exclude and wf in list_exclude: + if list_exclude and any(re.search(pattern, wf) for pattern in list_exclude): continue dic_wf_all_simple[wf] = {} list_dev = get_devices(dic_wf) @@ -309,8 +314,8 @@ def main(): list_outputs = get_outputs(dic_wf, dev) # Skip excluded tables if list_exclude: - list_inputs = [i for i in list_inputs if i not in list_exclude] - list_outputs = [o for o in list_outputs if o not in list_exclude] + list_inputs = [i for i in list_inputs if not any(re.search(pattern, i) for pattern in list_exclude)] + list_outputs = [o for o in list_outputs if not any(re.search(pattern, o) for pattern in list_exclude)] dic_wf_all_simple[wf][dev]["inputs"] = list_inputs dic_wf_all_simple[wf][dev]["outputs"] = list_outputs # print_workflows(dic_wf_all_simple) From 77aca382330ca35c04d9fd51b2c36b9baba127a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 14 Apr 2026 14:50:51 +0200 Subject: [PATCH 3/4] Fix table node names in plotting --- Scripts/find_dependencies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/find_dependencies.py b/Scripts/find_dependencies.py index ee882f062e2..06764eab7f9 100755 --- a/Scripts/find_dependencies.py +++ b/Scripts/find_dependencies.py @@ -396,12 +396,12 @@ def main(): inputs = get_workflow_inputs(wf, dic_deps) outputs = get_workflow_outputs(wf, dic_deps) list_tables += inputs + outputs - nodes_in = " ".join(inputs) - nodes_out = " ".join(outputs) + nodes_in = " ".join(inputs).replace("/", "_") + nodes_out = " ".join(outputs).replace("/", "_") dot_deps += f" {{{nodes_in}}} -> {node_wf} -> {{{nodes_out}}}\n" list_tables = list(dict.fromkeys(list_tables)) # Remove duplicities for table in list_tables: - dot_tables += f" {table}\n" + dot_tables += f' {table.replace("/", "_")} [label="{table}"]\n' dot_tables += " }\n" dot_workflows += " }\n" dot += dot_workflows + dot_tables + dot_deps From 6180882cf979818cc2654715e25622e5996f7c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:24:14 +0200 Subject: [PATCH 4/4] Support EMB origin --- Scripts/find_dependencies.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/find_dependencies.py b/Scripts/find_dependencies.py index 06764eab7f9..363899c3f7b 100755 --- a/Scripts/find_dependencies.py +++ b/Scripts/find_dependencies.py @@ -104,7 +104,7 @@ def get_inputs(specs_wf: dict, device=""): list_inputs += [ format_table_name(i["description"], i["subspec"], i["origin"]) for i in dev["inputs"] - if i["origin"].startswith("AOD") + if i["origin"].startswith(("AOD", "EMB")) ] return list(dict.fromkeys(list_inputs)) # Remove duplicities @@ -120,7 +120,7 @@ def get_outputs(specs_wf: dict, device=""): list_outputs += [ format_table_name(i["description"], i["subspec"], i["origin"]) for i in dev["outputs"] - if i["origin"].startswith("AOD") + if i["origin"].startswith(("AOD", "EMB")) ] return list(dict.fromkeys(list_outputs)) # Remove duplicities