executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx
https://myst-nb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
200 stars 80 forks source link

FIX: output metadata overwrites image size for all following images #609

Closed aeisenbarth closed 4 days ago

aeisenbarth commented 2 weeks ago

Closes #608

A cell-level configuration parameter was retrieved and then modified. Since it is a dictionary, the global configuration was modified. By making a copy of the dictionary, the overrides to the dictionary are only local to this specific cell.

I considered to modify get_cell_level_config to always return a copy, to avoid future mistakes when using this API. But it actually returns not the whole cell config as dictionary, but the value for a key, which can be any type (bool etc., and only for render_image_options a dictionary).

OriolAbril commented 4 days ago

@agoose77 see https://github.com/executablebooks/MyST-NB/pull/599#issuecomment-2194395623 about the failing tests

agoose77 commented 4 days ago

This passes all tests, but there are some deployment bugs related to NumPy 2 that we need to address. Merging.