-
Notifications
You must be signed in to change notification settings - Fork 28
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
Small changes to please cython-lint #211
Conversation
I don't understand the E202 error in the CI as I don't get this locally and the error itself seems to point to |
Hmm it seems that people argue about this elsewhere: PyCQA/pycodestyle#1201 and if my E202 doesn't fail but it does on the CI I'll just include it back into the ignore. |
src/flint/types/acb_poly.pyx
Outdated
@@ -197,7 +197,7 @@ cdef class acb_poly(flint_poly): | |||
return u | |||
|
|||
def __pos__(self): | |||
return self # ? | |||
return self |
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 think something should be kept in the comment here.
This is not how it works for arb
and acb
since +a
rounds to context precision:
In [1]: from flint import *
In [2]: a = arb(10**50)
In [3]: a
Out[3]: 1.00000000000000e+50
In [4]: +a
Out[4]: [1.00000000000000e+50 +/- 3.40e+34]
In [5]: a.man_exp()
Out[5]: (88817841970012523233890533447265625, 50)
In [7]: (+a).mid().man_exp()
Out[7]: (4814824860968089, 114)
I assume that the comment here is a reminder that maybe this method should be changed to match by using acb_poly_set_round
.
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 have reintroduced the comments
src/flint/types/fmpz.pyx
Outdated
# This is the correct code when fmpz_or is fixed (in flint 3.0.0) | ||
# | ||
#def __or__(self, other): | ||
|
||
# def __or__(self, other): |
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.
Now that Flint 3.0 is the minimum version we could use this code instead.
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.
Ahh ok. Shall I make this change in this PR or another
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.
It should work fine just to uncomment this as it is tested. There was a bug in Flint 2.7 at the time.
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.
ok, this has been addressed
The two likely explanations for this are always:
|
I think what happened there is that everyone agreed it was a bug apart from the pyflakes maintainer who did not want to discuss it and so closed and locked the issue. Maybe we can do without this rule if it doesn't work properly. |
At the moment the rule is flagging up the format strings (in the CI at least) which I disagree with (I think |
The question is whether the rule is actually useful in other situations. If it is then we can work around it in this case e.g. If the rule is generally not that important but a bit nice for formatting then I would be most inclined just to "fix" it throughout the codebase and then just leave it excluded in the lint config. |
Looks like E202 is now fixed by doing the (in my opinion worse) option of Maybe better to do this though than have the lint hack in place, as I don't know if |
Okay, looks good. |
Most changes are trivial.
See issue #210 about one remaining small change. The "last" thing I think we need to decide is a line length so we can fix E501 eventually.