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