Skip to content

Recipe validation update for gradients #414

@mogres

Description

@mogres

Description

The test recipe cellpack/tests/recipes/v2/test_combined_gradient.json does not run due to incorrect validation. There is a conflict between the validation in interface_objects/gradient_data.py and the recipe level validation.

Expected Behavior

Gradient mode "X" (upper case) should be accepted. Recipe level validation should include the validation from gradient_data and gradient_data should be deprecated in favor of the RecipeGradient object.

Reproduction

pack -r cellpack/tests/recipes/v2/test_combined_gradient.json

fails with the error

ValueError: Recipe validation failed:
Validation errors found:
  Field: gradients -> dict[str,function-after[validate_mode_requirements(), RecipeGradient]] -> X_gradient -> mode
  Error: Input should be 'x', 'y', 'z', 'vector', 'radial' or 'surface'
  Field: gradients -> dict[str,function-after[validate_mode_requirements(), RecipeGradient]] -> Y_gradient -> mode
  Error: Input should be 'x', 'y', 'z', 'vector', 'radial' or 'surface'
  Field: gradients -> list[dict[str,any]]
  Error: Input should be a valid list

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions