-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix type error when calling create_dataarray_from_tensor
#106
Conversation
Thanks for fixing this! I wonder why this was not caught by any tests? Maybe something to try to also change here to avoid similar bugs in the future. We have a test that should run an epoch or so of training on the example data. I wonder if we have managed to configure that one so that it will not run validation. Because this bug should have crashed the validation step I think, making any test including that fail. |
I think because the tests don't run through the cli interface, but instead create a |
My idea was also to use |
Interesting! I hadn't thought of that :) If you have time and inclination I would review a PR on that. But maybe not a priority for now? What do you think? |
Another simple temporary fix to the tests for this is to just specify options to the instantiated |
I have included mypy now and fixed all the issues that were raised (~40). It is not in strict mode yet as many functions are not yet typed in neural-lam and since this results in about 460 issues, I will not attempt that now 😄 |
Whenever we talk about static typing and/or CLI I like to mention this library that elegantly combines both: https://typer.tiangolo.com/ |
b07bf25
to
06bfb81
Compare
To keep this PR rather clean, I reverted the mypy test and additional type annotations now. |
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.
Perfect! Thanks for fixing this.
Describe your changes
The
create_dataarray_from_tensor
is now called with the expected type (tensor instead of numpy array).Issue Link
< Link to the relevant issue or task. > (e.g.
closes #00
orsolves #00
)Type of change
Checklist before requesting a review
pull
with--rebase
option if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee