-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
temporal: Fixed ruff errors in t.list #5063
base: main
Are you sure you want to change the base?
Conversation
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.
This is probably not the best approach, you are doubling the amount of code, see the approach used in
grass/temporal/t.rast.what/t.rast.what.py
Line 361 in 69a9b89
with open(output, "w") if output != "-" else nullcontext(sys.stdout) as out_file: |
Yep, I agree with @petrasovaa here, I worked a bit to find that solution. The nullcontext is the appropriate choice for these situations, where sometimes a context manager is needed, but sometimes not, and you want to keep the "shape" of a context manager in both cases. See #4224 |
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.
Unrelated change here?
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.
It was to resolve PTH201 in examples.ipynb
Fixed ruff errors regarding path and context manager