Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6357817
make sure all EMIT UI props are accessible in pyaedt
jsalant22 Oct 30, 2025
947c05f
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Oct 30, 2025
7a0496c
chore: adding changelog file 6835.fixed.md [dependabot-skip]
pyansys-ci-bot Oct 30, 2025
317f64a
remove duplicate functions
jsalant22 Oct 30, 2025
c73f853
Merge branch 'B1345240_emit' of https://github.com/ansys/pyaedt into …
jsalant22 Oct 30, 2025
05a7bd4
fix test due to 25.2 aedt bug
jsalant22 Oct 30, 2025
16bcab9
Update tests/system/emit/test_emit.py
jsalant22 Oct 31, 2025
94df8e0
Merge branch 'main' into B1345240_emit
jsalant22 Oct 31, 2025
6fab7a7
add some test coverage
jsalant22 Oct 31, 2025
83b5e62
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Oct 31, 2025
97cfa31
Update revision.py
jsalant22 Oct 31, 2025
08cdad3
Update revision.py
jsalant22 Oct 31, 2025
2c52827
add coverage test
jsalant22 Oct 31, 2025
b6ecc8f
remove comment
jsalant22 Oct 31, 2025
b22ae0d
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Oct 31, 2025
1333550
Merge branch 'main' into B1345240_emit
jsalant22 Oct 31, 2025
1979ca4
fix test
jsalant22 Nov 3, 2025
a8b2a94
Merge branch 'B1345240_emit' of https://github.com/ansys/pyaedt into …
jsalant22 Nov 3, 2025
c7c520a
add some error checking
jsalant22 Nov 3, 2025
dc55bc9
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 3, 2025
815335a
fix some enums
jsalant22 Nov 3, 2025
b53f2a5
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 3, 2025
a29ecc7
Merge branch 'main' into B1345240_emit
jsalant22 Nov 3, 2025
c43f8e0
Merge branch 'main' into B1345240_emit
jsalant22 Nov 4, 2025
f3c06fa
add coverage
jsalant22 Nov 6, 2025
4cb8f70
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 6, 2025
44c706d
fix codacy and force unique names for renaming
jsalant22 Nov 6, 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/6835.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Emit properties cleanup
3 changes: 2 additions & 1 deletion ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ aline
COM
gRPC
Toolkits
Extensions
Extensions
Synopsys
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/emit_core/emit_schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def create_radio_antenna(
new_antenna = self.create_component("Antenna", antenna_name, "Antennas")
if new_radio and new_antenna:
self.connect_components(new_antenna.name, new_radio.name) # Connect antenna to radio
return new_radio, new_antenna
return new_radio, new_antenna
raise RuntimeError(f"Failed to create radio of type '{radio_type}' or antenna.")
except Exception as e:
self.emit_instance.logger.error(f"Failed to create radio of type '{radio_type}' or antenna: {e}")
raise RuntimeError(f"Failed to create radio of type '{radio_type}' or antenna: {e}")
Expand Down
42 changes: 31 additions & 11 deletions src/ansys/aedt/core/emit_core/nodes/emit_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,28 @@ def name(self) -> str:
"""
return self._get_property("Name", True)

@name.setter
def name(self, requested_name: str):
"""Renames the node/component.

Parameters
----------
requested_name : str
New name for the node/component.

Raises
------
ValueError
If the node is read-only or cannot be renamed.
"""
if self._result_id > 0:
raise ValueError("This node is read-only for kept results.")

if self.get_is_component():
self._emit_obj.oeditor.RenameComponent(self.name, requested_name)
else:
_ = self._oRevisionData.RenameEmitNode(self._result_id, self._node_id, requested_name)

@property
def _node_type(self) -> str:
"""Type of the node.
Expand Down Expand Up @@ -276,9 +298,9 @@ def _get_property(self, prop, skipChecks=False, isTable=False) -> Union[str, Lis
except Exception:
raise self._emit_obj.logger.aedt_messages.error_level[-1]

def _set_property(self, prop, value):
def _set_property(self, prop, value, skipChecks=False):
try:
self._oRevisionData.SetEmitNodeProperties(self._result_id, self._node_id, [f"{prop}={value}"], True)
self._oRevisionData.SetEmitNodeProperties(self._result_id, self._node_id, [f"{prop}={value}"], skipChecks)
except Exception:
error_text = None
if len(self._emit_obj.logger.messages.error_level) > 0:
Expand Down Expand Up @@ -408,6 +430,9 @@ def _delete(self):
def _rename(self, requested_name: str) -> str:
"""Renames the node/component.

.. deprecated: 0.21.3
Use name property instead

Parameters
----------
requested_name : str
Expand All @@ -423,15 +448,10 @@ def _rename(self, requested_name: str) -> str:
ValueError
If the node is read-only and cannot be renamed.
"""
if self.get_is_component():
if self._result_id > 0:
raise ValueError("This node is read-only for kept results.")
self._emit_obj.oeditor.RenameComponent(self.name, requested_name)
new_name = requested_name
else:
new_name = self._oRevisionData.RenameEmitNode(self._result_id, self._node_id, requested_name)
warnings.warn("This property is deprecated in 0.21.3. Use the name property instead.", DeprecationWarning)
self.name = requested_name

return new_name
return self.name

def _duplicate(self, new_name):
raise NotImplementedError("This method is not implemented yet.")
Expand Down Expand Up @@ -563,7 +583,7 @@ def _set_table_data(self, table):
# with ';' separating rows and '|' separating columns
table_key = self._get_property("TableKey", True)
data = ";".join("|".join(map(str, row)) for row in table)
self._set_property(table_key, data)
self._set_property(table_key, data, True)
except Exception as e:
print(f"Failed to set table data for node {self.name}. Error: {e}")

Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/emit_core/nodes/emitter_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class EmitterNode(EmitNode):
"""

def __init__(self, emit_obj, result_id, node_id):
self._is_component = True
EmitNode.__init__(self, emit_obj, result_id, node_id)
self._is_component = True
self._radio_node = RadioNode(emit_obj, result_id, node_id)

# create_component code provides the radio_id, but we also
Expand Down
16 changes: 1 addition & 15 deletions src/ansys/aedt/core/emit_core/nodes/generated/amplifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


from ansys.aedt.core.emit_core.nodes.emit_node import EmitNode


class Amplifier(EmitNode):
def __init__(self, emit_obj, result_id, node_id):
self._is_component = True
EmitNode.__init__(self, emit_obj, result_id, node_id)
self._is_component = True

@property
def node_type(self) -> str:
Expand Down Expand Up @@ -64,19 +63,6 @@ def table_data(self):
def table_data(self, value):
self._set_table_data(value)

@property
def filename(self) -> str:
"""Name of file defining the outboard component.

Value should be a full file path.
"""
val = self._get_property("Filename")
return val

@filename.setter
def filename(self, value: str):
self._set_property("Filename", f"{value}")

@property
def noise_temperature(self) -> float:
"""System Noise temperature (K) of the component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

class AntennaNode(EmitNode):
def __init__(self, emit_obj, result_id, node_id):
self._is_component = False
EmitNode.__init__(self, emit_obj, result_id, node_id)
self._is_component = True

@property
def parent(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

class AntennaPassband(EmitNode):
def __init__(self, emit_obj, result_id, node_id):
self._is_component = False
EmitNode.__init__(self, emit_obj, result_id, node_id)
self._is_component = False

@property
def parent(self):
Expand Down
22 changes: 21 additions & 1 deletion src/ansys/aedt/core/emit_core/nodes/generated/band.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

class Band(EmitNode):
def __init__(self, emit_obj, result_id, node_id):
self._is_component = False
EmitNode.__init__(self, emit_obj, result_id, node_id)
self._is_component = False

@property
def parent(self):
Expand All @@ -43,6 +43,26 @@ def node_type(self) -> str:
"""The type of this emit node."""
return self._node_type

def duplicate(self, new_name: str):
"""Duplicate this node"""
return self._duplicate(new_name)

def delete(self):
"""Delete this node"""
self._delete()

def rename(self, new_name: str):
"""Rename this node"""
self._rename(new_name)

def import_rx_measurement(self, file_name):
"""Import a Measurement from a File..."""
return self._import(file_name, "RxMeasurement")

def import_tx_measurement(self, file_name):
"""Import a Measurement from a File..."""
return self._import(file_name, "TxMeasurement")

@property
def enabled(self) -> bool:
"""Enabled state for this node."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

class BandFolder(EmitNode):
def __init__(self, emit_obj, result_id, node_id):
self._is_component = False
EmitNode.__init__(self, emit_obj, result_id, node_id)
self._is_component = False

@property
def parent(self):
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/emit_core/nodes/generated/cable.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

class Cable(EmitNode):
def __init__(self, emit_obj, result_id, node_id):
self._is_component = True
EmitNode.__init__(self, emit_obj, result_id, node_id)
self._is_component = True

@property
def node_type(self) -> str:
Expand Down
Loading
Loading