diff --git a/PyMca5/PyMcaGui/plotting/McaROIWidget.py b/PyMca5/PyMcaGui/plotting/McaROIWidget.py index d3f7ca90d..39198addd 100644 --- a/PyMca5/PyMcaGui/plotting/McaROIWidget.py +++ b/PyMca5/PyMcaGui/plotting/McaROIWidget.py @@ -1,5 +1,5 @@ #/*########################################################################## -# Copyright (C) 2004-2023 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. @@ -337,7 +337,11 @@ def __init__(self, *args,**kw): def build(self): self.fillFromROIDict(roilist=self.roilist,roidict=self.roidict) - def fillFromROIDict(self,roilist=[],roidict={},currentroi=None): + def fillFromROIDict(self, roilist=None, roidict=None, currentroi=None): + if roilist is None: + roilist = [] + if roidict is None: + roidict = {} self.building = True line0 = 0 self.roilist = [] diff --git a/PyMca5/PyMcaMath/PyMcaSciPy/signal/mediantools.c b/PyMca5/PyMcaMath/PyMcaSciPy/signal/mediantools.c index 915eaf217..6c030ad0a 100644 --- a/PyMca5/PyMcaMath/PyMcaSciPy/signal/mediantools.c +++ b/PyMca5/PyMcaMath/PyMcaSciPy/signal/mediantools.c @@ -40,7 +40,7 @@ DAMAGE. /* adding next line may raise errors ... #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION */ -#include "numpy/noprefix.h" +#include "numpy/arrayobject.h" #include @@ -51,7 +51,7 @@ typedef struct { typedef struct { char *data; - intp numels; + npy_intp numels; int elsize; char *zero; /* Pointer to Representation of zero */ } Generic_Vector; @@ -59,9 +59,9 @@ typedef struct { typedef struct { char *data; int nd; - intp *dimensions; + npy_intp *dimensions; int elsize; - intp *strides; + npy_intp *strides; char *zero; /* Pointer to Representation of zero */ } Generic_Array; diff --git a/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py b/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py index 901f42114..eac59a3d0 100644 --- a/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py +++ b/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py @@ -1,5 +1,5 @@ #/*########################################################################## -# Copyright (C) 2004-2023 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. @@ -32,7 +32,7 @@ This plugin also allows to apply the results from a file. """ -__author__ = "V.A. Sole - ESRF Data Analysis" +__author__ = "V.A. Sole - ESRF" __contact__ = "sole@esrf.fr" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" @@ -686,8 +686,8 @@ def initializeHDF5File(self, fname): nxEntry = hdf.require_group(entryName) if 'NX_class' not in nxEntry.attrs: nxEntry.attrs['NX_class'] = 'NXentry'.encode('utf-8') - nxEntry['title'] = numpy.string_("PyMca saved 3D Array".encode('utf-8')) - nxEntry['start_time'] = numpy.string_(ArraySave.getDate().encode('utf-8')) + nxEntry['title'] = numpy.bytes_("PyMca saved 3D Array".encode('utf-8')) + nxEntry['start_time'] = numpy.bytes_(ArraySave.getDate().encode('utf-8')) alignmentGroup = nxEntry.require_group('Alignment') dataGroup = nxEntry.require_group('Data') @@ -697,7 +697,7 @@ def initializeHDF5File(self, fname): def finishHDF5File(self, hdf): #add final date toplevelEntry = hdf["entry_000"] - toplevelEntry['end_time'] = numpy.string_(ArraySave.getDate().encode('utf-8')) + toplevelEntry['end_time'] = numpy.bytes_(ArraySave.getDate().encode('utf-8')) hdf.flush() hdf.close()