Skip to content

Commit

Permalink
πŸ‘Œ IMPROVE: Add solution for validation exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Oct 6, 2022
1 parent 9568a87 commit 26cc42c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/sections/writing_workflows/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,14 @@ Take the `MultiplyAddWorkChain` from the {ref}`exercise in the work chains secti
* Allow the `x` and `y` inputs to _also_ be `Float` nodes.
* Make sure `z` is not zero.
* Make sure the sum of `x` and `y` is not zero.

:::{dropdown} **Solution**

```{literalinclude} include/code/validation/validated_multiple_add.py
:language: python
:emphasize-lines: 14-17, 19-22, 32-35, 38-39
```

Note how the `valid_type` of the _outputs_ also has to be more flexible!

:::

0 comments on commit 26cc42c

Please sign in to comment.