rnpy

package
v0.34.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package rnpy handles conversions between ROOT and NumPy arrays.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	// contains filtered or unexported fields
}

Column provides a NumPy representation of a Branch or Leaf.

func NewColumn

func NewColumn(tree rtree.Tree, rvar rtree.ReadVar) (Column, error)

NewColumn returns the column with the provided name and tree.

NewColumn returns an error if no branch or leaf could be found. NewColumn returns an error if the branch or leaf is of an unsupported type.

func NewColumns

func NewColumns(tree rtree.Tree) []Column

NewColumns returns all the ReadVars of the provided Tree as a slice of Columns.

ReadVars that can not be represented as NumPy arrays are silently discarded.

func (Column) Name

func (col Column) Name() string

Name returns the branch name this Column is bound to.

func (Column) Slice

func (col Column) Slice() (sli interface{}, err error)

Slice reads the whole data slice from the underlying ROOT Tree into memory.

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record is an in-memory Arrow Record backed by a NumPy data file.

func NewRecord

func NewRecord(npy *npy.Reader) *Record

NewRecord returns an Arrow Record from a NumPy data file reader.

func (*Record) Column

func (rec *Record) Column(i int) array.Interface

func (*Record) ColumnName

func (rec *Record) ColumnName(i int) string

func (*Record) Columns

func (rec *Record) Columns() []array.Interface

func (*Record) NewSlice

func (rec *Record) NewSlice(i, j int64) array.Record

NewSlice constructs a zero-copy slice of the record with the indicated indices i and j, corresponding to array[i:j]. The returned record must be Release()'d after use.

NewSlice panics if the slice is outside the valid range of the record array. NewSlice panics if j < i.

func (*Record) NumCols

func (rec *Record) NumCols() int64

func (*Record) NumRows

func (rec *Record) NumRows() int64

func (*Record) Release

func (rec *Record) Release()

Release decreases the reference count by 1. When the reference count goes to zero, the memory is freed. Release may be called simultaneously from multiple goroutines.

func (*Record) Retain

func (rec *Record) Retain()

Retain increases the reference count by 1. Retain may be called simultaneously from multiple goroutines.

func (*Record) Schema

func (rec *Record) Schema() *arrow.Schema

type RecordReader

type RecordReader struct {
	// contains filtered or unexported fields
}

func NewRecordReader

func NewRecordReader(recs ...array.Record) *RecordReader

func (*RecordReader) Read

func (rr *RecordReader) Read() (array.Record, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL