pymead.core.param.AngleParam#
- class AngleParam(value: float, name: str, lower: float | None = None, upper: float | None = None, sub_container: str = 'params', setting_from_geo_col: bool = False, point=None, root=None, rotation_handle=None, enabled: bool = True, equation_str: str | None = None, geo_col=None)[source]#
Bases:
ParamAngle-type parameter in
pymead. Adds unit functionality and transforms values into the range \([0, 2\pi)\).Note
Instances of this class should never be created directly. Instead, parameters can be created by creating a
GeometryCollectionand calling itsadd_parammethod withunit_type="angle".- __init__(value: float, name: str, lower: float | None = None, upper: float | None = None, sub_container: str = 'params', setting_from_geo_col: bool = False, point=None, root=None, rotation_handle=None, enabled: bool = True, equation_str: str | None = None, geo_col=None)[source]#
Methods
Gets a dictionary representation of the pymead object.
rad()Returns the value of the angle parameter in radians, the base angle unit of pymead
set_unit([unit, old_unit])set_value(value[, bounds_normalized, force, ...])Sets the design variable value, adjusting the value to fit inside the bounds if necessary.
unit()The value of this parameter's angle unit.
Attributes
- get_dict_rep()[source]#
Gets a dictionary representation of the pymead object. In general, this dictionary should consist of only the required arguments for object instantiation. For example, the dictionary representation of a point looks something like this:
{"x": 0.3, "y": 0.5}. If the argument requires a reference to aPymeadObjrather than a string or float value, thename()method should be the value that is stored. For an example, see the overridden value of this method inpymead.core.airfoil.Airfoil. All subclasses ofPymeadObjmust implement this method, since it is the way pymead objects are stored in saved instances of aGeometryCollection(.jmeafiles).
- rad() float[source]#
Returns the value of the angle parameter in radians, the base angle unit of pymead
- Returns:
Angle in radians
- Return type:
- set_value(value: float, bounds_normalized: bool = False, force: bool = False, param_graph_update: bool = False, from_request_move: bool = False)[source]#
Sets the design variable value, adjusting the value to fit inside the bounds if necessary.
- Parameters:
bounds_normalized (bool) – Whether the specified value is normalized by the bounds (e.g., 0 if the value is equal to the lower bound, 1 if the value is equal to the upper bound, or a float between 0.0 and 1.0 if the value is somewhere between the bounds). Default:
Falseforce (bool) – Whether to force the change in value. This keyword argument should never be set to
Truewhen using the API. Default:Falseparam_graph_update (bool) – Whether this value is being set as part of a parameter graph update. Used to prevent the parameter graph from triggering multiple updates for the same parameter. This keyword argument should never be set to
Truewhen using the API. Default:Falsefrom_request_move (bool) – Whether this method was called from
Point.request_move. Default:False