-
Notifications
You must be signed in to change notification settings - Fork 1
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
expand ruff rules #73
Conversation
swmmanywhere/graph_utilities.py
Outdated
@@ -779,7 +773,7 @@ def __call__(self, G: nx.Graph, | |||
# Push the neighbor to the heap | |||
heappush(heap, (alt_dist, neighbor)) | |||
|
|||
edges_to_keep = set() | |||
edges_to_keep: set = set() # no clue why mypy wants me to do this.. |
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.
Maybe doing this will satisfy mypy
: edges_to_keep: set[tuple[int, int]] = {}
existing_input_file = Path(__file__).parent / 'defs' /\ | ||
'basic_drainage_all_bits.inp' |
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.
I find using Path
like so Path(Path(__file__).parent, 'defs', 'basic_drainage_all_bits.inp')
to be more readable. I don't like using /
. But if you prefer it this way, it's ok.
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.
I'm of the opposite opinion, I like /
way more, so it is entirely up to you @barneydobson ! 😄
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.
Inertia probably means I'll leave it as is ;)
The rest looks good to me. |
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.
Looks good to me!
Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com>
Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com>
…/ImperialCollegeLondon/SWMManywhere into 38-use-more-extensive-ruff-rules
Description
implement new
ruff
rulesFixes #38
Also replaces I think all of
os
withPath
, related to #9 (I guess it doesn't quite close it because the validation part needs to come in somewhere... which probably won't be closed until we deal withconfig
#10 )OK think I've implemented all of @cheginit 's suggestions for
pre-commit
, the only thing I disabled was therefurb
chaining suggestions, some of them seemed OK but some places there was (at least as far as I could see) no way to do chaining without making the code a lot less readable.