Skip to content

Commit 198b7ef

Browse files
- In create_field_model. posx and posy were not used (#1069)
- Replace posx,posy,posz in all methods less deprecated ones
1 parent 5de2aae commit 198b7ef

File tree

5 files changed

+21
-25
lines changed

5 files changed

+21
-25
lines changed

pyaedt/modeler/Model3D.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,9 @@ def create_waveguide(
445445
origin[2] -= wg_thickness
446446
origin[1] -= wg_thickness
447447
centers = [f.center for f in airbox.faces]
448-
posx = [i[wg_direction_axis] for i in centers]
449-
mini = posx.index(min(posx))
450-
maxi = posx.index(max(posx))
448+
xpos = [i[wg_direction_axis] for i in centers]
449+
mini = xpos.index(min(xpos))
450+
maxi = xpos.index(max(xpos))
451451
if create_sheets_on_openings:
452452
p1 = self.create_object_from_face(airbox.faces[mini].id)
453453
p2 = self.create_object_from_face(airbox.faces[maxi].id)

pyaedt/modeler/Model3DLayout.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,17 @@ def _arg_with_dim(self, value, units=None):
185185
return val
186186

187187
def _pos_with_arg(self, pos, units=None):
188-
posx = self._arg_with_dim(pos[0], units)
188+
xpos = self._arg_with_dim(pos[0], units)
189189
if len(pos) < 2:
190-
posy = self._arg_with_dim(0, units)
190+
ypos = self._arg_with_dim(0, units)
191191
else:
192-
posy = self._arg_with_dim(pos[1], units)
192+
ypos = self._arg_with_dim(pos[1], units)
193193
if len(pos) < 3:
194-
posz = self._arg_with_dim(0, units)
194+
zpos = self._arg_with_dim(0, units)
195195
else:
196-
posz = self._arg_with_dim(pos[2], units)
196+
zpos = self._arg_with_dim(pos[2], units)
197197

198-
return posx, posy, posz
198+
return xpos, ypos, zpos
199199

200200
@pyaedt_function_handler()
201201
def change_property(self, property_object, property_name, property_value, property_tab="BaseElementTab"):
@@ -249,14 +249,14 @@ def change_property(self, property_object, property_name, property_value, proper
249249
]
250250
)
251251
elif isinstance(property_value, (str, float, int)):
252-
posx = self._arg_with_dim(property_value, self.model_units)
252+
xpos = self._arg_with_dim(property_value, self.model_units)
253253
self.oeditor.ChangeProperty(
254254
[
255255
"NAME:AllTabs",
256256
[
257257
"NAME:" + property_tab,
258258
["NAME:PropServers", property_object],
259-
["NAME:ChangedProps", ["NAME:" + property_name, "Value:=", posx]],
259+
["NAME:ChangedProps", ["NAME:" + property_name, "Value:=", xpos]],
260260
],
261261
]
262262
)

pyaedt/modeler/Primitives.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3466,17 +3466,17 @@ def _arg_with_dim(self, prop_value, units=None):
34663466

34673467
@pyaedt_function_handler()
34683468
def _pos_with_arg(self, pos, units=None):
3469-
posx = self._arg_with_dim(pos[0], units)
3469+
xpos = self._arg_with_dim(pos[0], units)
34703470
if len(pos) < 2:
3471-
posy = self._arg_with_dim(0, units)
3471+
ypos = self._arg_with_dim(0, units)
34723472
else:
3473-
posy = self._arg_with_dim(pos[1], units)
3473+
ypos = self._arg_with_dim(pos[1], units)
34743474
if len(pos) < 3:
3475-
posz = self._arg_with_dim(0, units)
3475+
zpos = self._arg_with_dim(0, units)
34763476
else:
3477-
posz = self._arg_with_dim(pos[2], units)
3477+
zpos = self._arg_with_dim(pos[2], units)
34783478

3479-
return posx, posy, posz
3479+
return xpos, ypos, zpos
34803480

34813481
@pyaedt_function_handler()
34823482
def _str_list(self, theList):

pyaedt/modeler/PrimitivesCircuit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ def create_interface_port(self, name, location=[], angle=0):
249249
>>> oEditor.CreateIPort
250250
"""
251251
if location:
252-
posx, posy = location[0], location[1]
252+
xpos, ypos = location[0], location[1]
253253
else:
254-
posx, posy = self._get_location(location)
254+
xpos, ypos = self._get_location(location)
255255
id = self.create_unique_id()
256256
arg1 = ["NAME:IPortProps", "Name:=", name, "Id:=", id]
257-
arg2 = ["NAME:Attributes", "Page:=", 1, "X:=", posx, "Y:=", posy, "Angle:=", angle, "Flip:=", False]
257+
arg2 = ["NAME:Attributes", "Page:=", 1, "X:=", xpos, "Y:=", ypos, "Angle:=", angle, "Flip:=", False]
258258
id = self._oeditor.CreateIPort(arg1, arg2)
259259

260260
id = int(id.split(";")[1])

pyaedt/modeler/PrimitivesNexxim.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def add_subcircuit_3dlayout(self, sourcename):
198198
return False
199199

200200
@pyaedt_function_handler()
201-
def create_field_model(self, design_name, solution_name, pin_names, model_type="hfss", posx=0, posy=1):
201+
def create_field_model(self, design_name, solution_name, pin_names, model_type="hfss"):
202202
"""Create a field model.
203203
204204
Parameters
@@ -211,10 +211,6 @@ def create_field_model(self, design_name, solution_name, pin_names, model_type="
211211
List of the pin names.
212212
model_type : str, optional
213213
Type of the model. The default is ``"hfss"``.
214-
posx : float, optional
215-
Position on the X axis. The default is ``0``.
216-
posy : float, optional.
217-
Position on the Y axis. The default is ``1``.
218214
219215
Returns
220216
-------

0 commit comments

Comments
 (0)