Skip to content

BUG: out-of-bounds memory access when trying to zoom on a ParticleProjectionPlot #4603

@neutrinoceros

Description

@neutrinoceros

Bug report

Bug summary

Zooming may produce out-of-bounds errors. I'm not sure if this is specific to "SPH" datasets or to AREPO (or, none of the above).

Code for reproduction

import yt

ds = yt.load_sample("ArepoBullet")
p = yt.ParticleProjectionPlot(ds, "z",  [('all', 'particle_mass')])
p.zoom(10)
p.save()

Actual outcome

Traceback (most recent call last):
  File "/Users/robcleme/dev/yt-project/yt/ttt.py", line 6, in <module>
    p.save()
  File "/Users/robcleme/dev/yt-project/yt/yt/visualization/_commons.py", line 167, in newfunc
    self._recreate_frb()
  File "/Users/robcleme/dev/yt-project/yt/yt/visualization/plot_window.py", line 333, in _recreate_frb
    self._frb.render(key)
  File "/Users/robcleme/dev/yt-project/yt/yt/visualization/fixed_resolution.py", line 204, in render
    return self[item]
           ~~~~^^^^^^
  File "/Users/robcleme/dev/yt-project/yt/yt/visualization/fixed_resolution.py", line 776, in __getitem__
    add_points_to_greyscale_image(
  File "yt/utilities/lib/image_utilities.pyx", line 28, in yt.utilities.lib.image_utilities.add_points_to_greyscale_image
    buffer[i, j] += pv[pi]
IndexError: Out of bounds on buffer access (axis 0)

Expected outcome
no error

Version Information

  • Operating System: macOS
  • Python Version: 3.11.4
  • yt version: 4.3.dev0
  • Other Libraries (if applicable): numpy 1.25.0, matplotlib 3.7.1

yt installed from source

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions