Documentation ¶
Index ¶
- Constants
- func NewBuffer(initialSize int) *buffer
- func NewBufferFrom(underlying []byte) *buffer
- func ReadMetadata(r io.Reader) (string, string, error)
- func WriteFixedSummary(w io.Writer, d Summary) error
- func WriteMetadata(w io.Writer, key string, val string) error
- func WriteSummary(w io.Writer, s Summary) error
- type AppendDataset
- func (d *AppendDataset) Finalize() error
- func (d *AppendDataset) GetRawSample(dimIndices []uint) ([]byte, error)
- func (d *AppendDataset) GetSample(dimIndices []uint) ([]any, error)
- func (d *AppendDataset) GetSampleField(dimIndices []uint, fieldId uint) (any, error)
- func (d *AppendDataset) SetSample(dimIndices []uint, sample []any) error
- func (d *AppendDataset) SetSampleField(dimIndices []uint, fieldId uint, fieldVal any) error
- type AppendTile
- type CacheDataset
- func (d *CacheDataset) Finalize() error
- func (d *CacheDataset) GetSample(dimIndices []uint) ([]any, error)
- func (d *CacheDataset) GetSampleField(dimIndices []uint, fieldId uint) (any, error)
- func (d *CacheDataset) SetSample(dimIndices []uint, sample []any) error
- func (d *CacheDataset) SetSampleField(dimIndices []uint, fieldId uint, fieldVal any) error
- type CacheTile
- type Compression
- type Dimension
- type Dimension64Iterator
- type DimensionU32Iterator
- type DimensionsError
- type Field
- type FieldType
- type FormatError
- type InMemoryDataset
- func (d *InMemoryDataset) GetSample(dimIndices []uint) ([]any, error)
- func (d *InMemoryDataset) GetSampleField(dimIndices []uint, fieldId uint) (any, error)
- func (d *InMemoryDataset) SetSample(dimIndices []uint, sample []any) error
- func (d *InMemoryDataset) SetSampleField(dimIndices []uint, fieldId uint, fieldVal any) error
- type RangeError
- type Summary
- func (d *Summary) DataSize() int64
- func (d *Summary) DiskDataStart() int64
- func (d *Summary) DiskHeaderSize() int64
- func (d *Summary) DiskMetadataSize() int64
- func (d *Summary) DiskTileOffset(tileIndex int) int64
- func (d *Summary) SampleSize() int64
- func (d *Summary) Samples() int64
- func (d *Summary) TileSamples() int64
- func (d *Summary) TileSize(tileIndex int) int64
- func (d *Summary) Tiles() int
- type UnsupportedError
Constants ¶
const ( PixiFileType string = "pixi" // Every file starts with these four bytes. PixiVersion int64 = 1 // Every file has a version number as the second set of four bytes. )
Variables ¶
This section is empty.
Functions ¶
func NewBufferFrom ¶ added in v0.0.9
func NewBufferFrom(underlying []byte) *buffer
Types ¶
type AppendDataset ¶
type AppendDataset struct { Summary WritingTileIndex uint WritingTile AppendTile ReadCache map[uint]*AppendTile MaxInCache uint Backing io.ReadWriteSeeker }
func NewAppendDataset ¶
func NewAppendDataset(d Summary, backing io.ReadWriteSeeker, maxInCache uint) (*AppendDataset, error)
Creates a new append dataset. It initializes the internal data structures and sets up the backing store.
func ReadAppend ¶
func ReadAppend(r io.ReadWriteSeeker, ds Summary, maxInCache uint) (AppendDataset, error)
func (*AppendDataset) Finalize ¶ added in v0.0.3
func (d *AppendDataset) Finalize() error
func (*AppendDataset) GetRawSample ¶ added in v0.0.11
func (d *AppendDataset) GetRawSample(dimIndices []uint) ([]byte, error)
func (*AppendDataset) GetSample ¶
func (d *AppendDataset) GetSample(dimIndices []uint) ([]any, error)
func (*AppendDataset) GetSampleField ¶
func (d *AppendDataset) GetSampleField(dimIndices []uint, fieldId uint) (any, error)
func (*AppendDataset) SetSample ¶
func (d *AppendDataset) SetSample(dimIndices []uint, sample []any) error
func (*AppendDataset) SetSampleField ¶
func (d *AppendDataset) SetSampleField(dimIndices []uint, fieldId uint, fieldVal any) error
type AppendTile ¶
type CacheDataset ¶
type CacheDataset struct { Summary TileCache map[uint]*CacheTile MaxInCache uint Backing io.ReadWriteSeeker }
func NewCacheDataset ¶
func NewCacheDataset(d Summary, backing io.ReadWriteSeeker, maxInCache uint) (*CacheDataset, error)
func ReadCached ¶
func ReadCached(r io.ReadWriteSeeker, ds Summary, maxInCache uint) (*CacheDataset, error)
func (*CacheDataset) Finalize ¶ added in v0.0.9
func (d *CacheDataset) Finalize() error
func (*CacheDataset) GetSampleField ¶
func (d *CacheDataset) GetSampleField(dimIndices []uint, fieldId uint) (any, error)
func (*CacheDataset) SetSample ¶
func (d *CacheDataset) SetSample(dimIndices []uint, sample []any) error
func (*CacheDataset) SetSampleField ¶
func (d *CacheDataset) SetSampleField(dimIndices []uint, fieldId uint, fieldVal any) error
type Compression ¶
type Compression uint32
const ( CompressionNone Compression = 0 CompressionFlate Compression = 1 )
type Dimension ¶
type Dimension64Iterator ¶
func NewDimensionsIterator ¶
func NewDimensionsIterator(dims []Dimension) *Dimension64Iterator
func (*Dimension64Iterator) HasNext ¶
func (i *Dimension64Iterator) HasNext() bool
func (*Dimension64Iterator) Next ¶
func (i *Dimension64Iterator) Next()
type DimensionU32Iterator ¶
func NewTileIndexIterator ¶
func NewTileIndexIterator(dims []Dimension) *DimensionU32Iterator
func (*DimensionU32Iterator) HasNext ¶
func (i *DimensionU32Iterator) HasNext() bool
func (*DimensionU32Iterator) Next ¶
func (i *DimensionU32Iterator) Next()
type DimensionsError ¶
func (DimensionsError) Error ¶
func (d DimensionsError) Error() string
type FieldType ¶
type FieldType uint32
func (FieldType) Read ¶
This function reads the value of a given FieldType from the provided raw byte slice. The read operation is type-dependent, with each field type having its own specific method for reading values. This ensures that the correct data is read and converted into the expected format.
type FormatError ¶
type FormatError string
func (FormatError) Error ¶
func (e FormatError) Error() string
type InMemoryDataset ¶
func NewInMemoryDataset ¶
func NewInMemoryDataset(d Summary) (*InMemoryDataset, error)
func ReadInMemory ¶
func ReadInMemory(r io.ReadSeeker, ds Summary) (InMemoryDataset, error)
func (*InMemoryDataset) GetSample ¶
func (d *InMemoryDataset) GetSample(dimIndices []uint) ([]any, error)
func (*InMemoryDataset) GetSampleField ¶
func (d *InMemoryDataset) GetSampleField(dimIndices []uint, fieldId uint) (any, error)
func (*InMemoryDataset) SetSample ¶
func (d *InMemoryDataset) SetSample(dimIndices []uint, sample []any) error
func (*InMemoryDataset) SetSampleField ¶
func (d *InMemoryDataset) SetSampleField(dimIndices []uint, fieldId uint, fieldVal any) error
type RangeError ¶
func (RangeError) Error ¶
func (e RangeError) Error() string
type Summary ¶
type Summary struct { Metadata map[string]string // Indicates whether the fields of the dataset are stored separated or contiguously. If true, // values for each field are stored next to each other. If false, the default, values for each // index are stored next to each other, with values for different fields stored next to each // other at the same index. Separated bool Compression Compression // The type of compression used on this dataset (e.g., Flate, lz4). // An array of Dimension structs representing the dimensions and tiling of this dataset. // No dimensions equals an empty dataset. Dimensions []Dimension Fields []Field // An array of Field structs representing the fields in this dataset. TileBytes []int64 // An array of int64 values representing (compressed) size of each tile in bytes for this dataset. }
Information about how data is stored and organized for a particular data set inside a pixi file.
func ReadSummary ¶
func ReadSummary(r io.ReadSeeker) (Summary, error)
func (*Summary) DataSize ¶ added in v0.0.8
The on-disk size in bytes of the (potentially compressed) data set. Does not include the dataset header size.
func (*Summary) DiskDataStart ¶ added in v0.0.8
func (*Summary) DiskHeaderSize ¶ added in v0.0.8
func (*Summary) DiskMetadataSize ¶ added in v0.0.8
func (*Summary) DiskTileOffset ¶ added in v0.0.10
The offset from the start of the on-disk (potentially compressed) file in which the tile is stored. Relative to the start of the file, not the data set Offset.
func (*Summary) SampleSize ¶ added in v0.0.8
The size in bytes of each sample in the data set. Each field has a fixed size, and a sample is made up of one element of each field, so the sample size is the sum of all field sizes.
func (*Summary) Samples ¶ added in v0.0.8
The total number of samples in the data set. If the tile size of any dimension is not a multiple of the dimension size, the 'padding' samples are not included in the count.
func (*Summary) TileSamples ¶ added in v0.0.8
The number of samples per tile in the data set. Each tile has the same number of samples, regardless of if the data is stored separated or continguous.
func (*Summary) TileSize ¶ added in v0.0.8
The size of a single tile in bytes. For contiguous files, the size of each tile is always the same. However, for separated data sets, each field is tiled (so the number of on-disk tiles is actually fieldCount * Tiles()). Hence, the tile size changes depending on which field is being accessed.
type UnsupportedError ¶
type UnsupportedError string
func (UnsupportedError) Error ¶
func (e UnsupportedError) Error() string