Loosening Some Ruff Ignores#405
Merged
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #405 +/- ##
==========================================
+ Coverage 79.85% 79.88% +0.03%
==========================================
Files 158 158
Lines 9540 9556 +16
==========================================
+ Hits 7618 7634 +16
Misses 1922 1922 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
emersodb
commented
Jun 20, 2025
| # As the linked issue above points out, calling gc.freeze() greatly reduces the | ||
| # overhead of garbage collection. (from 1.5s to 0.005s) | ||
| if current_server_round == 2: | ||
| if current_server_round == 2: # noqa: PLR2004 |
Collaborator
Author
There was a problem hiding this comment.
This magic number is sort of hard to describe in a concise name... So applying an ignore
Collaborator
There was a problem hiding this comment.
<some-thing>_STARTING_ROUND? lol
Collaborator
Author
There was a problem hiding this comment.
Yeah...it has to do with when we want to start doing GC in a special way to avoid memory overloading. It's very niche 😂
nerdai
approved these changes
Jun 20, 2025
nerdai
left a comment
Collaborator
There was a problem hiding this comment.
Justifications seem sensible to me.
This file contains hidden or 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
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.
PR Type
Other
Short Description
This PR removes some of the Ruff ignores that we have in place and fixes the issues that arise in our code base by doing so. Namely, applying the Ruff rules
Note: We do not enforce various ruff rules in our examples, tests, and research folders. Below is a justification for the settings I chose in these folders.
In the tests, there is good justification for having magic numbers. We also create a lot of helper functions, classes, and magic methods meant to facilitate testing that would be very annoying (and many would be unnecessary) to document formally.
Our research folders are meant to be less formal. It's nice to have documentation where helpful to someone using the code, but things like public init documentation, magic method descriptions, and magic numbers aren't exceptionally important.
Each time we want to perform FL training, we override the server and client base classes to produce customized training flows. Documenting these is unnecessary and we have README files that discuss the point of each example and how to run it.
Tests Added
NA