package rnpy
import "go-hep.org/x/hep/groot/rnpy"
Package rnpy handles conversions between ROOT and NumPy arrays.
Index ¶
- type Column
- func NewColumn(tree rtree.Tree, rvar rtree.ReadVar) (Column, error)
- func NewColumns(tree rtree.Tree) []Column
- func (col Column) Name() string
- func (col Column) Slice() (sli interface{}, err error)
- type Record
- func NewRecord(npy *npy.Reader) *Record
- func (rec *Record) Column(i int) array.Interface
- func (rec *Record) ColumnName(i int) string
- func (rec *Record) Columns() []array.Interface
- func (rec *Record) NewSlice(i, j int64) array.Record
- func (rec *Record) NumCols() int64
- func (rec *Record) NumRows() int64
- func (rec *Record) Release()
- func (rec *Record) Retain()
- func (rec *Record) Schema() *arrow.Schema
- type RecordReader
Types ¶
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column provides a NumPy representation of a Branch or Leaf.
func NewColumn ¶
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 ¶
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 ¶
Name returns the branch name this Column is bound to.
func (Column) Slice ¶
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 ¶
NewRecord returns an Arrow Record from a NumPy data file reader.
func (*Record) Column ¶
func (*Record) ColumnName ¶
func (*Record) Columns ¶
func (*Record) NewSlice ¶
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 (*Record) NumRows ¶
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)
Source Files ¶
arrow.go column.go rnpy.go
- Version
- v0.36.0 (latest)
- Published
- Nov 15, 2024
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 1 day ago –
Tools for package owners.