-
-
Notifications
You must be signed in to change notification settings - Fork 402
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 mismatches in io_pyjags.py. #1498
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1498 +/- ##
=======================================
Coverage 91.76% 91.76%
=======================================
Files 105 105
Lines 11316 11322 +6
=======================================
+ Hits 10384 10390 +6
Misses 932 932
Continue to review full report at Codecov.
|
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.
I don't understand the assertion errors, otherwise it looks good (assertion errors may too once I understand them)
Ah yes. Let me use the one about
The type of However, Unrelatedly, it seems that due to the lack of type hints, the |
Okey, thanks for the explanation, I see the need now, but it's kind of a bummer it is needed as it basicallly kills the usefulness of the Regarding |
Ah yes, I see it now. And the
The other alternative could be to make the decorator pass the checked value into the function as an argument. Since the argument's type would be But to be honest, I think overall the code structure would be more readable and obvious with an |
In the most recent commit, I ended up removing the use of @requires("posterior")
def posterior_to_xarray(self) -> tp.Tuple[xarray.Dataset, xarray.Dataset]:
... Calling The If I were the maintainer of this project, this would be my preferred approach. However, I am not the maintainer, so if there is another approach you'd prefer, I'm happy to change the code accordingly or give my 2 cents on it -- whatever is most helpful here. |
Also, just to clarify one point — whatever we decide here is only for the In principle, we could decide to merge this PR to unblock #1496 and start using In other words, we don't have to decide the "fate" of using |
Sounds good, let's merge and start trying more serious typing |
Description
Fix the following
mypy
type errors, without affecting any of the underlying functionality. Working toward #1496.Checklist