Ops
AndExpression(left, right)
¶
Bases: _BinaryLogicalOperator
Represents a logical AND operation between two selection expressions.
This expression evaluates to True for an atom if and only if both
the left and right sub-expressions evaluate to True for that atom.
| PARAMETER | DESCRIPTION |
|---|---|
|
The
TYPE:
|
|
The
TYPE:
|
evaluate(ensemble, run_id=None, micro_id=None)
¶
Evaluates the logical AND of the left and right sub-expressions.
For each microstate, this method retrieves the boolean masks from both the left and right sub-expressions and applies a NumPy logical AND operation element-wise.
| PARAMETER | DESCRIPTION |
|---|---|
|
The
TYPE:
|
|
The ID of the run within the ensemble.
TYPE:
|
|
Microstate IDs to evaluate expression for. If
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
Bool
|
A 1D boolean NumPy array for each microstate, representing the element-wise logical AND of the masks produced by the left and right sub-expressions. |
NotExpression(operand)
¶
Bases: _UnaryLogicalOperator
Represents a logical NOT operation on a selection expression.
This expression evaluates to True for an atom if its sub-expression
evaluates to False, and vice-versa.
evaluate(ensemble, run_id=None, micro_id=None)
¶
Evaluates the logical NOT of the sub-expression.
For each microstate, this method retrieves the boolean mask from its sub-expression and applies a NumPy logical NOT operation element-wise.
| PARAMETER | DESCRIPTION |
|---|---|
|
The
TYPE:
|
|
The ID of the run within the ensemble.
TYPE:
|
|
Microstate IDs to evaluate expression for. If
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
Bool
|
A 1D boolean NumPy array ( |
OrExpression(left, right)
¶
Bases: _BinaryLogicalOperator
Represents a logical OR operation between two selection expressions.
This expression evaluates to True for an atom if either the left or
the right sub-expression (or both) evaluate to True for that atom.
| PARAMETER | DESCRIPTION |
|---|---|
|
The
TYPE:
|
|
The
TYPE:
|
|
The
|
evaluate(ensemble, run_id=None, micro_id=None)
¶
Evaluates the logical OR of the left and right sub-expressions.
For each microstate, this method retrieves the boolean masks from both the left and right sub-expressions and applies a NumPy logical OR operation element-wise.
| PARAMETER | DESCRIPTION |
|---|---|
|
The
TYPE:
|
|
The ID of the run within the ensemble.
TYPE:
|
|
Microstate IDs to evaluate expression for. If
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
Bool
|
A 1D boolean NumPy array ( |
SelectionOperator
¶
Provides static methods to act as factories for SelectionExpression instances.
AND(left, right)
¶
Creates an AndExpression.
NOT(operand)
¶
Creates a NotExpression.
OR(left, right)
¶
Creates an OrExpression.