-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fixed typos and applied some code conventions #84
base: master
Are you sure you want to change the base?
Conversation
benchmarks/matrices.py
Outdated
@@ -61,30 +61,30 @@ def time_MutableDenseMatrix_getitem(self): | |||
m = self.M1 | |||
for i in range(m.rows): | |||
for j in range(m.cols): | |||
m[i, j] | |||
_ = m[i, j] |
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.
This seems unnecessary and just makes things more verbose.
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 _ =
stands for a throwaway value. The purpose is to avoid writing statements that look like they no effect but are supposed to be like that. The _ =
signifies that the return value is not used.
I'll remove it.
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.
These are benchmarks so it is all about timing the execution. So it is fine to call functions, methods, etc. but not use the result (or indicate that we aren't using them).
benchmarks/polygon.py
Outdated
cutListOfPolygons = [Polygon((-1, -1), (1, Rational(5, 2)), (2, 1), (3, Rational(5, 2)), (4, 2), (5, 3), (-1, 3)) for w in range(10)] | ||
cutLines = [Line((0, 0), (Rational(9, 2), 3)) for w in range(10)] | ||
|
||
class PolygonAttributes: | ||
def time_create(self): | ||
"Creating Polygon" | ||
"""Creating Polygon""" |
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 the reason for single quote is so the docstrings don't bog down the output to std. I wouldn't change these.
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'll revert it.
Thanks. I gave some comments. The various lints are fine, but the other things are unnecessary.
Not much, but we could maybe adopt the same linting that occurs in the main sympy repo. |
I'll look into that. |
281ab1c
to
c70f780
Compare
Fixed some small typos in the doc strings.
Replaced
object call
->_ = object call
to show that it is not being used.Added some spaces where needed.
Fixed method some method calls
class.method
->class.method()
.Fixed some doctstrings, replaced single quoted with triple quoted doctstring.
Removed unused imports.
Is there an interest in using some linters (e.g. black, pep8 or pylint)?