Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
Expand All @@ -17,14 +17,14 @@
},
{
"name": "Python: Code gen (GUI Ui only)",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/pyleecan/Generator/run_generate_GUI.py",
"console": "integratedTerminal"
},
{
"name": "Python: Code gen (GUI resources only)",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/pyleecan/Generator/run_generate_GUI_resources.py",
"console": "integratedTerminal",
Expand All @@ -34,7 +34,7 @@
},
{
"name": "Python: Code gen (Classes from csv)",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/pyleecan/Generator/run_generate_classes.py",
"console": "integratedTerminal",
Expand All @@ -45,7 +45,7 @@
},
{
"name": "Python: Run GUI",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/pyleecan/run_GUI.py",
"console": "integratedTerminal",
Expand All @@ -56,7 +56,7 @@
},
{
"name": "Python: Run class gen GUI",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/pyleecan/Generator/run_class_generator_GUI.py",
"console": "integratedTerminal",
Expand All @@ -67,7 +67,7 @@
},
{
"name": "Python: Run script",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/script.py",
"console": "integratedTerminal",
Expand All @@ -78,7 +78,7 @@
},
{
"name": "Python: Current File (External Terminal)",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
Expand Down
16 changes: 11 additions & 5 deletions Tests/GUI/Dialog/DMachineSetup/PHole/test_PHoleMUD.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,15 @@ def test_load_dxf_11_magnets(self):
assert wid_hole.g_mat_layout.count() == 13

for idx_mag_wid in range(1, wid_hole.g_mat_layout.count()):
idx_label = (
wid_hole.g_mat_layout.itemAt(idx_mag_wid)
.wid.in_mat_type.text()
.split(" ")[-1]
)
widget = wid_hole.g_mat_layout.itemAt(idx_mag_wid).widget()
idx_label = widget.in_mat_type.text().split(" ")[-1]
assert int(idx_label) == idx_mag_wid - 1


if __name__ == "__main__":
a = TestPHoleMUD()
a.setup_class()
a.setup_method()
a.test_load_dxf_11_magnets()

print("Done")
2 changes: 1 addition & 1 deletion Tests/GUI/Dialog/DMachineSetup/test_notche_addition.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,5 +578,5 @@ def test_set_empty_floatedit(self):
# a.test_notch_addition_without_input()
# a.test_notch_addition_wrong_input()
# a.test_set_empty_floatedit()
a.teardown_class()
# a.teardown_class()
print("Done")
6 changes: 3 additions & 3 deletions pyleecan/GUI/Dialog/DMachineSetup/DAVDuct/DAVDuct.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, lamination):
# Set Help URL
self.b_help.hide()

self.b_new.clicked.connect(self.s_add)
self.b_new.clicked.connect(lambda: self.s_add(vent=None, idx_vent=None))
self.tab_vent.tabCloseRequested.connect(self.s_remove)
self.b_plot.clicked.connect(self.plot)
self.b_cancel.clicked.connect(self.reject)
Expand All @@ -55,7 +55,7 @@ def keyPressEvent(self, event):
self.valid_vent()
event.accept()

def s_add(self, vent=False, idx_vent=None):
def s_add(self, vent=None, idx_vent=None):
"""Signal to add a new hole

Parameters
Expand All @@ -66,7 +66,7 @@ def s_add(self, vent=False, idx_vent=None):
The ventilation to init the GUI with
"""
# Create a new hole if needed
if type(vent) is bool:
if vent is None:
# Default Hole is Circular
vent_obj = VentilationCirc()
vent_obj._set_None()
Expand Down
2 changes: 1 addition & 1 deletion pyleecan/GUI/Dialog/DMachineSetup/DNotchTab/DNotchTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, machine, is_stator=False, material_dict=None):
# self.b_help.hide()

# Connect the slot
self.b_add.clicked.connect(self.s_add)
self.b_add.clicked.connect(lambda: self.s_add(notch=None, idx_notch=None))
self.tab_notch.tabCloseRequested.connect(self.s_remove)
self.b_ok.clicked.connect(self.update_and_close)
self.b_cancel.clicked.connect(self.reject)
Expand Down
6 changes: 3 additions & 3 deletions pyleecan/GUI/Dialog/DMachineSetup/SMHoleMag/SMHoleMag.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, machine, material_dict, is_stator=False):

# Connect the slot
self.tab_hole.tabCloseRequested.connect(self.s_remove)
self.b_add.clicked.connect(self.s_add)
self.b_add.clicked.connect(lambda: self.s_add(hole=None))

self.b_plot.clicked.connect(self.s_plot)

Expand Down Expand Up @@ -108,7 +108,7 @@ def set_hole_pitch(self, Zh):
+ " [rad]"
)

def s_add(self, hole=False):
def s_add(self, hole=None):
"""Signal to add a new hole

Parameters
Expand All @@ -125,7 +125,7 @@ def s_add(self, hole=False):
else:
is_mag = True
# Create a new hole if needed
if type(hole) is bool:
if hole is None:
self.obj.hole.append(HoleM50())
hole = self.obj.hole[-1]
hole._set_None()
Expand Down
7 changes: 7 additions & 0 deletions pyleecan/Methods/Machine/Lamination/build_yoke_side_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ def merge_line_list(Z1, Z2, label, inter_list):
)
ii += 1
line.prop_dict[BOUNDARY_PROP_LAB] = label + "-" + str(ii)
line_list.append(
Segment(
line.get_begin(),
line.get_end(),
prop_dict={BOUNDARY_PROP_LAB: label + "-" + str(ii)},
)
)
ii += 1
Zb = line.get_end()
# Add last line (or Z1 to Z2 if no intersection)
Expand Down