From: Jean-Philippe ARGAUD Date: Wed, 19 Jun 2019 13:31:37 +0000 (+0200) Subject: Minor corrections X-Git-Tag: V9_4_0b1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6e2c9ccd99e9ee7343f49ed56ff599f1415c6302;p=modules%2Fadao.git Minor corrections --- diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index 406de4f..ed2c5f1 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -320,6 +320,7 @@ CHECKING_STUDY = PROC(nom="CHECKING_STUDY", Debug = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0), AlgorithmParameters = F_AlgorithmParameters("o", ({check_names}), AlgorithmParametersInNS), CheckingPoint = F_CheckingPoint("o", CheckingPointInNS), + Background = F_Background("f", BackgroundInNS), BackgroundError = F_BackgroundError("f", BackgroundErrorInNS), Observation = F_Observation("f", ObservationInNS), ObservationError = F_ObservationError("f", ObservationErrorInNS), diff --git a/resources/ADAOSchemaCatalog.xml b/resources/ADAOSchemaCatalog.xml index 5d0c378..0b7d4d5 100644 --- a/resources/ADAOSchemaCatalog.xml +++ b/resources/ADAOSchemaCatalog.xml @@ -434,10 +434,11 @@ if (vector_in_string.find("array")>-1) or (vector_in_string.find("matrix")>-1): vector_in_string=vector_in_string.replace("array","numpy.array") vector_in_string=vector_in_string.replace("matrix","numpy.matrix") exec("vector="+vector_in_string) - vector = numpy.matrix(vector) + vector = numpy.array(vector) else: vector_in_string=vector_in_string.replace("'","").replace('"','') - vector = numpy.matrix(vector_in_string) + vector_in_list = eval(str(vector_in_string),{},{}) + vector = numpy.array(vector_in_list) type = "VectorSerie" logging.debug("VectorSerie is %s"%vector) ]]> diff --git a/src/daComposant/daCore/Persistence.py b/src/daComposant/daCore/Persistence.py index ec1f280..36d2fc5 100644 --- a/src/daComposant/daCore/Persistence.py +++ b/src/daComposant/daCore/Persistence.py @@ -31,7 +31,8 @@ import os, sys, numpy, copy import gzip, bz2 from daCore.PlatformInfo import PathManagement ; PathManagement() -from daCore.PlatformInfo import has_gnuplot +from daCore.PlatformInfo import has_gnuplot, PlatformInfo +mfp = PlatformInfo().MaximumPrecision() if has_gnuplot: import Gnuplot @@ -276,7 +277,7 @@ class Persistence(object): élémentaires numpy. """ try: - return [numpy.array(item).mean() for item in self.__values] + return [numpy.mean(item, dtype=mfp) for item in self.__values] except: raise TypeError("Base type is incompatible with numpy") @@ -469,9 +470,9 @@ class Persistence(object): """ try: if self.__basetype in [int, float]: - return float( numpy.array(self.__values).mean() ) + return float( numpy.mean(self.__values, dtype=mfp) ) else: - return numpy.array(self.__values).mean(axis=0) + return numpy.mean(self.__values, axis=0, dtype=mfp) except: raise TypeError("Base type is incompatible with numpy")