-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[DO NOT MERGE] introduce isort
and black
as autoformatters
#4178
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
Conversation
from torchvision.ops.boxes import box_area | ||
|
||
from typing import Optional, List, Dict, Tuple, Union | ||
from .roi_align import roi_align |
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.
Our current implementation relies on a specific import order in torchvision/ops/__init__.py
since we have torchvision/ops/roi_align.py
as well as a roi_align
function. Thus, depending on the current stage of the imports from torchvision.ops import roi_align
gives you either the module or the function.
In the future we should avoid name conflicts between modules and functions. For example, we could rename the module to _roi_align.py
since all its functionality is available through torchvision.ops
.
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.
Thanks @pmeier !
Considering the sequence of changes that will need to be done (in particular the doc updates, the pre-commit hook and the CI check), I would suggest to do all this in a separate branch first. We'll then be able to merge everything in master in one go, while keeping the development in separate PRs without worrying too much about the current state of master.
Superseded by #4384. |
Closes #4174. For now this is just a proof of concept PR. DO NOT MERGE this until we actually want to use
black
andisort
.Only
pyproject.toml
andsetup.cfg
need review. All the other changes were made by the autoformatters or to accommodateflake8
.Todo:
black
andisort
to CIblack
andisort
as pre-commit hooks