-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
I am refactoring some tests as described in #8231, and I noticed an odd issue with Flake 8. If I run ./runtests.sh --codeformat I get quite some errors, but if I run ./runtests.sh --autofix or ./runtests.sh --ruff there are no complaints.
I understand Flake8 is not run in ./runtests.sh --autofix or ./runtests.sh --ruff, but it is run in ./runtests.sh -f -u --net --coverage, which you recommend running before submitting a PR. I imagine this is a disagreement between Flake8 and ruff. It seems to me that we should either run Flake8 on all cases or never run it.
The issues raised by Flake8 are not coming from my changes but are in the code in the dev branch. Would you like me to solve those or ignore the Flake8 errors?
See below:
./runtests.sh --codeformat
Run tests under /home/rgd/kcl/MONAI
PYTHONPATH: /home/rgd/kcl/MONAI:
Python: /home/rgd/.cache/pypoetry/virtualenvs/monai-mfCICwbm-py3.12/bin/python
MONAI version: 1.4.0+49.g6e9c66e6
Numpy version: 1.26.4
Pytorch version: 2.4.1+cu121
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 6e9c66e66369ecfbd4ea8d98b995d18a4fdf324d
MONAI __file__: /home/<username>/kcl/MONAI/monai/__init__.py
Optional dependencies:
Pytorch Ignite version: 0.4.11
ITK version: 5.4.0
Nibabel version: 5.2.1
scikit-image version: 0.24.0
scipy version: 1.14.1
Pillow version: 10.4.0
Tensorboard version: 2.18.0
gdown version: 5.2.0
TorchVision version: 0.19.1+cu121
tqdm version: 4.66.5
lmdb version: 1.5.1
psutil version: 5.9.8
pandas version: 2.2.3
einops version: 0.8.0
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: 2.16.2
pynrrd version: 1.0.0
clearml version: 1.16.5rc2
For details about installing the optional dependencies, please visit:
https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
Source code copyright headers checked (1244).
--------------------------------------------------------------------------------
isort
_ _
(_) ___ ___ _ __| |_
| |/ _/ / _ \/ '__ _/
| |\__ \/\_\/| | | |_
|_|\___/\___/\_/ \_/
isort your imports, so you don't have to.
VERSION 5.13.2
Skipped 5 files
passed!
--------------------------------------------------------------------------------
black
python -m black, 24.10.0 (compiled: yes)
Python (CPython) 3.12.3
All done! ✨ 🍰 ✨
1208 files would be left unchanged.
passed!
--------------------------------------------------------------------------------
flake8
7.1.1 (flake8-bugbear: 24.2.6, flake8-comprehensions: 3.15.0, mccabe: 0.7.0, pep8-naming: 0.14.1, pycodestyle: 2.12.1, pyflakes: 3.2.0) CPython 3.12.3 on Linux
/home/rgd/kcl/MONAI/monai/apps/auto3dseg/bundle_gen.py:399:69: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/apps/detection/networks/retinanet_detector.py:790:102: E231 missing whitespace after ','
/home/rgd/kcl/MONAI/monai/apps/detection/utils/anchor_utils.py:177:44: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/apps/detection/utils/anchor_utils.py:183:44: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/apps/detection/utils/detector_utils.py:94:88: E225 missing whitespace around operator
/home/rgd/kcl/MONAI/monai/apps/detection/utils/detector_utils.py:98:75: E225 missing whitespace around operator
/home/rgd/kcl/MONAI/monai/auto3dseg/analyzer.py:272:58: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/auto3dseg/analyzer.py:353:69: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/auto3dseg/analyzer.py:522:58: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/auto3dseg/analyzer.py:900:47: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/auto3dseg/analyzer.py:902:47: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/data/wsi_reader.py:213:80: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/losses/unified_focal_loss.py:220:91: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/metrics/meandice.py:125:44: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/networks/blocks/patchembedding.py:101:30: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/networks/layers/factories.py:98:51: E225 missing whitespace around operator
/home/rgd/kcl/MONAI/monai/transforms/croppad/array.py:295:87: E226 missing whitespace around arithmetic operator
/home/rgd/kcl/MONAI/monai/transforms/regularization/array.py:44:72: E251 unexpected spaces around keyword / parameter equals
/home/rgd/kcl/MONAI/monai/transforms/regularization/array.py:44:74: E202 whitespace before '}'
/home/rgd/kcl/MONAI/monai/transforms/regularization/array.py:44:74: E251 unexpected spaces around keyword / parameter equals
1 E202 whitespace before '}'
3 E225 missing whitespace around operator
13 E226 missing whitespace around arithmetic operator
1 E231 missing whitespace after ','
2 E251 unexpected spaces around keyword / parameter equals
20
Check failed!
Please run auto style fixes: ./runtests.sh --autofix
./runtests.sh --autofix
Run tests under /home/rgd/kcl/MONAI
PYTHONPATH: /home/rgd/kcl/MONAI:
Python: /home/rgd/.cache/pypoetry/virtualenvs/monai-mfCICwbm-py3.12/bin/python
MONAI version: 1.4.0+49.g6e9c66e6
Numpy version: 1.26.4
Pytorch version: 2.4.1+cu121
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 6e9c66e66369ecfbd4ea8d98b995d18a4fdf324d
MONAI __file__: /home/<username>/kcl/MONAI/monai/__init__.py
Optional dependencies:
Pytorch Ignite version: 0.4.11
ITK version: 5.4.0
Nibabel version: 5.2.1
scikit-image version: 0.24.0
scipy version: 1.14.1
Pillow version: 10.4.0
Tensorboard version: 2.18.0
gdown version: 5.2.0
TorchVision version: 0.19.1+cu121
tqdm version: 4.66.5
lmdb version: 1.5.1
psutil version: 5.9.8
pandas version: 2.2.3
einops version: 0.8.0
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: 2.16.2
pynrrd version: 1.0.0
clearml version: 1.16.5rc2
For details about installing the optional dependencies, please visit:
https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
Source code copyright headers checked (1244).
--------------------------------------------------------------------------------
isort-fix
_ _
(_) ___ ___ _ __| |_
| |/ _/ / _ \/ '__ _/
| |\__ \/\_\/| | | |_
|_|\___/\___/\_/ \_/
isort your imports, so you don't have to.
VERSION 5.13.2
Skipped 5 files
passed!
--------------------------------------------------------------------------------
black-fix
python -m black, 24.10.0 (compiled: yes)
Python (CPython) 3.12.3
All done! ✨ 🍰 ✨
1208 files left unchanged.
passed!
--------------------------------------------------------------------------------
ruff-fix
ruff 0.7.4
All checks passed!
passed!
./runtests.sh --ruff
Run tests under /home/rgd/kcl/MONAI
PYTHONPATH: /home/rgd/kcl/MONAI:
Python: /home/rgd/.cache/pypoetry/virtualenvs/monai-mfCICwbm-py3.12/bin/python
MONAI version: 1.4.0+49.g6e9c66e6
Numpy version: 1.26.4
Pytorch version: 2.4.1+cu121
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 6e9c66e66369ecfbd4ea8d98b995d18a4fdf324d
MONAI __file__: /home/<username>/kcl/MONAI/monai/__init__.py
Optional dependencies:
Pytorch Ignite version: 0.4.11
ITK version: 5.4.0
Nibabel version: 5.2.1
scikit-image version: 0.24.0
scipy version: 1.14.1
Pillow version: 10.4.0
Tensorboard version: 2.18.0
gdown version: 5.2.0
TorchVision version: 0.19.1+cu121
tqdm version: 4.66.5
lmdb version: 1.5.1
psutil version: 5.9.8
pandas version: 2.2.3
einops version: 0.8.0
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: 2.16.2
pynrrd version: 1.0.0
clearml version: 1.16.5rc2
For details about installing the optional dependencies, please visit:
https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
--------------------------------------------------------------------------------
ruff
ruff 0.7.4
All checks passed!
passed!
Metadata
Metadata
Assignees
Labels
No labels