Skip to content

Commit

Permalink
Add validation for gradient names in Gradient.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mogres committed Jul 8, 2024
1 parent f4c28ae commit 04898ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cellpack/autopack/Gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ def pick_point_for_ingredient(ingr, allIngrPts, all_gradients):
if not hasattr(ingr, "combined_weight"):
gradient_list = []
for gradient_name in ingr.gradient:
if gradient_name not in all_gradients:
raise ValueError(
f"Gradient {gradient_name} not found in gradient list"
)
gradient_list.append(all_gradients[gradient_name])

combined_weight = Gradient.get_combined_gradient_weight(
Expand Down

0 comments on commit 04898ee

Please sign in to comment.