Add evaluate algorithm#145
Conversation
Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com>
Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com>
Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com>
willGraham01
left a comment
There was a problem hiding this comment.
Main comment is about how evaluate is currently implemented; namely
- It's not a pure function and
- We might want to retrieve multiple values from the graph, some of which are "on the way down". Right now we have to do this through multiple calls.
Beyond that, some comments on organising and expanding the tests.
Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com>
Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com>
619a69e to
6cd17c6
Compare
Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com>
6cd17c6 to
a512b2d
Compare
willGraham01
left a comment
There was a problem hiding this comment.
evaluate_down_to is more general than evaluate so we should adapt the test accordingly (though we can test both in the same test because I'm not a code sadist).
Also we might not want to duplicate the values dictionary entries, so have suggested just returning node-evaluations that are actually computed.
Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com>
| evaluate_test_graph: Graph, | ||
| outcome_node_label: str, | ||
| initial_values: dict[str, Array], | ||
| expected_result: Array, |
There was a problem hiding this comment.
| expected_result: Array, | |
| expected_result: dict[str, float | Array], |
(Soz, but otherwise all looks good!)
There was a problem hiding this comment.
We should work out why mypy didn't spot that one
There was a problem hiding this comment.
Haven't we just blanket disabled typehint checking in the tests (because a lot of our fixtures have very long types)?
evaluatealgorithm that uses theevaluatemethod on each node from the roots down to the outcome node.utilsthat creates the graph for the example model that Ricardo is interested inBuilds on #143.
Resolves #125. Resolves #126.