Skip to content

Commit 965e98f

Browse files
committed
other undefined names
1 parent 39763af commit 965e98f

46 files changed

Lines changed: 91 additions & 63 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def find_executable(target):
169169
# scripts from project configuration
170170
if "scripts" in config:
171171
for script_name in config["scripts"]:
172-
if os.path.basename(script) == target:
172+
if os.path.basename(script_name) == target:
173173
return ("path", os.path.abspath(script_name))
174174
# entry-points from project configuration
175175
if "entry_points" in config:

src/PyMca5/PyMcaCore/NexusTools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import posixpath
3636
try:
3737
# try to import hdf5plugin
38-
if hdf5plugin not in sys.modules:
38+
if "hdf5plugin" not in sys.modules:
3939
import hdf5plugin
4040
except Exception:
4141
# but do not crash just because of it

src/PyMca5/PyMcaCore/StackBase.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import sys
4242
import glob
4343
import logging
44+
import copy
4445

4546
logger = logging.getLogger(__name__)
4647

src/PyMca5/PyMcaCore/XiaEdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def reset(self):
107107
try:
108108
self.__readStat()
109109
except Exception:
110-
raise XiaEdfError("Cannot parse header in <%s>"%filename)
110+
raise XiaEdfError("Cannot parse header in <%s>" % self.filename)
111111

112112
def __readStat(self):
113113
self.header= self.edf.GetHeader(0)

src/PyMca5/PyMcaGraph/backends/MatplotlibBackend.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,11 @@ def addImage(self, data, legend=None, info=None,
24962496
shape = data.shape
24972497
if 0:
24982498
# this supports non regularly spaced coordenates!!!!
2499+
2500+
if colormap is None:
2501+
colormap = self.getDefaultColormap()
2502+
cmap = self.__getColormap(colormap['name'])
2503+
24992504
x = xmin + numpy.arange(w) * xScale[1]
25002505
y = ymin + numpy.arange(h) * yScale[1]
25012506
image = NonUniformImage(self.ax,
@@ -2505,8 +2510,6 @@ def addImage(self, data, legend=None, info=None,
25052510
picker=picker,
25062511
cmap=cmap)
25072512

2508-
2509-
25102513
image.set_data(x, y, data)
25112514
xmin, xmax = self.getGraphXLimits()
25122515
ymin, ymax = self.getGraphYLimits()

src/PyMca5/PyMcaGui/io/QEdfFileWidget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,8 @@ def closeFile(self, filename=None):
10341034
#print self.selection
10351035
if (self.selection is not None) and filename in self.selection:
10361036
nmca = 0
1037-
for key in self.selection[filename].keys():
1037+
mcakeys = list(self.selection[filename].keys())
1038+
for key in mcakeys:
10381039
nmca += len(self.selection[filename][key]['rows']) + len(self.selection[filename][key]['cols'])
10391040
if nmca:
10401041
msg= "%d mca are linked to that EdfFile source.\n"% nmca

src/PyMca5/PyMcaGui/io/QSpsWidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ def getSelection(self):
10481048
def __refreshSelection(self):
10491049
return
10501050
_logger.debug("__refreshSelection(self) called")
1051-
_logger.debug(selection)
1051+
_logger.debug(self.selection)
10521052
if self.selection is not None:
10531053
sel = self.selection.get(self.data.SourceName, {})
10541054
selkeys = []

src/PyMca5/PyMcaGui/io/hdf5/DataViewerSelector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def _emitSignal(self, action="ADD"):
9797
ddict = {}
9898
ddict["action"] = action
9999
ddict["slice"] = self.getSelection()
100-
shape = self.__data.shape
101-
ddict["index"] = sel
100+
# shape = self.__data.shape
101+
# ddict["index"] = sel
102102
self.sigSliceSelectorSignal.emit(ddict)
103103

104104
def setData(self, data, mode=None):

src/PyMca5/PyMcaGui/io/hdf5/HDF5McaTable.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def setMcaSelection(self, ddict):
384384
if 0:
385385
if 'aliaslist' in keys:
386386
aliaslist = ddict['aliaslist']
387-
elif len(self.aliasList) == len(cntlist):
387+
elif len(self.aliasList) == len(self.mcaList):
388388
aliaslist = self.aliasList * 1
389389
else:
390390
aliaslist = self.mcaList * 1
@@ -404,8 +404,7 @@ def setMcaSelection(self, ddict):
404404
self.mcaSelection = []
405405
self.mcaSelectionType = []
406406
for i in range(len(selection)):
407-
idx = selection[idx]
408-
if idx < len(mcalist):
407+
if selection[i] < len(mcalist):
409408
self.mcaSelection.append(selection[i])
410409
self.mcaSelectionType.append(selectionType[i])
411410
self._update()

src/PyMca5/PyMcaGui/math/NNMAWindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def setParameters(self, ddict):
301301
if "method" in ddict:
302302
self.buttonGroup.buttons()[ddict["method"]].setChecked(True)
303303
if "regions" in ddict:
304-
self.regionsWidget.setRegions(regions)
304+
self.regionsWidget.setRegions(ddict["regions"])
305305
return
306306

307307
def getParameters(self):

0 commit comments

Comments
 (0)