Skip to content

Commit

Permalink
Missed corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasole committed May 7, 2024
1 parent 1995b34 commit c22a821
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
12 changes: 8 additions & 4 deletions PyMca5/PyMcaGui/plotting/ImageView.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
# The PyMca X-Ray Fluorescence Toolkit
#
# Copyright (c) 2004-2016 European Synchrotron Radiation Facility
# Copyright (c) 2004-2024 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
# the ESRF.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -26,7 +26,7 @@
# THE SOFTWARE.
#
# ###########################################################################*/
__author__ = "T. Vincent - ESRF Data Analysis"
__author__ = "T. Vincent - ESRF"
__contact__ = "[email protected]"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
Expand Down Expand Up @@ -754,7 +754,11 @@ def setImage(self, image, origin=(0, 0), scale=(1., 1.),
self._imagePlot.removeImage(self._imageLegend, replot=False)
return

data = np.array(image, order='C', copy=copy)
if copy:
data = np.array(image, order='C', copy=True)
else:
data = np.asarray(image, order='C')

assert data.size != 0
assert len(data.shape) == 2
height, width = data.shape
Expand Down
11 changes: 7 additions & 4 deletions PyMca5/PyMcaGui/plotting/ScatterPlotCorrelatorWidget.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#/*##########################################################################
# Copyright (C) 2004-2015 V.A. Sole, European Synchrotron Radiation Facility
# Copyright (C) 2004-2024 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
# the ESRF.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,7 +23,7 @@
# THE SOFTWARE.
#
#############################################################################*/
__author__ = "V.A. Sole - ESRF Data Analysis"
__author__ = "V.A. Sole - ESRF"
__contact__ = "[email protected]"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
Expand Down Expand Up @@ -87,7 +87,10 @@ def setSelectableItemList(self, items, labels=None, copy=True):

def addSelectableItem(self, item, label=None, copy=True):
# we always keep a copy by default
item = numpy.array(item, dtype=numpy.float32, copy=copy)
if copy:
item = numpy.array(item, dtype=numpy.float32, copy=True)
else:
item = numpy.asarray(item, dtype=numpy.float32)
if label is None:
label = "Unnamed 00"
i = 0
Expand Down

0 comments on commit c22a821

Please sign in to comment.