At BM23 I always see this error when starting PyMca
Traceback (most recent call last):
File "<string>", line 992, in __configurePyMca
File ".../python3.12/site-packages/PyMca5/PyMcaGui/io/hdf5/QNexusWidget.py", line 460, in setWidgetConfiguration
self.cntTable.build(self._cntList, self._aliasList, shapelist=self._shapeList)
File ".../python3.12/site-packages/PyMca5/PyMcaGui/io/hdf5/HDF5CounterTable.py", line 295, in build
self.__addLine(i, posixpath.basename(cntlist[i]), shape=self.shapeList[i])
File ".../python3.12/site-packages/PyMca5/PyMcaGui/io/hdf5/HDF5CounterTable.py", line 331, in __addLine
widget = CntSelectionType(self, i, j, shape=shape)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python3.12/site-packages/PyMca5/PyMcaGui/io/hdf5/HDF5CounterTable.py", line 77, in __init__
self._index.setMaximum(min(maximum,2**31) - 1)
^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'int' and 'str'
In PyMca.ini I see this
[PyMca.HDF5.WidgetConfiguration]
mca = False
auto = ADD
2d = False
3d = False
counters = /pilatus_integrate/integrated/2th, /pilatus_integrate/integrated/intensity, /instrument/EurothermNanodac/measure, /instrument/nanodacT/data, /start_time, /measurement/diagbpm, /pilatus_integrate/integrated/points, /measurement/pilatus_integrated
aliases = 2th, intensity, measure, data, start_time, diagbpm, points, pilatus_integrated
shapes = None
1, 10000
()
None
()
1, 1088, 1456
None
1, 10000
It is fixed by modifying the file to this
[PyMca.HDF5.WidgetConfiguration]
mca = False
auto = ADD
2d = False
3d = False
counters = /pilatus_integrate/integrated/2th, /pilatus_integrate/integrated/intensity, /instrument/EurothermNanodac/measure, /instrument/nanodacT/data, /start_time, /measurement/diagbpm, /pilatus_integrate/integrated/points, /measurement/pilatus_integrated
aliases = 2th, intensity, measure, data, start_time, diagbpm, points, pilatus_integrated
shapes = None
1, 10000
None
1, 1088, 1456
None
1, 10000
So it seems that something is converting the shape tuple to a list before saving the configuration but this does not handle empty tuples
from PyMca5.PyMcaIO import ConfigDict
d = ConfigDict.ConfigDict()
config = {"Section": {"shapes": [None, tuple(), [1, 2, 3], [], None]}}
d.update(config)
d.write("test_pymca.ini")
d = ConfigDict.ConfigDict()
d.read("test_pymca.ini")
print(d)
This is where the string '()' comes from
{'Section': {'shapes': ['None', '()', [1, 2, 3], '', 'None']}}
which is then causing maximum = "(" which causes the error.
At BM23 I always see this error when starting PyMca
In PyMca.ini I see this
It is fixed by modifying the file to this
So it seems that something is converting the shape
tupleto alistbefore saving the configuration but this does not handle empty tuplesThis is where the string '()' comes from
which is then causing
maximum = "("which causes the error.