Open Xarthisius opened 1 year ago
Per @neutrinoceros, I'm adding some of the info from #4765.
Briefly, it looks like the problem occurs when yt tries to add ("all","particle_position_x")
as a grid field in the _get_data()
function. I don't know if that's expected or not. Note that ("io","particle_position_x")
works just fine, presumably because it's not a grid field (i.e. passes the if ftype in self.data_series[0].particle_types:
statement in line 237). I don't know the FLASH format, so I don't know if "all"
and "io"
are equivalent. Alternatively, it might be a problem in how the grid is loaded?
So from what I saw, it looked like there were three possible sources for the bug:
"all"
particle type isn't included in the FLASH dataset list of particle types and/or isn't mapped to "io"
correctlyif ftype in self.data_series[0].particle_types:
isn't a robust way to check if a field is a grid fieldSince it seems to load just fine when using "io"
, I would guess 1. or 2. would be the issue, but I don't know if grid information is relevant. That seems like a question for @jzuhone .
Also, I'd expect the test test_particle_trajectories.py::test_orbit_traj to fail based on this, but wasn't able to test.
Just FYI, it looks like test_orbit_traj
and test_etc_traj
aren't even running. For a little bit more, see #4768.
I think the test problem can be resolved simply by changing the require_ds
decorator to require_file
(a la #4692) which results in both tests failing on my machine. The test_orbit_traj
is failing for the reason described here. The other test failure might be related, it appears to occur in the same grid_field section, but a slightly different part:
# This will fail for non-grid index objects
for grid in particle_grids:
cube = grid.retrieve_ghost_zones(1, grid_fields) # test_orbit_traj fails here
for field in grid_fields:
CICSample_3( # test_etc_traj fails here
x,
y,
z,
pfield[field],
self.num_indices,
cube[fds[field]],
np.array(grid.LeftEdge, dtype="float64"),
np.array(grid.ActiveDimensions, dtype="int32"),
grid.dds[0],
)
with the error
File "yt/utilities/lib/particle_mesh_operations.pyx", line 214, in yt.utilities.lib.particle_mesh_operations.CICSample_3 ValueError: Buffer has wrong number of dimensions (expected 3, got 1)
Based on the code comment above, I'm guessing these fields aren't supposed to be considered grid fields, and the bug is either 1 or 2 from my previous comment
Bug report
Bug summary
See: https://yt-project.org/doc/analyzing/particle_trajectories.html
Code for reproduction
Actual outcome
Expected outcome
No error