From a3d88d5dd8dfaef2ac304f30704d284f162894ed Mon Sep 17 00:00:00 2001 From: jguarato Date: Mon, 8 Apr 2024 11:17:38 -0300 Subject: [PATCH] Fix summary plot --- ross/results.py | 9 +++------ ross/rotor_assembly.py | 7 ++++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ross/results.py b/ross/results.py index 8231c53b8..aa53fffbf 100644 --- a/ross/results.py +++ b/ross/results.py @@ -4071,14 +4071,11 @@ class SummaryResults(Results): The figure object with the tables plot. """ - def __init__( - self, df_shaft, df_disks, df_bearings, nodes_pos, brg_forces, CG, Ip, tag - ): + def __init__(self, df_shaft, df_disks, df_bearings, brg_forces, CG, Ip, tag): self.df_shaft = df_shaft self.df_disks = df_disks self.df_bearings = df_bearings self.brg_forces = brg_forces - self.nodes_pos = np.array(nodes_pos) self.CG = CG self.Ip = Ip self.tag = tag @@ -4127,7 +4124,7 @@ def plot(self): "Tag": self.df_disks["tag"], "Shaft number": self.df_disks["shaft_number"], "Node": self.df_disks["n"], - "Nodal Position": self.nodes_pos[self.df_bearings["n"]], + "Nodal Position": self.df_disks["nodes_pos_l"], "Mass": self.df_disks["m"].map("{:.3f}".format), "Ip": self.df_disks["Ip"].map("{:.3e}".format), } @@ -4137,7 +4134,7 @@ def plot(self): "Shaft number": self.df_bearings["shaft_number"], "Node": self.df_bearings["n"], "N_link": self.df_bearings["n_link"], - "Nodal Position": self.nodes_pos[self.df_bearings["n"]], + "Nodal Position": self.df_bearings["nodes_pos_l"], "Bearing force": list(self.brg_forces.values()), } diff --git a/ross/rotor_assembly.py b/ross/rotor_assembly.py index 82c572cc9..af8df03cb 100644 --- a/ross/rotor_assembly.py +++ b/ross/rotor_assembly.py @@ -2957,13 +2957,18 @@ def summary(self): >>> # to display the plot use the command: >>> # show(table) """ + self.df_disks = pd.merge( + self.df_disks, self.df[["tag", "nodes_pos_l"]], on="tag", how="left" + ) + self.df_bearings = pd.merge( + self.df_bearings, self.df[["tag", "nodes_pos_l"]], on="tag", how="left" + ) self.run_static() forces = self.bearing_forces_tag results = SummaryResults( self.df_shaft, self.df_disks, self.df_bearings, - self.nodes_pos, forces, self.CG, self.Ip,