From ef1722d92383fe470e35874a9c2a957b8ec69963 Mon Sep 17 00:00:00 2001 From: anonymousPolon <139952482+anonymousPolon@users.noreply.github.com> Date: Sun, 21 Jul 2024 01:16:45 +0700 Subject: [PATCH] Update profoil_canvas.py there is an error when loading new in file into the GUI, turns out setting ue_ax.lines equal to empty array create a problem with setter and getter. Fix it by instead of set the lines and collection into empty array, just call method clear. --- profoil_canvas.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/profoil_canvas.py b/profoil_canvas.py index dbecb12..abef0a0 100644 --- a/profoil_canvas.py +++ b/profoil_canvas.py @@ -189,11 +189,11 @@ def clear_axes(self): """ clears all axes data such that new session with new airfoil can be loaded. """ - self.ue_ax.lines=[] - self.ue_ax.collections=[] + self.ue_ax.clear() + # self.ue_ax.collections=[] - self.xy_ax.lines=[] - self.xy_ax.collections=[] + self.xy_ax.clear() + # self.xy_ax.collections=[] self.clear_an_ax() @@ -729,4 +729,4 @@ def save_airfoil(self, out_file): file_path = Path(out_file) file_path.parent.mkdir(parents=True, exist_ok=True) with file_path.open("w") as f: - f.write(Path(WORKDIR/"profoil.in").open().read()) \ No newline at end of file + f.write(Path(WORKDIR/"profoil.in").open().read())