-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Formatted Remaining 22 Files #4161
Conversation
@AlexAndorra and @MarcoGorelli Please Review. |
Codecov Report
@@ Coverage Diff @@
## master #4161 +/- ##
=======================================
Coverage 88.75% 88.75%
=======================================
Files 89 89
Lines 14039 14039
=======================================
Hits 12461 12461
Misses 1578 1578
|
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.
Nice! Just have a few minor comments. One involves slightly rewriting a test so that black
will keep each test case on one line
pymc3/theanof.py
Outdated
@@ -368,8 +367,7 @@ def set_default(self, value): | |||
t1 = (False,) * value.ndim | |||
t2 = self.generator.tensortype.broadcastable | |||
if not t1 == t2: | |||
raise ValueError('Default value should have the ' | |||
'same type as generator') | |||
raise ValueError("Default value should have the " "same type as generator") |
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.
raise ValueError("Default value should have the " "same type as generator") | |
raise ValueError("Default value should have the same type as generator") |
' is zero.'.format(*name_slc[ii])) | ||
raise ValueError('\n'.join(errmsg)) | ||
errmsg.append( | ||
"The derivative of RV `{}`.ravel()[{}]" " is zero.".format(*name_slc[ii]) |
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.
"The derivative of RV `{}`.ravel()[{}]" " is zero.".format(*name_slc[ii]) | |
"The derivative of RV `{}`.ravel()[{}] is zero.".format(*name_slc[ii]) |
' is non-finite.'.format(*name_slc[ii])) | ||
raise ValueError('\n'.join(errmsg)) | ||
errmsg.append( | ||
"The derivative of RV `{}`.ravel()[{}]" " is non-finite.".format(*name_slc[ii]) |
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.
"The derivative of RV `{}`.ravel()[{}]" " is non-finite.".format(*name_slc[ii]) | |
"The derivative of RV `{}`.ravel()[{}] is non-finite.".format(*name_slc[ii]) |
pymc3/tests/test_distributions.py
Outdated
( | ||
None, | ||
0.5, | ||
None, | ||
None, | ||
"Incompatible parametrization. Must specify either alpha or n.", | ||
), | ||
( | ||
None, | ||
None, | ||
None, | ||
None, | ||
"Incompatible parametrization. Must specify either alpha or n.", | ||
), |
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.
Can you change L834 so that it reads
with pytest.raises(ValueError, match=f"Incompatible parametrization. {expected}"):
and then "Incompatible parametrization."
can be removed from here (and from the remaining tuples from this particular test):
(None, None, None, None, "Must specify either alpha or n."),
and black
will keep this on one line.
You'll then need to run pytest pymc3/tests/test_distributions.py -k test_negative_binomial_init_fail
to check that this still passes
If you decide to do this, please comment in the PR description that you've made this change. In general it's good to keep formatting separate from changing code (this way it's easier to review / revert), but IMO here it's a really simple change and it allows the formatting to be applied more cleanly so it's OK
@MarcoGorelli Please Review |
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.
Thanks, looks good to me pending green!
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.
All good, thanks @Yash1256 !
In Issue #4109 Formatted 22 Remaining Files