Skip to content

Commit

Permalink
[NF] is_multiple key
Browse files Browse the repository at this point in the history
  • Loading branch information
helene-t committed May 12, 2020
1 parent 6d99429 commit 59715d3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
18 changes: 18 additions & 0 deletions SciDataTool/Classes/Data1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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""",
)
20 changes: 20 additions & 0 deletions SciDataTool/Classes/DataLinspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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()

Expand Down Expand Up @@ -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""",
)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

setuptools.setup(
name="SciDataTool",
version="0.1.2",
version="0.1.4",
author="Helene Toubin",
author_email="[email protected]",
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",
Expand Down

0 comments on commit 59715d3

Please sign in to comment.