From 6d9942964b3c2428c89e756188aeb1c7d0d1e0b0 Mon Sep 17 00:00:00 2001 From: helene-t Date: Tue, 12 May 2020 11:31:07 +0200 Subject: [PATCH] [NF] Added "is_multiple" key --- SciDataTool/Classes/Data1D.py | 12 ++++++++++-- SciDataTool/Classes/DataLinspace.py | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/SciDataTool/Classes/Data1D.py b/SciDataTool/Classes/Data1D.py index e071cc0a..b769a843 100644 --- a/SciDataTool/Classes/Data1D.py +++ b/SciDataTool/Classes/Data1D.py @@ -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 @@ -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()): diff --git a/SciDataTool/Classes/DataLinspace.py b/SciDataTool/Classes/DataLinspace.py index cf38567b..6398aece 100644 --- a/SciDataTool/Classes/DataLinspace.py +++ b/SciDataTool/Classes/DataLinspace.py @@ -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 : @@ -64,6 +65,7 @@ def __init__( "name", "unit", "symmetries", + "is_multiple", ], ) # Overwrite default value with init_dict content @@ -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