Skip to content

Commit 6ff545e

Browse files
committed
[CC] Updating graph title for publication
1 parent 7a50bee commit 6ff545e

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

Methods/Machine/MachineUD/plot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def plot(
7171
raise ValueError("Comp_machine is not available for MachineUD")
7272
axes.set_xlabel("(m)")
7373
axes.set_ylabel("(m)")
74-
axes.set_title("Machine")
74+
if self.name in [None, ""]:
75+
axes.set_title("Machine")
76+
else:
77+
axes.set_title(self.name)
7578

7679
# Axis Setup
7780
axis("equal")

Tests/Plot/test_ICEM_2020.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def test_MachineUD(self):
199199
"""Figure 12: Check that you can plot a machine with 4 laminations
200200
"""
201201
machine = MachineUD()
202+
machine.name = "Machine with 4 laminations"
202203

203204
# Main geometry parameter
204205
Rext = 170e-3 # Exterior radius of outter lamination
@@ -303,6 +304,7 @@ def test_SlotUD(self):
303304
# Enfore first point on rotor bore
304305
Rrotor = abs(0.205917893677990 - 0.107339745962156j)
305306
machine = MachineSRM()
307+
machine.name = "User-Defined Slot"
306308
# Stator definintion
307309
machine.stator = LamSlotWind(
308310
Rint=Rrotor + 5e-3, Rext=Rrotor + 120e-3, is_internal=False, is_stator=True
@@ -354,6 +356,7 @@ def test_WindingUD(self):
354356
"""
355357
plt.close("all")
356358
machine = MachineDFIM()
359+
machine.name = "User Defined Winding"
357360
# Rotor definition
358361
machine.rotor = LamSlotWind(
359362
Rint=0.2,

Tests/Plot/test_Lam_Mag_surface_plot.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,11 @@ def test_Lam_Mag_10_surface(self):
5151
)
5252
rotor.mat_type.mag = MatMagnetics(Wlam=0.5e-3)
5353

54-
stator = Lamination(
55-
Rint=230e-3,
56-
Rext=0.3,
57-
is_internal=False,
58-
is_stator=True,
59-
L1=0.5,
60-
Nrvd=0,
61-
Wrvd=0.05,
62-
)
63-
stator.mat_type.mag = MatMagnetics(Wlam=0.5e-3)
64-
6554
rotor.plot()
6655
fig = plt.gcf()
6756
self.assertEqual(len(fig.axes[0].patches), 10)
6857
fig.savefig(join(save_path, "test_Lam_Mag_10s_2-Rotor.png"))
6958

70-
stator.plot()
71-
fig = plt.gcf()
72-
self.assertEqual(len(fig.axes[0].patches), 2)
73-
fig.savefig(join(save_path, "test_Lam_Mag_10s_3-Stator.png"))
74-
7559
magnet2 = [MagnetType10(Lmag=0.5, Hmag=0.02, Wmag=0.04)]
7660
rotor.slot = SlotMFlat(Zs=8, W0=0.04, W0_is_rad=False, magnet=magnet2)
7761
rotor.plot()

0 commit comments

Comments
 (0)