From b5eb21348ae786917e258f83bc7ef53f33f92c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BChle=2C=20Laura=20Christine=20=28lakue103=29?= <laura.kuehle@uni-duesseldorf.de> Date: Tue, 21 Sep 2021 17:18:38 +0200 Subject: [PATCH] Added 'is_smooth()' to 'DiscontiuousConstant' class. --- Initial_Condition.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Initial_Condition.py b/Initial_Condition.py index 2fb972e..4015d2a 100644 --- a/Initial_Condition.py +++ b/Initial_Condition.py @@ -2,7 +2,7 @@ """ @author: Laura C. Kühle -TODO: Add is_smooth() to DiscontinuousConstant class +TODO: Add is_smooth() to DiscontinuousConstant class -> Done """ import numpy as np @@ -195,6 +195,10 @@ class Box(InitialCondition): Returns flag whether function is smooth. """ + def is_smooth(self): + """Returns flag that function is not smooth.""" + return False + def _get_point(self, x): """Evaluates function at given x-value. @@ -218,10 +222,6 @@ class Box(InitialCondition): else: return 0 - def is_smooth(self): - """Returns flag that function is not smooth.""" - return False - class FourPeakWave(InitialCondition): """Class for a function with four peaks. @@ -352,15 +352,6 @@ class Linear(InitialCondition): def _reset(self, config): """Resets instance variables. - Parameters - ---------- - config : dict - Additional parameters for initial condition. - - """ - def _reset(self, config): - """Resets instance variables. - Parameters ---------- config : dict @@ -500,6 +491,10 @@ class DiscontinuousConstant(InitialCondition): self._left_factor = config.pop('left_factor', 1) self._right_factor = config.pop('right_factor', 0.5) + def is_smooth(self): + """Returns flag that function is not smooth.""" + return False + def _get_point(self, x): """Evaluates function at given x-value. -- GitLab