Skip to content

Remove unnecessary pass#297

Merged
gtrevisan merged 1 commit intodevfrom
fix-unnecessary-pass
Sep 13, 2024
Merged

Remove unnecessary pass#297
gtrevisan merged 1 commit intodevfrom
fix-unnecessary-pass

Conversation

@gtrevisan
Copy link
Copy Markdown
Member

@gtrevisan gtrevisan commented Sep 9, 2024

address:

test with:

make pylint-only CODE=W0107

fixed with:

poetry run ruff check --fix disruption_py examples tests --select PIE790

@gtrevisan gtrevisan requested a review from yumouwei September 9, 2024 17:30
pd.DataFrame
Pandas dataframe containing cached data.
"""
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should it raise a NotImplementedError?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think all of these passes are unnecessary simply because the docstrings make the functions well-defined.
it does not do anything with or without the pass.
another thing is changing the logic, but I believe the passes here are proper because this is just a declaration of the necessary methods that need to be overridden by any subclass.
hopefully Amos will confirm once he gets to this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah exactly -- we can remove the passes & leave the body empty of everything except the docstring because all the logic is implemented by subclasses.

@gtrevisan gtrevisan requested a review from amdecker September 12, 2024 15:16
Copy link
Copy Markdown
Contributor

@amdecker amdecker left a comment

Choose a reason for hiding this comment

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

Looks like there's a few more in the drafts/ folder eg

import profiletools
except Exception as e:
logging.warning("Could not import profiletools or eqtools")
logging.debug(traceback.format_exc())
pass

idk if those are worth fixing?

Otherwise looks good!

pd.DataFrame
Pandas dataframe containing cached data.
"""
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah exactly -- we can remove the passes & leave the body empty of everything except the docstring because all the logic is implemented by subclasses.

@gtrevisan gtrevisan merged commit 6c0005b into dev Sep 13, 2024
@gtrevisan gtrevisan deleted the fix-unnecessary-pass branch September 13, 2024 12:07
@gtrevisan gtrevisan mentioned this pull request Sep 13, 2024
@gtrevisan gtrevisan changed the title remove unnecessary pass Remove unnecessary pass Sep 18, 2024
@gtrevisan gtrevisan added the linting Modifications about linting, formatting, and style label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linting Modifications about linting, formatting, and style

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants