Skip to content

Conversation

@psavery
Copy link
Collaborator

@psavery psavery commented Aug 20, 2025

The NpzFile class does not automatically close the file. This can lead to issues especially when multiple applications are reading/writing to the same file.

We noticed that if the GUI had an npz file open, and then in Python scripts we overwrote the npz file, that it would not overwrite correctly (the write would appear successful, but the file would remain unchanged).

Using the context manager ensures that the file gets closed automatically when we are done with it, and should hopefully resolve this issue.

The NpzFile class does not automatically close the file. This can lead
to issues especially when multiple applications are reading/writing
to the same file.

We noticed that if the GUI had an npz file open, and then in Python
scripts we overwrote the npz file, that it would not overwrite
correctly.

Using the context manager ensures that the file gets closed
automatically when we are done with it, and should hopefully
resolve this issue.

Signed-off-by: Patrick Avery <[email protected]>
@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.26%. Comparing base (867b436) to head (6ddbe55).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #832   +/-   ##
=======================================
  Coverage   49.26%   49.26%           
=======================================
  Files         143      143           
  Lines       23107    23109    +2     
=======================================
+ Hits        11383    11385    +2     
  Misses      11724    11724           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psavery psavery merged commit 06a6678 into master Aug 20, 2025
9 of 10 checks passed
@psavery psavery deleted the np-load-context-manager branch August 20, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants