MCPcopy Create free account
hub / github.com/cogentcore/core / New

Method New

tensor/table/splits.go:96–109  ·  view source on GitHub ↗

New adds a new split to the list for given table, and with associated values, which are copied before saving into Values list, and any number of rows from the table associated with this split (also copied). Any existing Aggs are deleted by this.

(dt *Table, values []string, rows ...int)

Source from the content-addressed store, hash-verified

94// from the table associated with this split (also copied).
95// Any existing Aggs are deleted by this.
96func (spl *Splits) New(dt *Table, values []string, rows ...int) *IndexView {
97 spl.Aggs = nil
98 ix := &IndexView{Table: dt}
99 spl.Splits = append(spl.Splits, ix)
100 if len(rows) > 0 {
101 ix.Indexes = append(ix.Indexes, slices.Clone(rows)...)
102 }
103 if len(values) > 0 {
104 spl.Values = append(spl.Values, slices.Clone(values))
105 } else {
106 spl.Values = append(spl.Values, nil)
107 }
108 return ix
109}
110
111// ByValue finds split indexes by matching to split values, returns nil if not found.
112// values are used in order as far as they go and any remaining values are assumed

Callers 4

AllFunction · 0.95
GroupByIndexFunction · 0.95
GroupByFuncFunction · 0.95
PermutedFunction · 0.95

Calls 1

CloneMethod · 0.65

Tested by

no test coverage detected