diff --git a/SciDataTool/Classes/Data1D.py b/SciDataTool/Classes/Data1D.py index b769a843..66af8cce 100644 --- a/SciDataTool/Classes/Data1D.py +++ b/SciDataTool/Classes/Data1D.py @@ -65,6 +65,7 @@ def __init__( if "is_multiple" in list(init_dict.keys()): is_multiple = init_dict["is_multiple"] # Initialisation by argument + self.is_multiple = is_multiple # values can be None, a ndarray or a list set_array(self, "values", squeeze(values)) # Call Data init @@ -132,3 +133,20 @@ def _set_values(self, value): values = property( fget=_get_values, fset=_set_values, doc=u"""ndarray of the field""" ) + + def _get_is_multiple(self): + """getter of include_endpoint""" + return self._is_multiple + + def _set_is_multiple(self, value): + """setter of is_multiple""" + check_var("is_multiple", value, "bool") + self._is_multiple = value + + # Boolean indicating if the axis is multiple + # Type : bool + is_multiple = property( + fget=_get_is_multiple, + fset=_set_is_multiple, + doc=u"""Boolean indicating if the axis is multiple""", + ) diff --git a/SciDataTool/Classes/DataLinspace.py b/SciDataTool/Classes/DataLinspace.py index 6398aece..f47b85fd 100644 --- a/SciDataTool/Classes/DataLinspace.py +++ b/SciDataTool/Classes/DataLinspace.py @@ -95,6 +95,7 @@ def __init__( self.step = step self.number = number self.include_endpoint = include_endpoint + self.is_multiple = is_multiple # Call Data init super(DataLinspace, self).__init__( symbol=symbol, name=name, unit=unit, symmetries=symmetries @@ -143,6 +144,7 @@ def as_dict(self): DataLinspace_dict["step"] = self.step DataLinspace_dict["number"] = self.number DataLinspace_dict["include_endpoint"] = self.include_endpoint + DataLinspace_dict["is_multiple"] = self.is_multiple # The class name is added to the dict fordeserialisation purpose # Overwrite the mother class name DataLinspace_dict["__class__"] = "DataLinspace" @@ -155,6 +157,7 @@ def _set_None(self): self.step = None self.number = None self.include_endpoint = None + self.is_multiple = None # Set to None the properties inherited from Data super(DataLinspace, self)._set_None() @@ -226,3 +229,20 @@ def _set_include_endpoint(self, value): fset=_set_include_endpoint, doc=u"""Boolean indicating if the endpoint must be included""", ) + + def _get_is_multiple(self): + """getter of include_endpoint""" + return self._is_multiple + + def _set_is_multiple(self, value): + """setter of is_multiple""" + check_var("is_multiple", value, "bool") + self._is_multiple = value + + # Boolean indicating if the axis is multiple + # Type : bool + is_multiple = property( + fget=_get_is_multiple, + fset=_set_is_multiple, + doc=u"""Boolean indicating if the axis is multiple""", + ) diff --git a/setup.py b/setup.py index 4df5fcc8..73b41c40 100644 --- a/setup.py +++ b/setup.py @@ -5,14 +5,14 @@ setuptools.setup( name="SciDataTool", - version="0.1.2", + version="0.1.4", author="Helene Toubin", author_email="helene.toubin@eomys.com", description="Scientific Data Tool", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/Eomys/SciDataTool", - download_url="https://github.com/Eomys/SciDataTool/archive/0.1.2.tar.gz", + download_url="https://github.com/Eomys/SciDataTool/archive/0.1.4.tar.gz", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3",