[DO NOT MERGE] introduce isort and black as autoformatters#4178
[DO NOT MERGE] introduce isort and black as autoformatters#4178pmeier wants to merge 15 commits intopytorch:mainfrom
isort and black as autoformatters#4178Conversation
| 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.
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.
NicolasHug
left a comment
There was a problem hiding this comment.
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
blackandisort.Only
pyproject.tomlandsetup.cfgneed review. All the other changes were made by the autoformatters or to accommodateflake8.Todo:
blackandisortto CIblackandisortas pre-commit hooks