Skip to content

Commit e46135e

Browse files
committed
debugged channel editor, removed np.bool
1 parent 32103bc commit e46135e

File tree

8 files changed

+34
-26
lines changed

8 files changed

+34
-26
lines changed

src/pymapmanager.egg-info/PKG-INFO

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.4
22
Name: pymapmanager
3-
Version: 0.0.7.dev384+g144a945.d20250430
3+
Version: 0.0.7.dev385+gc285506
44
Requires-Python: >=3.11
55
License-File: LICENSE
66
Requires-Dist: numpy
@@ -13,6 +13,7 @@ Requires-Dist: qtpy
1313
Requires-Dist: PyQt5
1414
Requires-Dist: pyqtgraph
1515
Requires-Dist: pyqtdarktheme
16+
Requires-Dist: qtawesome
1617
Provides-Extra: test
1718
Requires-Dist: pytest; extra == "test"
1819
Requires-Dist: pytest-cov; extra == "test"

src/pymapmanager.egg-info/requires.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ qtpy
88
PyQt5
99
pyqtgraph
1010
pyqtdarktheme
11+
qtawesome
1112

1213
[docs]
1314
mkdocs

src/pymapmanager/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
__version_tuple__: VERSION_TUPLE
1818
version_tuple: VERSION_TUPLE
1919

20-
__version__ = version = '0.0.7.dev384+g144a945.d20250430'
21-
__version_tuple__ = version_tuple = (0, 0, 7, 'dev384', 'g144a945.d20250430')
20+
__version__ = version = '0.0.7.dev385+gc285506.d20250807'
21+
__version_tuple__ = version_tuple = (0, 0, 7, 'dev385', 'gc285506.d20250807')

src/pymapmanager/interface/core/_data_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def data(self, index, role=QtCore.Qt.DisplayRole):
7070
retVal = float(retVal)
7171
elif isinstance(retVal, np.int64):
7272
retVal = int(retVal)
73-
elif isinstance(retVal, np.bool_):
73+
elif isinstance(retVal, bool):
7474
retVal = str(retVal)
7575
elif isinstance(retVal, list):
7676
retVal = str(retVal)

src/pymapmanager/interface/core/scatter_plot_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def checkFloat(self, val):
605605
"""
606606
try:
607607
# logger.info(f"val type is {type(val)}")
608-
if isinstance(val, np.bool):
608+
if isinstance(val, bool):
609609
logger.info(f"val is {val}")
610610
return False
611611
float(val)

src/pymapmanager/interface/stackWidgets/channelEditor.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _buildGUI(self):
3434
# listOfChannelIdx = self.stackWidget.getStack().getChannelKeys()
3535
self._listOfChannelIdx = self.stackWidget.getStack().getChannelKeys()
3636
# self._listOfChannelIdx = listOfChannelIdx
37-
dictOfChannelNames = self.stackWidget.getStack().getChannelNameDict()
37+
# dictOfChannelNames = self.stackWidget.getStack().getChannelNameDict()
3838

3939
_shapeDict = self.getStack().getMetadata().shapeDict
4040
zSlice = _shapeDict['z']
@@ -63,11 +63,12 @@ def _buildGUI(self):
6363
if 1:
6464
# logger.info(f"channel index in loop {channelKey}")
6565
self.totalChannelsShown += 1
66-
try:
67-
channelPath = dictOfChannelNames[channelKey]
68-
except:
69-
logger.error(f'xxx abb missing `dictOfChannelPaths`')
70-
channelPath = "xxx"
66+
67+
# try:
68+
# channelPath = dictOfChannelNames[channelKey]
69+
# except:
70+
# logger.error(f'xxx abb missing `dictOfChannelPaths`')
71+
# channelPath = "xxx"
7172

7273
# abb actualIndex and channelRowNum are redundant -> removed
7374
# Offset by 1, channel idx being 0 based
@@ -83,9 +84,13 @@ def _buildGUI(self):
8384
# Diplaying channel as seen in the row rather than actual index in backend
8485
self.gridLayout.addWidget(QtWidgets.QLabel(str(self.totalChannelsShown)), self.totalChannelsShown, 0)
8586

86-
self.gridLayout.addWidget(DraggableWidget(channelPath, self.totalChannelsShown, 1, self, name = "widget " +
87-
str(channelKey), stackWidget = self.stackWidget,
88-
channelIdx = channelKey), self.totalChannelsShown, 1)
87+
self.gridLayout.addWidget(DraggableWidget(str(channelKey),
88+
self.totalChannelsShown, 1,
89+
self, name = "widget " +
90+
str(channelKey),
91+
stackWidget = self.stackWidget,
92+
channelIdx = channelKey),
93+
self.totalChannelsShown, 1)
8994

9095
# ), channelKey + 1, 1)
9196

@@ -97,13 +102,13 @@ def _buildGUI(self):
97102
activateBox.addItem("Off")
98103

99104
# get activate channel value from backend
100-
timePoint = self.getStack().timepoint
101-
activatedChannels = self.getStack().getTimeSeriesCore().getActivatedChannels(t=timePoint)
105+
# timePoint = self.getStack().timepoint
106+
# activatedChannels = self.getStack().getTimeSeriesCore().getActivatedChannels(t=timePoint)
102107

103-
if channelKey in activatedChannels:
104-
activateBox.setCurrentText("On")
105-
else:
106-
activateBox.setCurrentText("Off")
108+
# if channelKey in activatedChannels:
109+
# activateBox.setCurrentText("On")
110+
# else:
111+
# activateBox.setCurrentText("Off")
107112

108113
self.gridLayout.addWidget(activateBox, self.totalChannelsShown, 2)
109114
activateBox.currentTextChanged.connect(partial(self._onActivate, channelKey))
@@ -174,9 +179,9 @@ def importChannel(self, channelIdx, tifFile = None):
174179
logger.info(f"cancelling import")
175180
return
176181

177-
with Image.open(tifFile) as img:
178-
newImgWidth, newImgHeight = img.size
179-
newImgSlices = img.n_frames # z dimension
182+
# with Image.open(tifFile) as img:
183+
# newImgWidth, newImgHeight = img.size
184+
# newImgSlices = img.n_frames # z dimension
180185

181186
# confirmed, selectedChannelIdx = \
182187
# self.showConfirmationDialog(fileDimensions=(newImgWidth,newImgHeight,newImgSlices))
@@ -326,7 +331,7 @@ def dropEvent(self, event):
326331
self.importChannel(self.channelIdx, tifFile)
327332

328333
class DraggableWidget(QtWidgets.QWidget):
329-
def __init__(self, text, row, column, parent=None, name = None,
334+
def __init__(self, text: str, row, column, parent=None, name = None,
330335
stackWidget = None, channelIdx = None):
331336

332337
""" Draggable widget

src/pymapmanager/stack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def _checkFloat(self, val):
346346
"""
347347
try:
348348
# logger.info(f"val type is {type(val)}")
349-
if isinstance(val, np.bool):
349+
if isinstance(val, bool):
350350
# logger.info(f"val is {val}")
351351
return False
352352
float(val)
@@ -366,7 +366,7 @@ def _checkFloat(self, val):
366366
# return listOfChannels
367367

368368
def getChannelNameDict(self):
369-
channelNames = self.getMetadata().getChannelNames()
369+
channelNames = self.getMetadata().channelKeys
370370
return channelNames
371371

372372
def getLeftOverChannels(self, channelIdx):

src/pymapmanager/timeseriesCore.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def numMapSegments(self):
211211
"""
212212
return len(self._fullMap.segments[:].index.unique(0))
213213

214+
# abb 202508 remove
214215
def getActivatedChannels(self, t):
215216
"""List of channels that are activates
216217
"""

0 commit comments

Comments
 (0)