Skip to content

FEAT: add EmitterNode #6225

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

Open
wants to merge 93 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
935d091
EMIT API branch
jsalant22 Jan 22, 2025
f14755b
Add first draft of generated nodes and basic interface
bryankaylor Jan 28, 2025
4aef45e
New version of generated nodes
bryankaylor Jan 31, 2025
3cce1c1
Updated generated nodes and interface
bryankaylor Feb 1, 2025
04c4218
Add generated module init file, update EmitNode
bryankaylor Feb 4, 2025
3f33e2a
Add node functions for getting children
bryankaylor Feb 5, 2025
bfef0cf
Update generated nodes spacing and add_ methods, move NodeInterface m…
bryankaylor Feb 11, 2025
3aac82f
Add equality operator to EmitNode class
bryankaylor Feb 14, 2025
70100fd
Remove equality operator from generated nodes
bryankaylor Feb 14, 2025
84f6c32
update revision and result classes for api changes
jsalant22 Feb 14, 2025
5d0ece1
Merge branch 'F932911' of https://github.com/ansys/pyaedt into F932911
jsalant22 Feb 14, 2025
68034da
use display names for access nodes
jsalant22 Feb 24, 2025
fcee90c
add units support
jsalant22 Feb 26, 2025
c280da2
fix unit parsing
jsalant22 Feb 28, 2025
32060dd
Add updated generated nodes, fix emit allowed unit names, fix emit de…
bryankaylor Mar 4, 2025
6a06ab5
Fix revision constructor for 252, fix units
bryankaylor Mar 13, 2025
5501be5
Update results and revision modules to use new result API
bryankaylor Mar 24, 2025
0633784
Revert change of GetKeptResultProperties to GetResultProperties
bryankaylor Mar 24, 2025
f5b5780
Add EmitterBand and TxSpectralProfEmitter classes (#6048)
jsalant22 Apr 15, 2025
5a01894
Add test for generated nodes
bryankaylor Apr 16, 2025
55bb89d
Fix merge conflict
bryankaylor Apr 16, 2025
726e6d4
Add warning for disconnected comps (#6056)
jsalant22 Apr 21, 2025
4b68e24
F1251272 (#6063)
jsalant22 Apr 21, 2025
95189be
Add dynamic generated node test
bryankaylor Apr 21, 2025
39fd586
Fix conflict
bryankaylor Apr 21, 2025
98d0248
Fix merge conflicts for files deleted in main
bryankaylor Apr 22, 2025
5fba8f8
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 22, 2025
4c74e09
chore: adding changelog file 6068.added.md [dependabot-skip]
pyansys-ci-bot Apr 22, 2025
16d567f
Re-delete readded files
bryankaylor Apr 22, 2025
05e89d9
Merge branch 'F932911' of ssh://ssh.github.com:443/ansys/pyaedt into …
bryankaylor Apr 22, 2025
69224b2
Remove unused TestClass member
bryankaylor Apr 22, 2025
d3aa753
Fix duplicate method in EmitNode, change dynamic test to run all methods
bryankaylor Apr 22, 2025
c0da9c1
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 22, 2025
80138a3
Support loading Kept results, return ReadOnly nodes for Kept results,…
bryankaylor Apr 23, 2025
1a57448
Merge branch 'F932911' of ssh://ssh.github.com:443/ansys/pyaedt into …
bryankaylor Apr 23, 2025
a9f347d
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
f173855
Merge branch 'main' into F932911
jsalant22 Apr 23, 2025
393bb29
style changes
jsalant22 Apr 23, 2025
fdf0c3f
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
df07da7
more style fixes
jsalant22 Apr 23, 2025
e3faed0
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
ca0c268
add enum imports
jsalant22 Apr 23, 2025
b7e4e8f
Merge branch 'F932911' of https://github.com/ansys/pyaedt into F932911
jsalant22 Apr 23, 2025
420ed94
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
b21517c
use pyaedt decorator
jsalant22 Apr 23, 2025
2ee9f3f
Merge branch 'F932911' of https://github.com/ansys/pyaedt into F932911
jsalant22 Apr 23, 2025
f86bdd1
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
b28c667
style fixes
jsalant22 Apr 23, 2025
5d43d9a
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
3a1485e
fix method names
jsalant22 Apr 23, 2025
b4d064c
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
a552d44
revert min version check
jsalant22 Apr 23, 2025
7e0158b
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
358dbc8
move decorator out of class
jsalant22 Apr 23, 2025
b967b2f
remove unused import
jsalant22 Apr 23, 2025
fa4f58b
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
6d1ed2d
fix some units code
jsalant22 Apr 24, 2025
7dd7750
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 24, 2025
a829dc8
skip lint
jsalant22 Apr 24, 2025
d146173
replace id with node_id
jsalant22 Apr 24, 2025
0d71e22
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 24, 2025
e37b217
change solver to use 25.2
jsalant22 Apr 24, 2025
a0f00d9
chore: adding changelog file 6068.added.md [dependabot-skip]
pyansys-ci-bot Apr 24, 2025
1f11dcc
Merge branch 'main' into F932911
jsalant22 Apr 24, 2025
a3e5e87
Support component rename in EmitNode.rename, update all generated cla…
bryankaylor Apr 24, 2025
cfc3001
Merge branch 'F932911' of ssh://ssh.github.com:443/ansys/pyaedt into …
bryankaylor Apr 24, 2025
faf5ea8
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 24, 2025
6e98c38
Remove some unused topLevelNode access
jsalant22 May 9, 2025
bb8e556
Update revision.py
jsalant22 May 9, 2025
ab349b3
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] May 9, 2025
9759502
Fix EMIT tests for 252
bryankaylor May 9, 2025
6582562
Merge branch 'F932911' of ssh://ssh.github.com:443/ansys/pyaedt into …
bryankaylor May 12, 2025
6c766ff
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] May 12, 2025
901d7f0
Reuse current result, remove irrelevant block from revision generatio…
bryankaylor May 15, 2025
a494595
Fix 25R1 tests
bryankaylor May 15, 2025
087da75
Re-add get/set units to EMIT object
bryankaylor May 15, 2025
0e7bec6
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] May 15, 2025
ca9dae1
Fix version check in Enum initialization
bryankaylor May 19, 2025
0c0a481
Merge branch 'main' into F932911
SMoraisAnsys May 21, 2025
c2d6b33
CHORE: Add nosec B105 where needed
SMoraisAnsys May 21, 2025
e8b675c
address PR comments
jsalant22 May 21, 2025
75dbed9
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] May 21, 2025
ca17091
remove lint comments
jsalant22 May 21, 2025
42b3098
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] May 21, 2025
2f03278
Use absolute imports, use common AEDT major version guard decorator, …
bryankaylor May 21, 2025
17c3fe2
Remove test file
bryankaylor May 21, 2025
72efa75
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] May 21, 2025
dcb38aa
Update src/ansys/aedt/core/emit_core/emit_constants.py
bryankaylor May 21, 2025
a30cbbb
Fix all docstrings in generated EMIT classes
bryankaylor May 30, 2025
ec05d69
Fix power unit in radio_component test
bryankaylor May 30, 2025
a6c2c72
add EmitterNode
jsalant22 Jun 3, 2025
2d7d858
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Jun 3, 2025
6c44b6b
chore: adding changelog file 6225.added.md [dependabot-skip]
pyansys-ci-bot Jun 3, 2025
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
1 change: 1 addition & 0 deletions doc/changelog.d/6068.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support new EmitCom API for 25R2, add node classes for all EMIT node types
1 change: 1 addition & 0 deletions doc/changelog.d/6225.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add EmitterNode
6 changes: 0 additions & 6 deletions src/ansys/aedt/core/emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,6 @@ def __init__(

self.__emit_api_enabled = True

# set the default units here to make sure the EmitApi level
# stays synced with pyaedt
unit_types = ["Power", "Frequency", "Length", "Time", "Voltage", "Data Rate", "Resistance"]
unit_values = ["dBm", "MHz", "meter", "ns", "mV", "bps", "Ohm"]
self.set_units(unit_types, unit_values)

def _init_from_design(self, *args, **kwargs):
self.__init__(*args, **kwargs)

Expand Down
91 changes: 61 additions & 30 deletions src/ansys/aedt/core/emit_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,37 +55,68 @@ def emit_api_python():


def _init_enums(aedt_version):
ResultType.EMI = emit_api_python().result_type().emi
ResultType.DESENSE = emit_api_python().result_type().desense
ResultType.SENSITIVITY = emit_api_python().result_type().sensitivity
ResultType.POWER_AT_RX = emit_api_python().result_type().powerAtRx

TxRxMode.TX = emit_api_python().tx_rx_mode().tx
TxRxMode.RX = emit_api_python().tx_rx_mode().rx
TxRxMode.BOTH = emit_api_python().tx_rx_mode().both

InterfererType.TRANSMITTERS = emit_api_python().interferer_type().transmitters
InterfererType.EMITTERS = emit_api_python().interferer_type().emitters
InterfererType.TRANSMITTERS_AND_EMITTERS = emit_api_python().interferer_type().transmitters_and_emitters

UnitType.POWER = emit_api_python().unit_type().power
UnitType.FREQUENCY = emit_api_python().unit_type().frequency
UnitType.LENGTH = emit_api_python().unit_type().length
UnitType.TIME = emit_api_python().unit_type().time
UnitType.VOLTAGE = emit_api_python().unit_type().voltage
UnitType.DATA_RATE = emit_api_python().unit_type().dataRate
UnitType.RESISTANCE = emit_api_python().unit_type().resistance

numeric_version = int(aedt_version[-3:])
if numeric_version >= 241:
emi_cat_filter = emit_api_python().emi_category_filter()
EmiCategoryFilter.IN_CHANNEL_TX_FUNDAMENTAL = emi_cat_filter.in_channel_tx_fundamental
EmiCategoryFilter.IN_CHANNEL_TX_HARMONIC_SPURIOUS = emi_cat_filter.in_channel_tx_harmonic_spurious
EmiCategoryFilter.IN_CHANNEL_TX_INTERMOD = emi_cat_filter.in_channel_tx_intermod
EmiCategoryFilter.IN_CHANNEL_TX_BROADBAND = emi_cat_filter.in_channel_tx_broadband
EmiCategoryFilter.OUT_OF_CHANNEL_TX_FUNDAMENTAL = emi_cat_filter.out_of_channel_tx_fundamental
EmiCategoryFilter.OUT_OF_CHANNEL_TX_HARMONIC_SPURIOUS = emi_cat_filter.out_of_channel_tx_harmonic_spurious
EmiCategoryFilter.OUT_OF_CHANNEL_TX_INTERMOD = emi_cat_filter.out_of_channel_tx_intermod

if numeric_version > 251:
ResultType.EMI = emit_api_python().result_type().emi
ResultType.DESENSE = emit_api_python().result_type().desense
ResultType.SENSITIVITY = emit_api_python().result_type().sensitivity
ResultType.POWER_AT_RX = emit_api_python().result_type().powerAtRx

TxRxMode.TX = emit_api_python().tx_rx_mode().tx
TxRxMode.RX = emit_api_python().tx_rx_mode().rx
TxRxMode.BOTH = emit_api_python().tx_rx_mode().both

InterfererType.TRANSMITTERS = emit_api_python().interferer_type().transmitters
InterfererType.EMITTERS = emit_api_python().interferer_type().emitters
InterfererType.TRANSMITTERS_AND_EMITTERS = emit_api_python().interferer_type().transmitters_and_emitters

UnitType.POWER = emit_api_python().unit_type().power
UnitType.FREQUENCY = emit_api_python().unit_type().frequency
UnitType.LENGTH = emit_api_python().unit_type().length
UnitType.TIME = emit_api_python().unit_type().time
UnitType.VOLTAGE = emit_api_python().unit_type().voltage
UnitType.DATA_RATE = emit_api_python().unit_type().dataRate
UnitType.RESISTANCE = emit_api_python().unit_type().resistance

EmiCategoryFilter.IN_CHANNEL_TX_FUNDAMENTAL = 0
EmiCategoryFilter.IN_CHANNEL_TX_HARMONIC_SPURIOUS = 1
EmiCategoryFilter.IN_CHANNEL_TX_INTERMOD = 2
EmiCategoryFilter.IN_CHANNEL_TX_BROADBAND = 3
EmiCategoryFilter.OUT_OF_CHANNEL_TX_FUNDAMENTAL = 4
EmiCategoryFilter.OUT_OF_CHANNEL_TX_HARMONIC_SPURIOUS = 5
EmiCategoryFilter.OUT_OF_CHANNEL_TX_INTERMOD = 6
else:
ResultType.EMI = emit_api_python().result_type().emi
ResultType.DESENSE = emit_api_python().result_type().desense
ResultType.SENSITIVITY = emit_api_python().result_type().sensitivity
ResultType.POWER_AT_RX = emit_api_python().result_type().powerAtRx

TxRxMode.TX = emit_api_python().tx_rx_mode().tx
TxRxMode.RX = emit_api_python().tx_rx_mode().rx
TxRxMode.BOTH = emit_api_python().tx_rx_mode().both

InterfererType.TRANSMITTERS = emit_api_python().interferer_type().transmitters
InterfererType.EMITTERS = emit_api_python().interferer_type().emitters
InterfererType.TRANSMITTERS_AND_EMITTERS = emit_api_python().interferer_type().transmitters_and_emitters

UnitType.POWER = emit_api_python().unit_type().power
UnitType.FREQUENCY = emit_api_python().unit_type().frequency
UnitType.LENGTH = emit_api_python().unit_type().length
UnitType.TIME = emit_api_python().unit_type().time
UnitType.VOLTAGE = emit_api_python().unit_type().voltage
UnitType.DATA_RATE = emit_api_python().unit_type().dataRate
UnitType.RESISTANCE = emit_api_python().unit_type().resistance

if numeric_version >= 241:
emi_cat_filter = emit_api_python().emi_category_filter()
EmiCategoryFilter.IN_CHANNEL_TX_FUNDAMENTAL = emi_cat_filter.in_channel_tx_fundamental
EmiCategoryFilter.IN_CHANNEL_TX_HARMONIC_SPURIOUS = emi_cat_filter.in_channel_tx_harmonic_spurious
EmiCategoryFilter.IN_CHANNEL_TX_INTERMOD = emi_cat_filter.in_channel_tx_intermod
EmiCategoryFilter.IN_CHANNEL_TX_BROADBAND = emi_cat_filter.in_channel_tx_broadband
EmiCategoryFilter.OUT_OF_CHANNEL_TX_FUNDAMENTAL = emi_cat_filter.out_of_channel_tx_fundamental
EmiCategoryFilter.OUT_OF_CHANNEL_TX_HARMONIC_SPURIOUS = emi_cat_filter.out_of_channel_tx_harmonic_spurious
EmiCategoryFilter.OUT_OF_CHANNEL_TX_INTERMOD = emi_cat_filter.out_of_channel_tx_intermod


# need this as a function so that it can be set
Expand Down
112 changes: 110 additions & 2 deletions src/ansys/aedt/core/emit_core/emit_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,109 @@ class UnitType(MutableEnum):
EMIT_VALID_UNITS = {
"Power": ["mW", "W", "kW", "dBm", "dBW"],
"Frequency": ["Hz", "kHz", "MHz", "GHz", "THz"],
"Length": ["pm", "nm", "um", "mm", "cm", "dm", "meter", "km", "mil", "in", "ft", "yd", "mile"],
"Length": ["pm", "nm", "um", "mm", "cm", "dm", "meter", "meters", "km", "mil", "in", "ft", "yd", "mile"],
"Time": ["ps", "ns", "us", "ms", "s"],
"Voltage": ["mV", "V"],
"Voltage": ["nV", "uV", "mV", "V", "kV", "MegV"],
"Data Rate": ["bps", "kbps", "Mbps", "Gbps"],
"Resistance": ["uOhm", "mOhm", "Ohm", "kOhm", "megOhm", "GOhm"],
}
"""Valid units for each unit type."""

EMIT_INTERNAL_UNITS = {
"Power": "dBm",
"Freq": "Hz",
"Length": "meter",
"Time": "s",
"Voltage": "V",
"Data Rate": "bps",
"Resistance": "ohm",
}
"""Default units for each unit type."""

EMIT_TO_AEDT_UNITS = {
"picometers": "pm",
"nanometers": "nm",
"micrometers": "um",
"millimeters": "mm",
"centimeters": "cm",
"decimeters": "dm",
"meters": "meter",
"kilometers": "km",
"inches": "in",
"mils": "mil",
"feet": "ft",
"yards": "yd",
"miles": "mile",
"hertz": "Hz",
"kilohertz": "kHz",
"megahertz": "MHz",
"gigahertz": "GHz",
"terahertz": "THz",
"picoseconds": "ps",
"nanoseconds": "ns",
"microseconds": "us",
"milliseconds": "ms",
"seconds": "s",
"microohms": "uOhm",
"milliohms": "mOhm",
"ohms": "ohm",
"kiloohms": "kOhm",
"megaohms": "megohm",
"gigaohms": "GOhm",
"dBm": "dBm",
"dBW": "dBW",
"watts": "W",
"milliwatts": "mW",
"kilowatts": "kW",
"nanovolts": "nV",
"microvolts": "uV",
"millivolts": "mV",
"volts": "V",
"kilovolts": "kV",
"megavolts": "MegV",
"bps": "bps",
"kbps": "kbps",
"Mbps": "Mbps",
"Gbps": "Gbps",
}


def data_rate_conv(value: float, units: str, to_internal: bool = True):
"""Converts the data rate to (from) the internal units from the
specified units.

Args:
value (float): numeric value of the data rate
units (str): units to convert to (from)
to_internal (bool, optional): Converts from the specified units
to the internal units OR from the internal units to the
specified units. Defaults to True.

Returns:
value: data rate converted to/from the internal units
"""
if units not in ("bps", "kbps", "Mbps", "Gbps"):
raise ValueError(f"{units} are not valid units for data rate.")
if to_internal:
if units == "bps":
mult = 1.0
elif units == "kbps":
mult = 1e-3
elif units == "Mbps":
mult = 1e-6
elif units == "Gbps":
mult = 1e-9
else:
if units == "bps":
mult = 1.0
elif units == "kbps":
mult = 1e3
elif units == "Mbps":
mult = 1e6
elif units == "Gbps":
mult = 1e9
return value * mult


def emit_unit_type_string_to_enum(unit_string):
EMIT_UNIT_TYPE_STRING_TO_ENUM = {
Expand All @@ -98,6 +193,19 @@ def emit_unit_type_string_to_enum(unit_string):
return EMIT_UNIT_TYPE_STRING_TO_ENUM[unit_string]


def emi_cat_enum_to_string(emi_cat_enum):
EMI_CAT_ENUM_TO_STR = {
EmiCategoryFilter.IN_CHANNEL_TX_FUNDAMENTAL: "In-Channel Tx Fundamental",
EmiCategoryFilter.IN_CHANNEL_TX_HARMONIC_SPURIOUS: "In-Channel Tx Harmonic/Spurious",
EmiCategoryFilter.IN_CHANNEL_TX_INTERMOD: "In-Channel Intermod",
EmiCategoryFilter.IN_CHANNEL_TX_BROADBAND: "In-Channel Broadband",
EmiCategoryFilter.OUT_OF_CHANNEL_TX_FUNDAMENTAL: "Out-of-Channel Tx Fundamental",
EmiCategoryFilter.OUT_OF_CHANNEL_TX_HARMONIC_SPURIOUS: "Out-of-Channel Tx Harmonic/Spurious",
EmiCategoryFilter.OUT_OF_CHANNEL_TX_INTERMOD: "Out-of-Channel Intermod",
}
return EMI_CAT_ENUM_TO_STR[emi_cat_enum]


class EmiCategoryFilter(MutableEnum):
IN_CHANNEL_TX_FUNDAMENTAL = None
IN_CHANNEL_TX_HARMONIC_SPURIOUS = None
Expand Down
Loading
Loading