From 2e1d21324d490ce6cd44b9afdce1698cb8426650 Mon Sep 17 00:00:00 2001 From: klounis Date: Tue, 19 Dec 2023 12:59:55 +0100 Subject: [PATCH] update in the data_preprocessing method --- rocketpy/mathutils/function.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rocketpy/mathutils/function.py b/rocketpy/mathutils/function.py index 679f2c8e8..5d89e8840 100644 --- a/rocketpy/mathutils/function.py +++ b/rocketpy/mathutils/function.py @@ -210,7 +210,7 @@ def set_source(self, source): source = np.loadtxt(file, delimiter=",", dtype=float) except ValueError: # If an error occurs, headers are present - source = np.loadtxt(source, delimiter=",", dtype=float, skiprows=1) + source = self.data_preprocessing(source) except Exception as e: raise ValueError( "The source file is not a valid csv or txt file." @@ -1153,11 +1153,7 @@ def data_preprocessing(self, source): writer = csv.writer(output_file, delimiter=',') writer.writerows(data_no_headers) - return Function( - source=output_path, - interpolation=self.__interpolation__, - extrapolation=self.__extrapolation__, - ) + return output_path