Skip to content

Commit

Permalink
add app attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzovecchietti committed May 2, 2024
2 parents 101436f + 1813ab0 commit 0a00666
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
7 changes: 3 additions & 4 deletions pyaedt/application/Design.py
Original file line number Diff line number Diff line change
Expand Up @@ -4060,7 +4060,8 @@ def __repr__(self):

def __setitem__(self, key, value):
if key in self.available_properties:
value = self.manipulate_inputs.execute(key, value)
if self.manipulate_inputs is not None:
value = self.manipulate_inputs.execute(key, value)
key_choices = "{}/Choices".format(key)
if key_choices in self.design_settings.GetPropNames():
value_choices = self.design_settings.GetPropValue(key_choices)
Expand All @@ -4081,9 +4082,7 @@ def __getitem__(self, key):
return None

def __contains__(self, item):
if item in self.available_properties:
return True
return False
return item in self.available_properties


class DesignSettingsManipulation(ABC):
Expand Down
25 changes: 13 additions & 12 deletions pyaedt/icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,8 @@ def edit_design_settings(
The default is ``0``.
ambient_temperature : float, str, BoundaryDict or dict optional
Ambient temperature. The default is ``20``.
The default unit is celsius for float or string including unit definition is accepted, e.g. ``325kel``.
The default unit is Celsius for a float or string value.
You can include a unit for a string value. For example, ``325kel``.
perform_validation : bool, optional
Whether to perform validation. The default is ``False``.
check_level : str, optional
Expand All @@ -1655,16 +1656,16 @@ def edit_design_settings(
Default surface material. The default is ``"Steel-oxidised-surface"``.
export_monitor : bool, optional
Whether to export monitor data.
The default value is ``False``.
The default is ``False``.
export_sherlock : bool, optional
Whether to export temperature data for Sherlock.
The default value is ``False``.
The default is ``False``.
export_directory : str, optional
Default export directory for monitor point and sherlock data.
The default value is the current working directory.
Default export directory for monitor point and Sherlock data.
The default is the current working directory.
gauge_pressure : float, str, optional
Set the Gauge pressure. It can be a float (units will be "n_per_meter_sq") or a string with units.
Default is ``0``.
Gauge pressure. It can be a float where "n_per_meter_sq" is
assumed as the units or a string with the units specified. The default is ``0``.
radiation_temperature : float, str, optional
Set the radiation temperature. It can be a float (units will be "cel") or a string with units.
Default is ``20``.
Expand All @@ -1685,7 +1686,7 @@ def edit_design_settings(
>>> oDesign.SetDesignSettings
"""
#
# Configure design settings for gravity etc
# Configure design settings such as gravity
ice_gravity = ["X", "Y", "Z"]
gv_pos = False
if int(gravity_dir) > 2:
Expand Down Expand Up @@ -3085,7 +3086,7 @@ def apply_icepak_settings(
"""Apply Icepak default design settings.
.. deprecated:: 0.8.9
Use ``edit_design_settins`` method.
Use the ``edit_design_settins()`` method.
Parameters
----------
Expand Down Expand Up @@ -3115,7 +3116,7 @@ def apply_icepak_settings(
>>> oDesign.SetDesignSettings
"""

warnings.warn("Use ``edit_design_settins`` method.", DeprecationWarning)
warnings.warn("Use the ``edit_design_settings()`` method.", DeprecationWarning)
return self.edit_design_settings(
ambient_temperature=ambienttemp,
gravity_dir=gravityDir,
Expand Down Expand Up @@ -3871,7 +3872,7 @@ def assign_stationary_wall_with_htc(
radiate_surf_mat="Steel-oxidised-surface",
shell_conduction=False,
):
"""Assign a surface wall boundary condition with specified heat transfer coefficient.
"""Assign a surface wall boundary condition with a given heat transfer coefficient.
Parameters
----------
Expand Down Expand Up @@ -6437,7 +6438,7 @@ def execute(self, k, v):
if k == "AmbTemp" and isinstance(v, (dict, BoundaryDictionary)):
self.app.logger.error("Failed. Use `edit_design_settings` function.")
return self.app.design_settings["AmbTemp"]
# Bug in native API. Uncomment when fixed
# FIXME: Bug in native API. Uncomment when fixed
# if not self.solution_type == "Transient":
# self.logger.error("Transient assignment is supported only in transient designs.")
# return False
Expand Down

0 comments on commit 0a00666

Please sign in to comment.