Skip to content

Commit

Permalink
Ah, turns out deepcopy IS needed here
Browse files Browse the repository at this point in the history
only took 2 h to figure that one out...
  • Loading branch information
teutoburg committed Aug 29, 2023
1 parent f7c4b24 commit e6db1a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scopesim/optics/fov_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def split(self, axis, value, aperture_id=None) -> None:
continue
if vol[f"{axis}_min"] >= value or vol[f"{axis}_max"] <= value:
continue
new_vol = vol.copy()
new_vol = deepcopy(vol)
new_vol[f"{axis}_min"] = value
vol[f"{axis}_max"] = value
self.insert(self.index(vol) + 1, new_vol)
Expand Down Expand Up @@ -364,7 +364,7 @@ def _get_new_vols():
if not all(_volume_in_range(vol, axis, edge) for axis, edge
in zip(axes, edges)):
continue
new_vol = vol.copy()
new_vol = deepcopy(vol)
for axis, edge in zip(axes, edges):
new_vol[f"{axis}_min"] = max(edge[0], vol[f"{axis}_min"])
new_vol[f"{axis}_max"] = min(edge[1], vol[f"{axis}_max"])
Expand Down

0 comments on commit e6db1a1

Please sign in to comment.