Skip to content

Commit

Permalink
[NF] Added "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 109e7d5 commit 6d99429
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions SciDataTool/Classes/Data1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ class Data1D(Data):
save = save

def __init__(
self, values=[], symbol="", name="", unit="", symmetries={}, is_multiple=False, init_dict=None,
self,
values=[],
symbol="",
name="",
unit="",
symmetries={},
is_multiple=False,
init_dict=None,
):
"""Constructor of the class. Can be use in two ways :
- __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values
Expand All @@ -41,7 +48,8 @@ def __init__(
object or dict can be given for SciDataTool Object"""
if init_dict is not None: # Initialisation by dict
check_init_dict(
init_dict, ["values", "symbol", "name", "unit", "symmetries"]
init_dict,
["values", "symbol", "name", "unit", "symmetries", "is_multiple"],
)
# Overwrite default value with init_dict content
if "values" in list(init_dict.keys()):
Expand Down
4 changes: 4 additions & 0 deletions SciDataTool/Classes/DataLinspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
name="",
unit="",
symmetries={},
is_multiple=False,
init_dict=None,
):
"""Constructor of the class. Can be use in two ways :
Expand All @@ -64,6 +65,7 @@ def __init__(
"name",
"unit",
"symmetries",
"is_multiple",
],
)
# Overwrite default value with init_dict content
Expand All @@ -85,6 +87,8 @@ def __init__(
unit = init_dict["unit"]
if "symmetries" in list(init_dict.keys()):
symmetries = init_dict["symmetries"]
if "is_multiple" in list(init_dict.keys()):
is_multiple = init_dict["is_multiple"]
# Initialisation by argument
self.initial = initial
self.final = final
Expand Down

0 comments on commit 6d99429

Please sign in to comment.