-
Notifications
You must be signed in to change notification settings - Fork 0
Move from mypy to ty #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…per class, function, or module).
…e_found' only passed by chance.
…t raise an error -- comment out test for now.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
I think the idea was to check that the input-options of the input dependent interface functions (idif) are among the output of I think this is a remnant from the times were I/we thought that idifs can be anywhere in the DAG. But then we settled on them using So I think we can i) remove the check, and ii) rename Instead of adding a new check to |
for more information, see https://pre-commit.ci
MImmesberger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I think this makes the type hints much more reliable, which will be incredibly useful!
src/ttsim/interface_dag_elements/specialized_environment_for_plotting_and_templates.py
Show resolved
Hide resolved
- Changes corresponding to [TTSIM PR 63](ttsim-dev/ttsim#63). - Most importantly, fix a bunch of cases where we were using `RawParam` in places where it should have been `RawParamValue`
Lots of improvements, highlights:
OrigParamSpecwas off. What we had written was "one of two exclusive kinds of dictionaries" where we wanted to write "One dictionaries where key/value pairs can take one of two forms". Fixed via a Protocol.TypeAliasforOrderedQNamesinstead ofTypeVar(which created a different instance per function / module).RawParamValuesince we were usingRawParamas a type annotation in many places whereRawParam.valuewas passed.invalid-return-type, which is required forpolicy_inputs, where we annotate with the expected type, but returnNone)ToDo:
Behavior of
_fail_if_requested_nodes_cannot_be_foundwas incorrect and tests only passed because we happened to add the item that should fail at the end, else earlier failures would get overwritten by the loop. See demonstration in this commit. Check relevant changes:git diff 12be01be395dc4db6c6f119ff3c11d0a73dd0416~2.When fixing the loop and not commenting out the second clause below, we saw failures.
Issue is that when we request only upstream stuff, input-dependent interface functions like
(input_data, flat)are never being created. It is not fully obvious to me why we need that check at all."tests/test_main.py" = ["ERA001"]frompyproject.toml