ProjectionRowIterable

class lsst.daf.relation.iteration.ProjectionRowIterable(target: RowIterable, columns: Set[ColumnTag])

Bases: RowIterable

A RowIterable implementation that implements a projection operation.

Parameters:
targetRowIterable

Original iterable to take a column subset from.

columnsSet

Columns to include in the new iterable.

Methods Summary

materialized()

Convert this iterable to one that holds its rows in a Python collection of some kind, instead of generating them lazily.

sliced(start, stop)

Apply a slice operation to this RowIterable.

to_mapping(unique_key)

Convert this iterable to a RowMapping, unless it already is one.

to_sequence()

Convert this iterable to a RowSequence, unless it already is one.

Methods Documentation

materialized() MaterializedRowIterable

Convert this iterable to one that holds its rows in a Python collection of some kind, instead of generating them lazily.

Returns:
rowsMaterializedRowIterable

A RowIterable that isn’t lazy.

sliced(start: int, stop: int | None) RowIterable

Apply a slice operation to this RowIterable.

Parameters:
startint

Start index.

stopint or None

Stop index (one-past-the-end), or None to include up through the last row.

Returns:
rowsRowIterable

Iterable representing the slice. May or may not be lazy.

to_mapping(unique_key: Sequence[ColumnTag]) RowMapping

Convert this iterable to a RowMapping, unless it already is one.

Parameters:
unique_keySequence [ ColumnTag ]

Sequence of columns to extract into a tuple to use as keys in the mapping, guaranteeing uniqueness over these columns.

Returns:
rowsRowMapping

A RowIterable backed by a mapping.

to_sequence() RowSequence

Convert this iterable to a RowSequence, unless it already is one.

Returns:
rowsRowSequence

A RowIterable backed by a sequence.