Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LukasMoll
Copy link

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)?

@@ -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]
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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).

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"""
Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll revert it.

@moorepants
Copy link
Member

Thanks. I gave some comments. The various lints are fine, but the other things are unnecessary.

Is there an interest in using some linters (e.g. black, pep8 or pylint)?

Not much, but we could maybe adopt the same linting that occurs in the main sympy repo.

@LukasMoll
Copy link
Author

Not much, but we could maybe adopt the same linting that occurs in the main sympy repo.

I'll look into that.

@LukasMoll LukasMoll force-pushed the small-fixes branch 2 times, most recently from 281ab1c to c70f780 Compare March 26, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants