pointsseq

Sequences of Points.

class nutils.pointsseq.PointsSequence(ndims)

Bases: nutils.types.Singleton

Abstract base class for a sequence of Points.

Parameters:ndims (int) – The dimension of the point coordinates.
ndims

The dimension of the point coordinates.

Type:int

Notes

Subclasses must implement __len__() and get().

static from_iter(value, ndims)

Create a PointsSequence from an iterator.

Parameters:
  • value (iterable of Points objects) –
  • ndims (int) –
Returns:

sequence

Return type:

PointsSequence

static uniform(value, length)

Create a uniform PointsSequence.

Parameters:
Returns:

sequence

Return type:

PointsSequence

static empty(ndims)

Create an empty PointsSequence.

Parameters:ndims (int) –
Returns:sequence
Return type:PointsSequence
__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 points at index.

Parameters:index (int) –
Returns:points – The points at index.
Return type:Points
take(self, indices)

Return a selection of this sequence.

Parameters:indices (numpy.ndarray, ndim: 1, dtype: int) – The indices of points of this sequence to select.
Returns:points – The sequence of selected points.
Return type:PointsSequence
compress(self, mask)

Return a selection of this sequence.

Parameters:mask (numpy.ndarray, ndim: 1, dtype: bool) – A boolean mask of points of this sequence to select.
Returns:sequence – The sequence of selected points.
Return type:PointsSequence
repeat(self, count)

Return this sequence repeated count times.

Parameters:count (int) –
Returns:sequence – This sequence repeated count times.
Return type:PointsSequence
product(self, other)

Return the product of this sequence with another sequence.

Parameters:other (PointsSequence) –
Returns:sequence – This product sequence.
Return type:PointsSequence
chain(self, other)

Return the chained sequence of this sequence with other.

Parameters:other (PointsSequence) –
Returns:sequence – The chained sequence.
Return type:PointsSequence