Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support numpy 2 #48

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/erlab/interactive/imagetool/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import numpy as np
import qtawesome as qta
import xarray as xr
from qtpy import QtCore, QtGui, QtWidgets

from erlab.interactive.imagetool import ImageTool, _parse_input
Expand Down Expand Up @@ -195,10 +196,12 @@ def tool(self, value: ImageTool | None) -> None:
os.remove(self._archived_fname)
else:
# Close and cleanup existing tool
self.slicer_area.unlink()
self._tool.slicer_area.unlink()
self._tool.setAttribute(QtCore.Qt.WidgetAttribute.WA_DeleteOnClose)
self._tool.removeEventFilter(self)
self._tool.slicer_area.set_data(np.zeros((2, 2)))
self._tool.slicer_area.set_data(
xr.DataArray(np.zeros((2, 2)), name=self._tool.slicer_area.data.name)
)
self._tool.destroyed.connect(self._destroyed_callback)
self._tool.close()

Expand Down Expand Up @@ -229,7 +232,6 @@ def eventFilter(self, obj, event):
return super().eventFilter(obj, event)

def _destroyed_callback(self) -> None:
print("DESTROYED!")
self.manager.sigReloadLinkers.emit()

def _setup_gui(self) -> None:
Expand Down