Skip to content

Commit bfab942

Browse files
committed
Merge branch 'main' into feat/m2d_eddy_create_report
2 parents af89fea + da0f3f4 commit bfab942

File tree

6 files changed

+44
-55
lines changed

6 files changed

+44
-55
lines changed

pyaedt/application/Analysis.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def get_traces_for_plot(
538538
first_element_filter=None,
539539
second_element_filter=None,
540540
category="dB(S",
541-
differential_pairs=[],
541+
differential_pairs=None,
542542
):
543543
# type: (bool, bool, str, str, str, list) -> list
544544
"""Retrieve a list of traces of specified designs ready to use in plot reports.
@@ -557,9 +557,9 @@ def get_traces_for_plot(
557557
This parameter accepts ``*`` and ``?`` as special characters. The default is ``None``.
558558
category : str, optional
559559
Plot category name as in the report (including operator).
560-
The default is ``"dB(S"``, which is the plot category name for capacitance.
560+
The default is ``"dB(S)"``, which is the plot category name for capacitance.
561561
differential_pairs : list, optional
562-
Differential pairs defined. The default is ``[]``.
562+
Differential pairs defined. The default is ``None`` in which case an empty list is set.
563563
564564
Returns
565565
-------
@@ -576,6 +576,7 @@ def get_traces_for_plot(
576576
... first_element_filter="*_U1_data?",
577577
... second_element_filter="*_U0_*", category="dB(S")
578578
"""
579+
differential_pairs = [] if differential_pairs is None else differential_pairs
579580
if not first_element_filter:
580581
first_element_filter = "*"
581582
if not second_element_filter:

pyaedt/application/Design.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,7 +3767,7 @@ def archive_project(
37673767
project_path=None,
37683768
include_external_files=True,
37693769
include_results_file=True,
3770-
additional_files=[],
3770+
additional_files=None,
37713771
notes="",
37723772
):
37733773
"""Archive the AEDT project and add a message.
@@ -3781,7 +3781,8 @@ def archive_project(
37813781
include_results_file : bool, optional
37823782
Whether to include simulation results files in the archive. The default is ``True``.
37833783
additional_files : list, optional
3784-
List of additional files to add to the archive. The default is ``[]``.
3784+
List of additional files to add to the archive.
3785+
The default is ``None`` in which case an empty list is set.
37853786
notes : str, optional
37863787
Simulation notes to add to the archive. The default is ``""``.
37873788
@@ -3796,6 +3797,7 @@ def archive_project(
37963797
>>> oProject.Save
37973798
>>> oProject.SaveProjectArchive
37983799
"""
3800+
additional_files = [] if additional_files is None else additional_files
37993801
msg_text = "Saving {0} Project".format(self.project_name)
38003802
self.logger.info(msg_text)
38013803
if not project_path:

pyaedt/modeler/circuits/PrimitivesCircuit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,16 @@ def create_interface_port(self, name, location=None, angle=0):
342342
return False
343343

344344
@pyaedt_function_handler()
345-
def create_page_port(self, name, location=[], angle=0):
345+
def create_page_port(self, name, location=None, angle=0):
346346
"""Create a page port.
347347
348348
Parameters
349349
----------
350350
name : str
351351
Name of the port.
352352
location : list, optional
353-
Position on the X and Y axis. The default is ``None``.
353+
Position on the X and Y axis.
354+
If not provided the default is ``None``, in which case an empty list is set.
354355
angle : optional
355356
Angle rotation in degrees. The default is ``0``.
356357
@@ -364,6 +365,7 @@ def create_page_port(self, name, location=[], angle=0):
364365
365366
>>> oEditor.CreatePagePort
366367
"""
368+
location = [] if location is None else location
367369
xpos, ypos = self._get_location(location)
368370

369371
id = self.create_unique_id()

pyaedt/modeler/circuits/PrimitivesNexxim.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,8 @@ def create_new_component_from_symbol(
12411241
time_stamp=1591858313,
12421242
description="",
12431243
refbase="x",
1244-
parameters=[],
1245-
values=[],
1244+
parameters=None,
1245+
values=None,
12461246
gref="",
12471247
):
12481248
"""Create a component from a symbol.
@@ -1260,9 +1260,11 @@ def create_new_component_from_symbol(
12601260
refbase : str, optional
12611261
Reference base. The default is ``"U"``.
12621262
parameters : list
1263-
List of parameters. The default is ``[]``.
1263+
List of parameters.
1264+
If not provided the default is ``None``, in which case an empty list is set.
12641265
values : list
1265-
List of parameter values. The default is ``[]``.
1266+
List of parameter values.
1267+
If not provided the default is ``None``, in which case an empty list is set.
12661268
gref : str, optional
12671269
Global Reference
12681270
@@ -1277,6 +1279,8 @@ def create_new_component_from_symbol(
12771279
>>> oModelManager.Add
12781280
>>> oComponentManager.Add
12791281
"""
1282+
parameters = [] if parameters is None else parameters
1283+
values = [] if values is None else values
12801284
arg = [
12811285
"NAME:" + name,
12821286
"Info:=",

pyaedt/modules/solutions.py

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,29 +3159,29 @@ class FieldPlot:
31593159
def __init__(
31603160
self,
31613161
postprocessor,
3162-
objects=[],
3163-
surfaces=[],
3164-
lines=[],
3165-
cutplanes=[],
3162+
objects=None,
3163+
surfaces=None,
3164+
lines=None,
3165+
cutplanes=None,
31663166
solution="",
31673167
quantity="",
3168-
intrinsics={},
3169-
seeding_faces=[],
3170-
layer_nets=[],
3168+
intrinsics=None,
3169+
seeding_faces=None,
3170+
layer_nets=None,
31713171
layer_plot_type="LayerNetsExtFace",
31723172
):
31733173
self._postprocessor = postprocessor
31743174
self.oField = postprocessor.ofieldsreporter
3175-
self.volumes = objects
3176-
self.surfaces = surfaces
3177-
self.lines = lines
3178-
self.cutplanes = cutplanes
3179-
self.layer_nets = layer_nets
3175+
self.volumes = [] if objects is None else objects
3176+
self.surfaces = [] if surfaces is None else surfaces
3177+
self.lines = [] if lines is None else lines
3178+
self.cutplanes = [] if cutplanes is None else cutplanes
3179+
self.layer_nets = [] if layer_nets is None else layer_nets
31803180
self.layer_plot_type = layer_plot_type
3181-
self.seeding_faces = seeding_faces
3181+
self.seeding_faces = [] if seeding_faces is None else seeding_faces
31823182
self.solution = solution
31833183
self.quantity = quantity
3184-
self.intrinsics = intrinsics
3184+
self.intrinsics = {} if intrinsics is None else intrinsics
31853185
self.name = "Field_Plot"
31863186
self.plot_folder = "Field_Plot"
31873187
self.Filled = False
@@ -3308,21 +3308,11 @@ def intrinsicVar(self):
33083308
Returns
33093309
-------
33103310
list or dict
3311-
List or dictionary of the variables for the field plot.
3311+
Variables for the field plot.
33123312
"""
33133313
var = ""
3314-
if isinstance(self.intrinsics, list):
3315-
l = 0
3316-
while l < len(self.intrinsics):
3317-
val = self.intrinsics[l + 1]
3318-
if ":=" in self.intrinsics[l] and isinstance(self.intrinsics[l + 1], list):
3319-
val = self.intrinsics[l + 1][0]
3320-
ll = self.intrinsics[l].split(":=")
3321-
var += ll[0] + "='" + str(val) + "' "
3322-
l += 2
3323-
else:
3324-
for a in self.intrinsics:
3325-
var += a + "='" + str(self.intrinsics[a]) + "' "
3314+
for a in self.intrinsics:
3315+
var += a + "='" + str(self.intrinsics[a]) + "' "
33263316
return var
33273317

33283318
@property
@@ -3911,13 +3901,13 @@ def __init__(
39113901
max_frequency="1GHz",
39123902
ray_density=2,
39133903
bounces=5,
3914-
intrinsics={},
3904+
intrinsics=None,
39153905
):
39163906
self.is_creeping_wave = is_creeping_wave
39173907
self._postprocessor = postprocessor
39183908
self._ofield = postprocessor.ofieldsreporter
39193909
self.quantity = quantity
3920-
self.intrinsics = intrinsics
3910+
self.intrinsics = {} if intrinsics is None else intrinsics
39213911
self.name = "Field_Plot"
39223912
self.plot_folder = "Field_Plot"
39233913
self.max_frequency = max_frequency
@@ -3949,22 +3939,12 @@ def intrinsicVar(self):
39493939
39503940
Returns
39513941
-------
3952-
list or dict
3953-
List or dictionary of the variables for the field plot.
3942+
str
3943+
Variables for the field plot.
39543944
"""
39553945
var = ""
3956-
if isinstance(self.intrinsics, list):
3957-
l = 0
3958-
while l < len(self.intrinsics):
3959-
val = self.intrinsics[l + 1]
3960-
if ":=" in self.intrinsics[l] and isinstance(self.intrinsics[l + 1], list):
3961-
val = self.intrinsics[l + 1][0]
3962-
ll = self.intrinsics[l].split(":=")
3963-
var += ll[0] + "='" + str(val) + "' "
3964-
l += 2
3965-
else:
3966-
for a in self.intrinsics:
3967-
var += a + "='" + str(self.intrinsics[a]) + "' "
3946+
for a in self.intrinsics:
3947+
var += a + "='" + str(self.intrinsics[a]) + "' "
39683948
return var
39693949

39703950
@pyaedt_function_handler()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
"Programming Language :: Python :: 3.10",
2727
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
29-
"Topic :: Scientific/Engineering :: Libraries",
29+
"Topic :: Software Development :: Libraries",
3030
"Topic :: Scientific/Engineering :: Scientific/Engineering",
3131
"Topic :: Scientific/Engineering :: Scientific/Engineering :: Electronic Design Automation (EDA)",
3232
"Topic :: Scientific/Engineering :: Information Analysis",

0 commit comments

Comments
 (0)