Repository navigation
[BUG]: Fix reloaded sphere crashing due to chunking - #5581
Conversation
…ts in frontends/ytdata/io.py on _read_particle_data_file(); added comments to prevent this bug occurring again.
…he same data to what was saved; that the saved data is identical regardless of how accessed; and that chunking does not crash (in response to bug fixed in a2e6cfe)
|
Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution! |
|
@brittonsmith a fun side quest on the project. |
|
thanks for the PR @jp-duminy ! the failing test is unrelated and I think will be fixed by a merge with main |
|
@jp-duminy just did the merge for you and pushed it up FYI. |
chrishavlin
left a comment
There was a problem hiding this comment.
The change looks good, but the test needs an update (see comments). Note, pull the branch locally before making changes since I merged your branch with main for you.
…ct a subset of the domain, thus appropriately reflecting the typical use case scenario.
chrishavlin
left a comment
There was a problem hiding this comment.
assuming tests pass again, this is good to go! Thanks for the issue and fix @jp-duminy !
|
Hooray! Congratulations on your first merged pull request! We hope we keep seeing you around! 🎆 |
…1-on-yt-4.4.x Backport PR #5581 on branch yt-4.4.x ([BUG]: Fix reloaded sphere crashing due to chunking)
|
@chrishavlin thank you for walking me through this one, and I'm glad I could contribute. Have a lovely weekend. |
PR Summary
This PR fixes a discovered issue wherein a reloaded sphere dataset produces a
TypeErrorif the sphere is chunked. This arises from an oversight in the chunking implementation: an applied boolean mask was sized to a chunk, whereas the dataset it was applied to was sized to the original file. This therefore produces an incompatible shape error from fancy indexing. The fix is minor and I have added comments to explicitly point out the different file shapes to hopefully prevent such an oversight occurring in future.The second commit of the PR adds a small unit test to check this behaviour. It errors on the current
ytversion, but now passes following the changes. As part of this test we also demand the reloaded sphere dataset reproduces the data before it was saved; this also passes.The issue was first described in #5576.
AI Disclosure
I used AI for (leaving both boxes unchecked certifies that no AI was used in these changes):
I used the following AI tools:
Claude (Anthropic), Claude Opus 5.5
The source code modification in the first commit is written by me; I had Claude take a look to catch anything I might have missed. The corresponding test was then written by me.
PR Checklist