BooleanValue#
Bases: ansys.tools.variableinterop.variable_value.IVariableValue
Stores a value as a BooleanValue
variable type.
Overview#
Invoke the visitor pattern of this object using the passed-in visitor |
|
Convert the value to an API string. |
|
Convert a given |
|
Convert a given |
|
Convert the value to a formatted string. |
Variable type of the object. |
Mapping of acceptable normalized values for API string conversion to their |
Convert a NumPy int64 type to a Boolean value per interchange |
|
Convert an integer to a Boolean value per interchange specifications. |
|
Convert a float value to a Boolean value per interchange specifications. |
|
Convert a string to a Boolean value per interchange specifications. |
|
Convert an API string back into a |
Magic method add. |
|
Magic method and. |
|
Magic method bool. |
|
Return self==value. |
|
Magic method floordiv. |
|
Magic method gt. |
|
Magic method ge. |
|
Return hash(self). |
|
Magic method lshift. |
|
Magic method mod. |
|
Magic method mul. |
|
Return self!=value. |
|
Magic method or. |
|
Magic method pow. |
|
Magic method rshift. |
|
Return str(self). |
|
Magic method truediv. |
|
Magic method xor. |
Import detail#
from ansys.tools.variableinterop.scalar_values import BooleanValue
Property detail#
- property BooleanValue.variable_type: VariableType#
Variable type of the object.
- Returns:
VariableType
Variable type of the object.
Attribute detail#
Method detail#
- static BooleanValue.int64_to_bool(val: numpy.int64) bool #
Convert a NumPy int64 type to a Boolean value per interchange specifications.
- static BooleanValue.int_to_bool(val: int) bool #
Convert an integer to a Boolean value per interchange specifications.
- static BooleanValue.float_to_bool(val: float) bool #
Convert a float value to a Boolean value per interchange specifications.
- static BooleanValue.str_to_bool(val: str) bool #
Convert a string to a Boolean value per interchange specifications.
- BooleanValue.__add__(other)#
Magic method add.
- BooleanValue.__and__(other)#
Magic method and.
- BooleanValue.__bool__()#
Magic method bool.
- BooleanValue.__eq__(other)#
Return self==value.
- BooleanValue.__floordiv__(other)#
Magic method floordiv.
- BooleanValue.__gt__(other)#
Magic method gt.
- BooleanValue.__ge__(other)#
Magic method ge.
- BooleanValue.__hash__()#
Return hash(self).
- BooleanValue.__lshift__(other)#
Magic method lshift.
- BooleanValue.__mod__(other)#
Magic method mod.
- BooleanValue.__mul__(other)#
Magic method mul.
- BooleanValue.__ne__(other)#
Return self!=value.
- BooleanValue.__or__(other)#
Magic method or.
- BooleanValue.__pow__(other)#
Magic method pow.
- BooleanValue.__rshift__(other)#
Magic method rshift.
- BooleanValue.__str__()#
Return str(self).
- BooleanValue.__truediv__(other)#
Magic method truediv.
- BooleanValue.__xor__(other)#
Magic method xor.
- BooleanValue.accept(visitor: ansys.tools.variableinterop.ivariable_visitor.IVariableValueVisitor[ansys.tools.variableinterop.ivariable_visitor.T]) ansys.tools.variableinterop.ivariable_visitor.T #
Invoke the visitor pattern of this object using the passed-in visitor implementation.
- Parameters:
- visitor
IVariableValueVisitor
Visitor object to call.
- visitor
- Returns:
T
Results of the visitor invocation.
- BooleanValue.to_api_string(context: ansys.tools.variableinterop.isave_context.ISaveContext | None = None) str #
Convert the value to an API string.
- Returns:
str
String appropriate for use in files and APIs.
- BooleanValue.to_real_value() RealValue #
Convert a given
BooleanValue
type to aRealValue
type.True
is converted to1.0
, andFalse
is converted to0.0
.- Returns:
RealValue
RealValue
type with value representing the originalBooleanValue
type.
- static BooleanValue.from_api_string(value: str) BooleanValue #
Convert an API string back into a
BooleanValue
type.The conversion is performed according to the type interoperability specifications.
Values that are parseable as floating-point numbers are parsed in that manner and then converted to a
BooleanValue
type.Values that are non-numeric are checked to see if they match any of the following values. The comparison is case-insensitive.
For
True
:"true"
,"yes"
, or"y"
.For
False
:"false"
,"no"
, or"n"
.
Values not interpretable result in a
ValueError
.- Parameters:
- value
str
String to parse.
- value
- Returns:
BooleanValue
BooleanValue
type parsed from the API string.
- BooleanValue.to_integer_value() IntegerValue #
Convert a given
BooleanValue
type to anIntegerValue
type.True
is converted to1
, andFalse
is converted to0
.- Returns:
IntegerValue
IntegerValue
type with the value representing the originalBooleanValue
type.