Skip to content

posx and posy variable name replacement to standardization xpos and ypos #1069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2022
Merged
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
6 changes: 3 additions & 3 deletions pyaedt/modeler/Model3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ def create_waveguide(
origin[2] -= wg_thickness
origin[1] -= wg_thickness
centers = [f.center for f in airbox.faces]
posx = [i[wg_direction_axis] for i in centers]
mini = posx.index(min(posx))
maxi = posx.index(max(posx))
xpos = [i[wg_direction_axis] for i in centers]
mini = xpos.index(min(xpos))
maxi = xpos.index(max(xpos))
if create_sheets_on_openings:
p1 = self.create_object_from_face(airbox.faces[mini].id)
p2 = self.create_object_from_face(airbox.faces[maxi].id)
Expand Down
16 changes: 8 additions & 8 deletions pyaedt/modeler/Model3DLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,17 @@ def _arg_with_dim(self, value, units=None):
return val

def _pos_with_arg(self, pos, units=None):
posx = self._arg_with_dim(pos[0], units)
xpos = self._arg_with_dim(pos[0], units)
if len(pos) < 2:
posy = self._arg_with_dim(0, units)
ypos = self._arg_with_dim(0, units)
else:
posy = self._arg_with_dim(pos[1], units)
ypos = self._arg_with_dim(pos[1], units)
if len(pos) < 3:
posz = self._arg_with_dim(0, units)
zpos = self._arg_with_dim(0, units)
else:
posz = self._arg_with_dim(pos[2], units)
zpos = self._arg_with_dim(pos[2], units)

return posx, posy, posz
return xpos, ypos, zpos

@pyaedt_function_handler()
def change_property(self, property_object, property_name, property_value, property_tab="BaseElementTab"):
Expand Down Expand Up @@ -249,14 +249,14 @@ def change_property(self, property_object, property_name, property_value, proper
]
)
elif isinstance(property_value, (str, float, int)):
posx = self._arg_with_dim(property_value, self.model_units)
xpos = self._arg_with_dim(property_value, self.model_units)
self.oeditor.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:" + property_tab,
["NAME:PropServers", property_object],
["NAME:ChangedProps", ["NAME:" + property_name, "Value:=", posx]],
["NAME:ChangedProps", ["NAME:" + property_name, "Value:=", xpos]],
],
]
)
Expand Down
12 changes: 6 additions & 6 deletions pyaedt/modeler/Primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3466,17 +3466,17 @@ def _arg_with_dim(self, prop_value, units=None):

@pyaedt_function_handler()
def _pos_with_arg(self, pos, units=None):
posx = self._arg_with_dim(pos[0], units)
xpos = self._arg_with_dim(pos[0], units)
if len(pos) < 2:
posy = self._arg_with_dim(0, units)
ypos = self._arg_with_dim(0, units)
else:
posy = self._arg_with_dim(pos[1], units)
ypos = self._arg_with_dim(pos[1], units)
if len(pos) < 3:
posz = self._arg_with_dim(0, units)
zpos = self._arg_with_dim(0, units)
else:
posz = self._arg_with_dim(pos[2], units)
zpos = self._arg_with_dim(pos[2], units)

return posx, posy, posz
return xpos, ypos, zpos

@pyaedt_function_handler()
def _str_list(self, theList):
Expand Down
6 changes: 3 additions & 3 deletions pyaedt/modeler/PrimitivesCircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ def create_interface_port(self, name, location=[], angle=0):
>>> oEditor.CreateIPort
"""
if location:
posx, posy = location[0], location[1]
xpos, ypos = location[0], location[1]
else:
posx, posy = self._get_location(location)
xpos, ypos = self._get_location(location)
id = self.create_unique_id()
arg1 = ["NAME:IPortProps", "Name:=", name, "Id:=", id]
arg2 = ["NAME:Attributes", "Page:=", 1, "X:=", posx, "Y:=", posy, "Angle:=", angle, "Flip:=", False]
arg2 = ["NAME:Attributes", "Page:=", 1, "X:=", xpos, "Y:=", ypos, "Angle:=", angle, "Flip:=", False]
id = self._oeditor.CreateIPort(arg1, arg2)

id = int(id.split(";")[1])
Expand Down
6 changes: 1 addition & 5 deletions pyaedt/modeler/PrimitivesNexxim.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def add_subcircuit_3dlayout(self, sourcename):
return False

@pyaedt_function_handler()
def create_field_model(self, design_name, solution_name, pin_names, model_type="hfss", posx=0, posy=1):
def create_field_model(self, design_name, solution_name, pin_names, model_type="hfss"):
"""Create a field model.

Parameters
Expand All @@ -211,10 +211,6 @@ def create_field_model(self, design_name, solution_name, pin_names, model_type="
List of the pin names.
model_type : str, optional
Type of the model. The default is ``"hfss"``.
posx : float, optional
Position on the X axis. The default is ``0``.
posy : float, optional.
Position on the Y axis. The default is ``1``.

Returns
-------
Expand Down