Skip to content
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

BUG: avoid ResourceWarnings in the amrex frontend #4891

Merged
merged 1 commit into from
May 30, 2024

Conversation

yut23
Copy link
Member

@yut23 yut23 commented May 1, 2024

PR Summary

Use context managers where the line length allows, and manually close all other files that are opened outside a with statement.

Fixes #4890.

neutrinoceros
neutrinoceros previously approved these changes May 1, 2024
Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems uncontroversial but I never got why we were leaving handles opened in the first place, so I'd like to leave this open for a little while in case someone objects.

@neutrinoceros neutrinoceros added this to the 4.4.0 milestone May 1, 2024
matthewturk
matthewturk previously approved these changes May 1, 2024
Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change. My suggestions are optional. Thanks for catching this -- I'm not sure why we left handles open!

yt/frontends/boxlib/data_structures.py Outdated Show resolved Hide resolved
yt/frontends/boxlib/data_structures.py Outdated Show resolved Hide resolved
@henrynjones henrynjones mentioned this pull request May 1, 2024
2 tasks
@yut23 yut23 dismissed stale reviews from matthewturk and neutrinoceros via dd4fe98 May 1, 2024 17:46
@neutrinoceros neutrinoceros changed the title BUG: avoid ResourceWarnings in the boxlib frontend BUG: avoid ResourceWarnings in the boxlib frontend (⏰ wait for #4845) May 2, 2024
@neutrinoceros neutrinoceros marked this pull request as draft May 2, 2024 08:45
Use context managers where the line length allows, and manually close
all other files that are opened outside a `with` statement.

Fixes yt-project#4890.
@yut23 yut23 force-pushed the fix-boxlib-resourcewarnings branch from a8d6f31 to accaf59 Compare May 29, 2024 21:54
@yut23 yut23 changed the title BUG: avoid ResourceWarnings in the boxlib frontend (⏰ wait for #4845) BUG: avoid ResourceWarnings in the amrex frontend May 29, 2024
@yut23 yut23 marked this pull request as ready for review May 29, 2024 21:55
@neutrinoceros neutrinoceros merged commit b37cdae into yt-project:main May 30, 2024
13 checks passed
@yut23 yut23 deleted the fix-boxlib-resourcewarnings branch May 30, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: ResourceWarnings for unclosed files in boxlib frontend
3 participants