Skip to content

Commit 56cb561

Browse files
committed
print missing components
1 parent 2b76193 commit 56cb561

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

python/sdist/amici/de_model.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,8 +2596,11 @@ def _process_hybridization(self, hybridization: dict) -> None:
25962596
key=lambda comp: net["input_vars"].index(str(comp.get_id())),
25972597
)
25982598
if len(inputs) != len(net["input_vars"]):
2599+
found_vars = {str(comp.get_id()) for comp in inputs}
2600+
missing_vars = set(net["input_vars"]) - found_vars
25992601
raise ValueError(
2600-
f"Could not find all input variables for neural network {net_id}"
2602+
f"Could not find all input variables for neural network {net_id}. "
2603+
f"Missing variables: {sorted(missing_vars)}"
26012604
)
26022605
for inp in inputs:
26032606
if isinstance(
@@ -2621,8 +2624,11 @@ def _process_hybridization(self, hybridization: dict) -> None:
26212624
in net["output_vars"]
26222625
}
26232626
if len(outputs.keys()) != len(net["output_vars"]):
2627+
found_vars = set(outputs.keys())
2628+
missing_vars = set(net["output_vars"]) - found_vars
26242629
raise ValueError(
2625-
f"Could not find all output variables for neural network {net_id}"
2630+
f"Could not find all output variables for neural network {net_id}. "
2631+
f"Missing variables: {sorted(missing_vars)}"
26262632
)
26272633

26282634
for out_var, parts in outputs.items():
@@ -2671,8 +2677,11 @@ def _process_hybridization(self, hybridization: dict) -> None:
26712677
# in net["observable_vars"]
26722678
}
26732679
if len(observables.keys()) != len(net["observable_vars"]):
2680+
found_vars = set(observables.keys())
2681+
missing_vars = set(net["observable_vars"]) - found_vars
26742682
raise ValueError(
2675-
f"Could not find all observable variables for neural network {net_id}"
2683+
f"Could not find all observable variables for neural network {net_id}. "
2684+
f"Missing variables: {sorted(missing_vars)}"
26762685
)
26772686

26782687
for ob_var, parts in observables.items():

0 commit comments

Comments
 (0)