Some recent changes to the visualisation module check that the smoothing lengths and coordinates have compatible attributes (e.g. both comoving, or both physical). However, visualisation.smoothing_length_generation.generate_smoothing_lengths returns a unyt_array, so these checks always fail with an AttributeError and the smoothing lengths are unusable.
Putting together a PR for this, it includes a test that currently fails:
@requires("cosmological_volume.hdf5")
def test_nongas_smoothing_lengths(filename):
"""
Test that the visualisation tools to calculate smoothing lengths give usable results.
"""
data = load(filename)
data.dark_matter.smoothing_length = generate_smoothing_lengths(
data.dark_matter.coordinates, data.metadata.boxsize, kernel_gamma=1.8
)
project_pixel_grid(
data.dark_matter,
boxsize=data.metadata.boxsize,
resolution=256,
project="masses",
)
# if project_pixel_grid runs without error the smoothing lengths seem usable
return
Some recent changes to the visualisation module check that the smoothing lengths and coordinates have compatible attributes (e.g. both comoving, or both physical). However,
visualisation.smoothing_length_generation.generate_smoothing_lengths
returns aunyt_array
, so these checks always fail with anAttributeError
and the smoothing lengths are unusable.Putting together a PR for this, it includes a test that currently fails: