Skip to content

Commit

Permalink
FEAT: clear_linked_data method to Icepak (#4903)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto-DM authored Jul 10, 2024
1 parent 1b8fffb commit 58f3be0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
7 changes: 5 additions & 2 deletions _unittest/test_98_Icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def test_05_EMLoss(self):
"uUSB", "Setup1", "LastAdaptive", "2.5GHz", surface_list, HFSSpath, param_list, object_list
)

def test_06_clear_linked_data(self):
assert self.aedtapp.clear_linked_data()

def test_07_ExportStepForWB(self):
file_path = self.local_scratch.path
file_name = "WBStepModel"
Expand All @@ -321,8 +324,8 @@ def test_08_Setup(self):
assert self.aedtapp.assign_2way_coupling(setup_name, 2, True, 20)
templates = SetupKeys().get_default_icepak_template(default_type="Natural Convection")
assert templates
self.aedtapp.setups[0].props = templates["IcepakSteadyState"]
assert self.aedtapp.setups[0].update()
my_setup.props = templates["IcepakSteadyState"]
assert my_setup.update()
assert SetupKeys().get_default_icepak_template(default_type="Default")
assert SetupKeys().get_default_icepak_template(default_type="Forced Convection")
with pytest.raises(AttributeError):
Expand Down
3 changes: 1 addition & 2 deletions pyaedt/application/Design.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,7 @@ def odesign(self):
Returns
-------
type
Design object.
Design object
References
----------
Expand Down
22 changes: 22 additions & 0 deletions pyaedt/icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -6464,6 +6464,28 @@ def create_square_wave_transient_assignment(self, on_value, initial_time_off, on
"""
return SquareWaveDictionary(on_value, initial_time_off, on_time, off_time, off_value)

@pyaedt_function_handler()
def clear_linked_data(self):
"""
Clear the linked data of all the solution setups.
Returns
-------
bool
``True`` when successful, ``False`` when failed.
References
----------
>>> oDesign.ClearLinkedData
"""
try:
self.odesign.ClearLinkedData()
except:
return False
else:
return True


class IcepakDesignSettingsManipulation(DesignSettingsManipulation):
def __init__(self, app):
Expand Down

0 comments on commit 58f3be0

Please sign in to comment.