-
Notifications
You must be signed in to change notification settings - Fork 18
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
Remove unnecessary format subclass methods #76
Conversation
There is no need for every subclass to redefine the __init__ method and call its parent's __init__ method. As well as a lot of unnecessary code duplication, this also led to the subclass self.understand() method being called once for every class in the format class hierarchy. Use super() where applicable.
There is no need for every subclass to redefine the _start() method and call its parent's _start() method. Use super() where applicable.
Reviewing... |
0-th order - tests: Master:
Branch:
Interesting that there were fewer tests 🤔 possibly one added since you made the branch. Time difference due to nproc= for first not second 🙄 |
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.
Looked through the changes (after the first few, scanned diffs) and they look fine.
Tests pass effectively the same before and afterwards. No evident regressions.
=> 👍
I should also say: this is a good thing and will help newer developers as there is (slightly less) cargo culted nonsense in there. |
@Anthchirp split one test into two here which probably accounts for the differing number of test compared to master: dials@8c169ff |
I now removed one on master, so count should be identical again 😏 |
Remove unnecessary
__init__
and_start
methods from Format classes:__init__
method andcall its parent's
__init__
method. As well as a lot of unnecessary codeduplication, this also led to the subclass
self.understand()
methodbeing called once for every class in the format class hierarchy.
_start()
method andcall its parent's
_start()
method.super()
where applicable.