elementseq¶
The elementseq module.
-
class
nutils.elementseq.
References
(ndims)¶ Bases:
nutils.types.Singleton
Abstract base class for a sequence of
Reference
objects.Parameters: ndims ( int
) – The number of dimensions of the references in this sequence.Notes
Subclasses must implement
__len__()
andget()
.-
static
from_iter
(value, ndims)¶ Create a
References
sequence from an iterator.Parameters: Returns: sequence
Return type:
-
static
uniform
(value, length)¶ Create a uniform
References
.Parameters: Returns: sequence
Return type:
-
static
empty
(ndims)¶ Create an empty
References
sequence.Parameters: ndims ( int
) –Returns: sequence Return type: References
-
__bool__
(self)¶ Return
bool(self)
.
-
__len__
(self)¶ Return
len(self)
.
-
__iter__
(self)¶ Implement
iter(self)
.
-
__getitem__
(self, index)¶ Return
self[index]
.
-
__add__
(self, other)¶ Return
self+other
.
-
__mul__
(self, other)¶ Return
self*other
.
-
get
(self, index)¶ Return the reference at
index
.Parameters: index ( int
) –Returns: reference – The reference at index
.Return type: Reference
-
take
(self, indices)¶ Return a selection of this sequence.
Parameters: indices ( numpy.ndarray
, ndim: 1, dtype: int) – The indices of references of this sequence to select.Returns: references – The sequence of selected references. Return type: References
-
compress
(self, mask)¶ Return a selection of this sequence.
Parameters: mask ( numpy.ndarray
, ndim: 1, dtype: bool) – A boolean mask of references of this sequence to select.Returns: sequence – The sequence of selected references. Return type: References
-
repeat
(self, count)¶ Return this sequence repeated
count
times.Parameters: count ( int
) –Returns: sequence – This sequence repeated count
times.Return type: References
-
product
(self, other)¶ Return the product of this sequence with another sequence.
Parameters: other ( References
) –Returns: sequence – The product sequence. Return type: References
-
chain
(self, other)¶ Return the chained sequence of this sequence with
other
.Parameters: other ( References
) –Returns: sequence – The chained sequence. Return type: References
-
children
¶ Return the sequence of child references.
Returns: The sequence of child references: (cref for ref in self for cref in ref.child_refs)
Return type: References
-
edges
¶ Return the sequence of edge references.
Returns: The sequence of edge references: (eref for ref in self for eref in ref.edge_refs)
Return type: References
-
isuniform
¶ True
if all reference in this sequence are equal.
-
static