From 4f7bbf3bbf25c0ba3d60232e047d92180ea8cc5c Mon Sep 17 00:00:00 2001 From: "Gruber Felix (CR/ADX4.1)" Date: Mon, 8 Jul 2024 09:53:04 +0000 Subject: [PATCH 1/2] use raw strings, i.e., r"raw" --- .../test_aero_3D/test_aero_buildup/fuselage_transonics.py | 2 +- aerosandbox/library/aerodynamics/unsteady.py | 2 +- aerosandbox/library/gust_pitch_control.py | 2 +- aerosandbox/library/power_turboshaft.py | 2 +- aerosandbox/modeling/splines/hermite.py | 2 +- aerosandbox/structures/tube_spar_bending.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aerosandbox/aerodynamics/aero_3D/test_aero_3D/test_aero_buildup/fuselage_transonics.py b/aerosandbox/aerodynamics/aero_3D/test_aero_3D/test_aero_buildup/fuselage_transonics.py index a1cb1f126..bc765e277 100644 --- a/aerosandbox/aerodynamics/aero_3D/test_aero_3D/test_aero_buildup/fuselage_transonics.py +++ b/aerosandbox/aerodynamics/aero_3D/test_aero_3D/test_aero_buildup/fuselage_transonics.py @@ -50,7 +50,7 @@ p.show_plot( "Transonic Fuselage Drag", "Mach [-]", - "Drag Area $C_D \cdot A$ [m$^2$]" + r"Drag Area $C_D \cdot A$ [m$^2$]" ) print("%.4g" % aero["CD"][-1]) diff --git a/aerosandbox/library/aerodynamics/unsteady.py b/aerosandbox/library/aerodynamics/unsteady.py index ca5de7de1..e1ad045d7 100644 --- a/aerosandbox/library/aerodynamics/unsteady.py +++ b/aerosandbox/library/aerodynamics/unsteady.py @@ -396,6 +396,6 @@ def linear_ramp_pitch(reduced_time: float) -> float: plt.plot(reduced_time, added_mass_lift, label="Added Mass Lift", lw=2) plt.legend() plt.xlabel("Reduced time") - plt.ylabel("$C_\ell$") + plt.ylabel(r"$C_\ell$") plt.title("Guassian Pitch Maneuver Through Top-Hat Gust") plt.show() \ No newline at end of file diff --git a/aerosandbox/library/gust_pitch_control.py b/aerosandbox/library/gust_pitch_control.py index 70b22b4c6..ed7c88121 100644 --- a/aerosandbox/library/gust_pitch_control.py +++ b/aerosandbox/library/gust_pitch_control.py @@ -121,7 +121,7 @@ def calculate_transients(self): ax1.legend(loc="lower left") ax2.legend(loc="lower right") ax1.set_xlabel("Reduced time") - ax1.set_ylabel("$C_\ell$") + ax1.set_ylabel(r"$C_\ell$") ax2.set_ylabel("Angle of attack, degrees") plt.title("Optimal Pitch Maneuver Through Top-Hat Gust") plt.show() diff --git a/aerosandbox/library/power_turboshaft.py b/aerosandbox/library/power_turboshaft.py index dd20694cc..28e788874 100644 --- a/aerosandbox/library/power_turboshaft.py +++ b/aerosandbox/library/power_turboshaft.py @@ -151,7 +151,7 @@ def thermal_efficiency_turboshaft( p.show_plot( "Turboshaft: Thermal Efficiency at Partial Power", "Throttle Setting [-]", - "Thermal Efficiency Knockdown relative to Design Point [-] $\eta / \eta_\mathrm{max}$" + r"Thermal Efficiency Knockdown relative to Design Point [-] $\eta / \eta_\mathrm{max}$" ) ##### Do Weight/OPR Efficiency Plot ##### diff --git a/aerosandbox/modeling/splines/hermite.py b/aerosandbox/modeling/splines/hermite.py index d6045f615..8d986ec42 100644 --- a/aerosandbox/modeling/splines/hermite.py +++ b/aerosandbox/modeling/splines/hermite.py @@ -80,7 +80,7 @@ def cosine_hermite_patch( dfdx_b: float, extrapolation: str = 'continue', ) -> Union[float, np.ndarray]: - """ + r""" Computes a Hermite patch (i.e., values + derivatives at endpoints) that uses a cosine function to blend between linear segments. diff --git a/aerosandbox/structures/tube_spar_bending.py b/aerosandbox/structures/tube_spar_bending.py index 27d5b5a91..8e55a6a43 100644 --- a/aerosandbox/structures/tube_spar_bending.py +++ b/aerosandbox/structures/tube_spar_bending.py @@ -332,7 +332,7 @@ def draw(self, show=True): # "Local Slope [deg]": np.arctan2d(self.du, 1), "Local Load [N/m]" : self.distributed_force, "Axial Stress [MPa]" : self.stress_axial / 1e6, - "Bending $EI$ [N $\cdot$ m$^2$]": self.elastic_modulus * self.I, + r"Bending $EI$ [N $\cdot$ m$^2$]": self.elastic_modulus * self.I, "Tube Diameter [m]" : self.diameter, "Wall Thickness [m]" : self.wall_thickness, } From f057634f543c4c535ca460dc511cb2c70d9d954a Mon Sep 17 00:00:00 2001 From: "Gruber Felix (CR/ADX4.1)" Date: Mon, 8 Jul 2024 09:53:29 +0000 Subject: [PATCH 2/2] add missing $ ... $ --- aerosandbox/modeling/splines/hermite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aerosandbox/modeling/splines/hermite.py b/aerosandbox/modeling/splines/hermite.py index 8d986ec42..2095405c3 100644 --- a/aerosandbox/modeling/splines/hermite.py +++ b/aerosandbox/modeling/splines/hermite.py @@ -85,7 +85,7 @@ def cosine_hermite_patch( linear segments. The end result is conceptually similar to a cubic Hermite patch, but computation is faster and the patch is - C^\infty-continuous. + $C^\infty$-continuous. Args: x: Scalar or array of values at which to evaluate the patch.