@@ -287,7 +287,7 @@ def sources(self):
287
287
return props
288
288
289
289
@property
290
- def excitation_names (self ):
290
+ def excitations (self ):
291
291
"""List of port names.
292
292
293
293
Returns
@@ -304,36 +304,24 @@ def excitation_names(self):
304
304
return ports
305
305
306
306
@property
307
- def excitation_objets (self ):
307
+ def excitation_objects (self ):
308
308
"""List of port objects.
309
309
310
310
Returns
311
311
-------
312
- list
312
+ dict
313
313
List of port objects.
314
314
"""
315
- return [self .excitations [name ] for name in self .excitations ]
316
-
317
- @property
318
- def excitations (self ):
319
- """Get all ports.
320
-
321
- Returns
322
- -------
323
- list
324
- List of ports.
325
-
326
- """
327
315
props = {}
328
316
if not self ._internal_excitations :
329
- for port in self .excitation_names :
317
+ for port in self .excitations :
330
318
props [port ] = Excitations (self , port )
331
319
self ._internal_excitations = props
332
320
else :
333
321
props = self ._internal_excitations
334
- if not sorted (list (props .keys ())) == sorted (self .excitation_names ):
322
+ if not sorted (list (props .keys ())) == sorted (self .excitations ):
335
323
a = set (str (x ) for x in props .keys ())
336
- b = set (str (x ) for x in self .excitation_names )
324
+ b = set (str (x ) for x in self .excitations )
337
325
if len (a ) == len (b ):
338
326
unmatched_new_name = list (b - a )[0 ]
339
327
unmatched_old_name = list (a - b )[0 ]
@@ -342,44 +330,15 @@ def excitations(self):
342
330
else :
343
331
if len (a ) > len (b ):
344
332
for old_port in props .keys ():
345
- if old_port not in self .excitation_names :
333
+ if old_port not in self .excitations :
346
334
del props [old_port ]
347
335
return props
348
336
else :
349
- for new_port in self .excitation_names :
337
+ for new_port in self .excitations :
350
338
if new_port not in props .keys ():
351
339
props [new_port ] = Excitations (self , new_port )
352
340
return props
353
341
354
- @property
355
- def get_all_sparameter_list (self , excitation_names = []):
356
- """List of all S parameters for a list of excitations.
357
-
358
- Parameters
359
- ----------
360
- excitation_names : list, optional
361
- List of excitations. The default value is ``[]``, in which case
362
- the S parameters for all excitations are to be provided.
363
- For example, ``["1", "2"]``.
364
-
365
- Returns
366
- -------
367
- list of str
368
- List of strings representing the S parameters of the excitations.
369
- For example, ``"S(1,1)", "S(1,2)", "S(2,2)"``.
370
-
371
- """
372
- if not excitation_names :
373
- excitation_names = list (self .excitations .keys ())
374
- spar = []
375
- k = 0
376
- for i in excitation_names :
377
- k = excitation_names .index (i )
378
- while k < len (excitation_names ):
379
- spar .append ("S({},{})" .format (i , excitation_names [k ]))
380
- k += 1
381
- return spar
382
-
383
342
@pyaedt_function_handler ()
384
343
def get_all_return_loss_list (self , excitation_names = None , excitation_name_prefix = "" ):
385
344
"""Retrieve a list of all return losses for a list of exctitations.
@@ -408,7 +367,7 @@ def get_all_return_loss_list(self, excitation_names=None, excitation_name_prefix
408
367
excitation_names = []
409
368
410
369
if not excitation_names :
411
- excitation_names = list (self .excitations . keys () )
370
+ excitation_names = list (self .excitations )
412
371
if excitation_name_prefix :
413
372
excitation_names = [i for i in excitation_names if excitation_name_prefix .lower () in i .lower ()]
414
373
spar = []
@@ -450,9 +409,9 @@ def get_all_insertion_loss_list(self, trlist=None, reclist=None, tx_prefix="", r
450
409
451
410
spar = []
452
411
if not trlist :
453
- trlist = [i for i in list (self .excitations . keys () ) if tx_prefix in i ]
412
+ trlist = [i for i in list (self .excitations ) if tx_prefix in i ]
454
413
if not reclist :
455
- reclist = [i for i in list (self .excitations . keys () ) if rx_prefix in i ]
414
+ reclist = [i for i in list (self .excitations ) if rx_prefix in i ]
456
415
if len (trlist ) != len (reclist ):
457
416
self .logger .error ("The TX and RX lists should be the same length." )
458
417
return False
@@ -485,7 +444,7 @@ def get_next_xtalk_list(self, trlist=[], tx_prefix=""):
485
444
"""
486
445
next_xtalks = []
487
446
if not trlist :
488
- trlist = [i for i in list (self .excitations . keys () ) if tx_prefix in i ]
447
+ trlist = [i for i in list (self .excitations ) if tx_prefix in i ]
489
448
for i in trlist :
490
449
k = trlist .index (i ) + 1
491
450
while k < len (trlist ):
@@ -528,9 +487,9 @@ def get_fext_xtalk_list(self, trlist=None, reclist=None, tx_prefix="", rx_prefix
528
487
"""
529
488
fext = []
530
489
if trlist is None :
531
- trlist = [i for i in list (self .excitations . keys () ) if tx_prefix in i ]
490
+ trlist = [i for i in list (self .excitations ) if tx_prefix in i ]
532
491
if reclist is None :
533
- reclist = [i for i in list (self .excitations . keys () ) if rx_prefix in i ]
492
+ reclist = [i for i in list (self .excitations ) if rx_prefix in i ]
534
493
for i in trlist :
535
494
for k in reclist :
536
495
if not skip_same_index_couples or reclist .index (k ) != trlist .index (i ):
0 commit comments