-
Notifications
You must be signed in to change notification settings - Fork 76
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
✨ Use ruff
for Linting
#625
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
shaneahmed
commented
Jun 22, 2023
•
edited
Loading
edited
- Add checks for
- pydocstyle
- flake8-future-annotations
- flake8-errmsg
- pygrep-hooks
- flake8-use-pathlib
- Ruff-specific rules
- flake8-self
- flake8-type-checking
- tryceratops
- Replace flake8 with ruff Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Add flake8 plugins Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Update `pyproject.toml` Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Update `pyproject.toml` Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Fix B905 Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Remove `flake8` settings from `setup.cfg` Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## develop #625 +/- ##
===========================================
+ Coverage 99.83% 99.84% +0.01%
===========================================
Files 64 64
Lines 7249 7305 +56
Branches 1408 1405 -3
===========================================
+ Hits 7237 7294 +57
Misses 4 4
+ Partials 8 7 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
- SIM300 [*] Yoda conditions are discouraged, use `wsi.info.mpp[0] > 0.1` instead - ERA001 [*] Found commented-out code - Fix B905 `zip()` without an explicit `strict=` parameter
- A003 Class attribute `filter` is shadowing a Python builtin - N816 Variable `rcParam` in global scope should not be mixedCase
- Fix `zip()` without an explicit `strict=` parameter - This feature is not supported in Python 3.8
…ev-use-ruff-for-linting
- Fix `zip()` without an explicit `strict=` parameter - This feature is not supported in Python 3.8
- Fix `E741` Ambiguous variable name
- Fix `E501` Line too long
- Fix `SIM108` [*] Use ternary operator
- Fix `N818` Exception name should be named with an Error suffix
- Fix `ERA001` [*] Found commented-out code - Fix `FIX002` Line contains TODO - Fix `FIX004` Line contains HACK
- Fix `ERA001` [*] Found commented-out code
…keys()` - Fix `SIM118` [*] Use `pretrained_name in pretrained_info` instead of `pretrained_name in pretrained_info.keys()`
- Use ruff in Git Workflow Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Fix `B904` Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Autofix "UP" using ruff Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Add complexity check Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Add trailing commas check Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Fix deepsource error Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
shaneahmed
added a commit
that referenced
this pull request
Jul 21, 2023
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Merged
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
shaneahmed
added a commit
that referenced
this pull request
Jul 22, 2023
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
shaneahmed
added a commit
that referenced
this pull request
Jul 22, 2023
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
shaneahmed
added a commit
that referenced
this pull request
Jul 22, 2023
Fix linter error in cli, annotation and visualization from sparkles Use ruff for Linting #625 --------- Co-authored-by: Mark Eastwood <20169086+measty@users.noreply.github.com>
shaneahmed
added a commit
that referenced
this pull request
Jul 22, 2023
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
shaneahmed
added a commit
that referenced
this pull request
Jul 22, 2023
shaneahmed
commented
Jul 22, 2023
# Conflicts: # pyproject.toml
for more information, see https://pre-commit.ci
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
for more information, see https://pre-commit.ci
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
…ev-use-ruff-for-linting
shaneahmed
added a commit
that referenced
this pull request
Jul 22, 2023
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Merged
shaneahmed
added a commit
that referenced
this pull request
Dec 15, 2023
## 1.5.0 (2023-12-15) ### Major Updates and Feature Improvements - Adds the bokeh visualization tool. #684 - The tool allows a user to launch a server on their machine to visualise whole slide images, overlay the results of deep learning algorithms or to select a patch from whole slide image and run TIAToolbox deep learning engines. - This tool powers the TIA demos server. For details please see https://tiademos.dcs.warwick.ac.uk/. - Extends Annotation to Support Init from WKB #639 - Adds `IOConfig` for NuClick in `pretrained_model.yaml` #709 - Adds functions to save the TIAToolbox Engine outputs to Zarr and AnnotationStore files. #724 - Adds Support for QuPath Annotation Imports #721 ### Changes to API - Adds `model.to(device)` and `model.load_model_from_file()` functionality to make it compatible with PyTorch API. #733 - Replaces `pretrained` with `weights` to make the engines compatible with the new PyTorch API. #621 - Adds support for high-level imports for various utility functions and classes such as `WSIReader`, `PatchPredictor` and `imread` #606, #607, - Adds `tiatoolbox.typing` for type hints. #619 - Fixes incorrect file size saved by `save_tiles`, issue with certain WSIs raised by @TomastpPereira - TissueMasker transform now returns mask instead of a list. #748 - Fixes #732 ### Bug Fixes and Other Changes - Fixes `pixman` incompability error on Colab #601 - Removes `shapely.speedups`. The module no longer has any affect in Shapely >=2.0. #622 - Fixes errors in the slidegraph example notebook #608 - Fixes bugs in WSI Registration #645, #670, #693 - Fixes the situation where PatchExtractor.get_coords() can return patch coords which lie fully outside the bounds of a slide. #712 - Fixes #710 - Fixes #738 raised by @xiachenrui ### Development related changes - Replaces `flake8` and `isort` with `ruff` #625, #666 - Adds `mypy` checks to `root` and `utils` package. This will be rolled out in phases to other modules. #723 - Adds a module to detect file types using magic number/signatures #616 - Uses `poetry` for version updates instead of `bump2version`. #638 - Removes `setup.cfg` and uses `pyproject.toml` for project configurations. - Reduces runtime for some unit tests e.g., #627, #630, #631, #629 - Reuses models and datasets in tests on GitHub actions by utilising cache #641, #644 - Set up parallel tests locally #671 **Full Changelog:** v1.4.0...v1.5.0 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: mostafajahanifar <74412979+mostafajahanifar@users.noreply.github.com> Co-authored-by: John Pocock <John-P@users.noreply.github.com> Co-authored-by: DavidBAEpstein <David.Epstein@warwick.ac.uk> Co-authored-by: David Epstein <22086916+DavidBAEpstein@users.noreply.github.com> Co-authored-by: Ruqayya Awan <18444369+ruqayya@users.noreply.github.com> Co-authored-by: Mark Eastwood <20169086+measty@users.noreply.github.com> Co-authored-by: adamshephard <39619155+adamshephard@users.noreply.github.com> Co-authored-by: adamshephard <adam.shephard@warwick.ac.uk> Co-authored-by: Abdol <a@fkrtech.com> Co-authored-by: Jiaqi-Lv <60471431+Jiaqi-Lv@users.noreply.github.com> Co-authored-by: Abishek <abishekraj6797@gmail.com> Co-authored-by: Dmitrii Blaginin <blaginin@mbp.lan>
Merged
shaneahmed
added a commit
that referenced
this pull request
Dec 15, 2023
## 1.5.0 (2023-12-15) ### Major Updates and Feature Improvements - Adds the bokeh visualization tool. #684 - The tool allows a user to launch a server on their machine to visualise whole slide images, overlay the results of deep learning algorithms or to select a patch from whole slide image and run TIAToolbox deep learning engines. - This tool powers the TIA demos server. For details please see https://tiademos.dcs.warwick.ac.uk/. - Extends Annotation to Support Init from WKB #639 - Adds `IOConfig` for NuClick in `pretrained_model.yaml` #709 - Adds functions to save the TIAToolbox Engine outputs to Zarr and AnnotationStore files. #724 - Adds Support for QuPath Annotation Imports #721 ### Changes to API - Adds `model.to(device)` and `model.load_model_from_file()` functionality to make it compatible with PyTorch API. #733 - Replaces `pretrained` with `weights` to make the engines compatible with the new PyTorch API. #621 - Adds support for high-level imports for various utility functions and classes such as `WSIReader`, `PatchPredictor` and `imread` #606, #607, - Adds `tiatoolbox.typing` for type hints. #619 - Fixes incorrect file size saved by `save_tiles`, issue with certain WSIs raised by @TomastpPereira - TissueMasker transform now returns mask instead of a list. #748 - Fixes #732 ### Bug Fixes and Other Changes - Fixes `pixman` incompability error on Colab #601 - Removes `shapely.speedups`. The module no longer has any affect in Shapely >=2.0. #622 - Fixes errors in the slidegraph example notebook #608 - Fixes bugs in WSI Registration #645, #670, #693 - Fixes the situation where PatchExtractor.get_coords() can return patch coords which lie fully outside the bounds of a slide. #712 - Fixes #710 - Fixes #738 raised by @xiachenrui ### Development related changes - Replaces `flake8` and `isort` with `ruff` #625, #666 - Adds `mypy` checks to `root` and `utils` package. This will be rolled out in phases to other modules. #723 - Adds a module to detect file types using magic number/signatures #616 - Uses `poetry` for version updates instead of `bump2version`. #638 - Removes `setup.cfg` and uses `pyproject.toml` for project configurations. - Reduces runtime for some unit tests e.g., #627, #630, #631, #629 - Reuses models and datasets in tests on GitHub actions by utilising cache #641, #644 - Set up parallel tests locally #671 **Full Changelog:** v1.4.0...v1.5.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.