Repository: cogentcore/core
Pull request #1193 (2024-08-30 05:33:44)

fix simatgrid sizing for labels and replace Col -> Column for all pca…
… / svd / simat methods that still used Col




Patch:
diff --git a/core/layout.go b/core/layout.go
index ec7bf9e34..7fb5348c5 100644
--- a/core/layout.go
+++ b/core/layout.go
@@ -227,8 +227,8 @@ func (ls *geomSize) setInitContentMin(styMin math32.Vector2) {
 	styles.SetClampMaxVector(csz, ls.Max)
 }
 
-// fitSizeMax increases given size to fit given fm value, subject to Max constraints
-func (ls *geomSize) fitSizeMax(to *math32.Vector2, fm math32.Vector2) {
+// FitSizeMax increases given size to fit given fm value, subject to Max constraints
+func (ls *geomSize) FitSizeMax(to *math32.Vector2, fm math32.Vector2) {
 	styles.SetClampMinVector(to, fm)
 	styles.SetClampMaxVector(to, ls.Max)
 }
@@ -735,8 +735,8 @@ func (wb *WidgetBase) updateParentRelSizes() bool {
 		}
 	}
 	if got {
-		sz.fitSizeMax(&sz.Actual.Total, sz.Min)
-		sz.fitSizeMax(&sz.Alloc.Total, sz.Min)
+		sz.FitSizeMax(&sz.Actual.Total, sz.Min)
+		sz.FitSizeMax(&sz.Alloc.Total, sz.Min)
 		sz.setContentFromTotal(&sz.Actual)
 		sz.setContentFromTotal(&sz.Alloc)
 	}
@@ -750,7 +750,7 @@ func (wb *WidgetBase) sizeUpParts() {
 	}
 	wb.Parts.SizeUp()
 	sz := &wb.Geom.Size
-	sz.fitSizeMax(&sz.Actual.Content, wb.Parts.Geom.Size.Actual.Total)
+	sz.FitSizeMax(&sz.Actual.Content, wb.Parts.Geom.Size.Actual.Total)
 }
 
 func (fr *Frame) SizeUp() {
@@ -1532,7 +1532,7 @@ func (wb *WidgetBase) sizeFinalParts() {
 	}
 	wb.Parts.SizeFinal()
 	sz := &wb.Geom.Size
-	sz.fitSizeMax(&sz.Actual.Content, wb.Parts.Geom.Size.Actual.Total)
+	sz.FitSizeMax(&sz.Actual.Content, wb.Parts.Geom.Size.Actual.Total)
 }
 
 func (fr *Frame) SizeFinal() {
diff --git a/core/text.go b/core/text.go
index 06ca33755..2fb386e07 100644
--- a/core/text.go
+++ b/core/text.go
@@ -328,7 +328,7 @@ func (tx *Text) SizeUp() {
 		tx.configTextSize(sz.Actual.Content)
 	}
 	rsz := tx.paintText.BBox.Size().Ceil()
-	sz.fitSizeMax(&sz.Actual.Content, rsz)
+	sz.FitSizeMax(&sz.Actual.Content, rsz)
 	sz.setTotalFromContent(&sz.Actual)
 	if DebugSettings.LayoutTrace {
 		fmt.Println(tx, "Text SizeUp:", rsz, "Actual:", sz.Actual.Content)
@@ -344,7 +344,7 @@ func (tx *Text) SizeDown(iter int) bool {
 	prevContent := sz.Actual.Content
 	// start over so we don't reflect hysteresis of prior guess
 	sz.setInitContentMin(tx.Styles.Min.Dots().Ceil())
-	sz.fitSizeMax(&sz.Actual.Content, rsz)
+	sz.FitSizeMax(&sz.Actual.Content, rsz)
 	sz.setTotalFromContent(&sz.Actual)
 	chg := prevContent != sz.Actual.Content
 	if chg {
diff --git a/core/textfield.go b/core/textfield.go
index 82c25b91d..3bc4ae54d 100644
--- a/core/textfield.go
+++ b/core/textfield.go
@@ -1859,7 +1859,7 @@ func (tf *TextField) SizeUp() {
 		rsz = tf.configTextSize(availSz)
 	}
 	rsz.SetAdd(icsz)
-	sz.fitSizeMax(&sz.Actual.Content, rsz)
+	sz.FitSizeMax(&sz.Actual.Content, rsz)
 	sz.setTotalFromContent(&sz.Actual)
 	tf.fontHeight = tf.Styles.Font.Face.Metrics.Height
 	tf.editText = tmptxt
@@ -1881,7 +1881,7 @@ func (tf *TextField) SizeDown(iter int) bool {
 	rsz.SetAdd(icsz)
 	// start over so we don't reflect hysteresis of prior guess
 	sz.setInitContentMin(tf.Styles.Min.Dots().Ceil())
-	sz.fitSizeMax(&sz.Actual.Content, rsz)
+	sz.FitSizeMax(&sz.Actual.Content, rsz)
 	sz.setTotalFromContent(&sz.Actual)
 	chg := prevContent != sz.Actual.Content
 	if chg {
diff --git a/tensor/projection2d.go b/tensor/projection2d.go
index b1693c012..592cecc4e 100644
--- a/tensor/projection2d.go
+++ b/tensor/projection2d.go
@@ -19,7 +19,6 @@ const (
 // For any odd number of dimensions, the remaining outer-most dimension
 // can either be multipliexed across the row or column, given the oddRow arg.
 // Even multiples of inner-most dimensions are assumed to be row, then column.
-// RowMajor and ColMajor layouts are handled appropriately.
 // rowEx returns the number of "extra" (higher dimensional) rows
 // and colEx returns the number of extra cols
 func Projection2DShape(shp *Shape, oddRow bool) (rows, cols, rowEx, colEx int) {
@@ -59,7 +58,6 @@ func Projection2DShape(shp *Shape, oddRow bool) (rows, cols, rowEx, colEx int) {
 // For any odd number of dimensions, the remaining outer-most dimension
 // can either be multipliexed across the row or column, given the oddRow arg.
 // Even multiples of inner-most dimensions are assumed to be row, then column.
-// RowMajor and ColMajor layouts are handled appropriately.
 func Projection2DIndex(shp *Shape, oddRow bool, row, col int) int {
 	nd := shp.NumDims()
 	switch nd {
@@ -146,7 +144,6 @@ func Projection2DCoords(shp *Shape, oddRow bool, row, col int) (rowCoords, colCo
 // For any odd number of dimensions, the remaining outer-most dimension
 // can either be multipliexed across the row or column, given the oddRow arg.
 // Even multiples of inner-most dimensions are assumed to be row, then column.
-// RowMajor and ColMajor layouts are handled appropriately.
 func Projection2DValue(tsr Tensor, oddRow bool, row, col int) float64 {
 	idx := Projection2DIndex(tsr.Shape(), oddRow, row, col)
 	return tsr.Float1D(idx)
@@ -157,7 +154,6 @@ func Projection2DValue(tsr Tensor, oddRow bool, row, col int) float64 {
 // For any odd number of dimensions, the remaining outer-most dimension
 // can either be multipliexed across the row or column, given the oddRow arg.
 // Even multiples of inner-most dimensions are assumed to be row, then column.
-// RowMajor and ColMajor layouts are handled appropriately.
 func Projection2DString(tsr Tensor, oddRow bool, row, col int) string {
 	idx := Projection2DIndex(tsr.Shape(), oddRow, row, col)
 	return tsr.String1D(idx)
@@ -168,7 +164,6 @@ func Projection2DString(tsr Tensor, oddRow bool, row, col int) string {
 // For any odd number of dimensions, the remaining outer-most dimension
 // can either be multipliexed across the row or column, given the oddRow arg.
 // Even multiples of inner-most dimensions are assumed to be row, then column.
-// RowMajor and ColMajor layouts are handled appropriately.
 func Projection2DSet(tsr Tensor, oddRow bool, row, col int, val float64) {
 	idx := Projection2DIndex(tsr.Shape(), oddRow, row, col)
 	tsr.SetFloat1D(idx, val)
@@ -179,7 +174,6 @@ func Projection2DSet(tsr Tensor, oddRow bool, row, col int, val float64) {
 // For any odd number of dimensions, the remaining outer-most dimension
 // can either be multipliexed across the row or column, given the oddRow arg.
 // Even multiples of inner-most dimensions are assumed to be row, then column.
-// RowMajor and ColMajor layouts are handled appropriately.
 func Projection2DSetString(tsr Tensor, oddRow bool, row, col int, val string) {
 	idx := Projection2DIndex(tsr.Shape(), oddRow, row, col)
 	tsr.SetString1D(idx, val)
diff --git a/tensor/stats/pca/covar.go b/tensor/stats/pca/covar.go
index 3bb32b8b0..5aa1e9f0d 100644
--- a/tensor/stats/pca/covar.go
+++ b/tensor/stats/pca/covar.go
@@ -12,7 +12,7 @@ import (
 	"cogentcore.org/core/tensor/table"
 )
 
-// CovarTableCol generates a covariance matrix from given column name
+// CovarTableColumn generates a covariance matrix from given column name
 // in given IndexView of an table.Table, and given metric function
 // (typically Covariance or Correlation -- use Covar if vars have similar
 // overall scaling, which is typical in neural network models, and use
@@ -22,7 +22,7 @@ import (
 // cell co-varies in its value with each other cell across the rows of the table.
 // This is the input to the PCA eigenvalue decomposition of the resulting
 // covariance matrix.
-func CovarTableCol(cmat tensor.Tensor, ix *table.IndexView, column string, mfun metric.Func64) error {
+func CovarTableColumn(cmat tensor.Tensor, ix *table.IndexView, column string, mfun metric.Func64) error {
 	col, err := ix.Table.ColumnByName(column)
 	if err != nil {
 		return err
@@ -30,7 +30,7 @@ func CovarTableCol(cmat tensor.Tensor, ix *table.IndexView, column string, mfun
 	rows := ix.Len()
 	nd := col.NumDims()
 	if nd < 2 || rows == 0 {
-		return fmt.Errorf("pca.CovarTableCol: must have 2 or more dims and rows != 0")
+		return fmt.Errorf("pca.CovarTableColumn: must have 2 or more dims and rows != 0")
 	}
 	ln := col.Len()
 	sz := ln / col.DimSize(0) // size of cell
@@ -43,10 +43,10 @@ func CovarTableCol(cmat tensor.Tensor, ix *table.IndexView, column string, mfun
 	sdim := []int{0, 0}
 	for ai := 0; ai < sz; ai++ {
 		sdim[0] = ai
-		TableColRowsVec(av, ix, col, ai)
+		TableColumnRowsVec(av, ix, col, ai)
 		for bi := 0; bi <= ai; bi++ { // lower diag
 			sdim[1] = bi
-			TableColRowsVec(bv, ix, col, bi)
+			TableColumnRowsVec(bv, ix, col, bi)
 			cv := mfun(av, bv)
 			cmat.SetFloat(sdim, cv)
 		}
@@ -137,9 +137,9 @@ func CovarTensor(cmat tensor.Tensor, tsr tensor.Tensor, mfun metric.Func64) erro
 	return nil
 }
 
-// TableColRowsVec extracts row-wise vector from given cell index into vec.
+// TableColumnRowsVec extracts row-wise vector from given cell index into vec.
 // vec must be of size ix.Len() -- number of rows
-func TableColRowsVec(vec []float64, ix *table.IndexView, col tensor.Tensor, cidx int) {
+func TableColumnRowsVec(vec []float64, ix *table.IndexView, col tensor.Tensor, cidx int) {
 	rows := ix.Len()
 	ln := col.Len()
 	sz := ln / col.DimSize(0) // size of cell
@@ -161,7 +161,7 @@ func TensorRowsVec(vec []float64, tsr tensor.Tensor, cidx int) {
 	}
 }
 
-// CovarTableColStd generates a covariance matrix from given column name
+// CovarTableColumnStd generates a covariance matrix from given column name
 // in given IndexView of an table.Table, and given metric function
 // (typically Covariance or Correlation -- use Covar if vars have similar
 // overall scaling, which is typical in neural network models, and use
@@ -172,8 +172,8 @@ func TensorRowsVec(vec []float64, tsr tensor.Tensor, cidx int) {
 // This is the input to the PCA eigenvalue decomposition of the resulting
 // covariance matrix.
 // This Std version is usable e.g., in Python where the func cannot be passed.
-func CovarTableColStd(cmat tensor.Tensor, ix *table.IndexView, column string, met metric.StdMetrics) error {
-	return CovarTableCol(cmat, ix, column, metric.StdFunc64(met))
+func CovarTableColumnStd(cmat tensor.Tensor, ix *table.IndexView, column string, met metric.StdMetrics) error {
+	return CovarTableColumn(cmat, ix, column, metric.StdFunc64(met))
 }
 
 // CovarTensorStd generates a covariance matrix from given tensor.Tensor,
diff --git a/tensor/stats/pca/pca.go b/tensor/stats/pca/pca.go
index 42270ce83..b69b57e1a 100644
--- a/tensor/stats/pca/pca.go
+++ b/tensor/stats/pca/pca.go
@@ -35,7 +35,7 @@ func (pa *PCA) Init() {
 	pa.Values = nil
 }
 
-// TableCol is a convenience method that computes a covariance matrix
+// TableColumn is a convenience method that computes a covariance matrix
 // on given column of table and then performs the PCA on the resulting matrix.
 // If no error occurs, the results can be read out from Vectors and Values
 // or used in Projection methods.
@@ -48,11 +48,11 @@ func (pa *PCA) Init() {
 // This is the input to the PCA eigenvalue decomposition of the resulting
 // covariance matrix, which extracts the eigenvectors as directions with maximal
 // variance in this matrix.
-func (pa *PCA) TableCol(ix *table.IndexView, column string, mfun metric.Func64) error {
+func (pa *PCA) TableColumn(ix *table.IndexView, column string, mfun metric.Func64) error {
 	if pa.Covar == nil {
 		pa.Init()
 	}
-	err := CovarTableCol(pa.Covar, ix, column, mfun)
+	err := CovarTableColumn(pa.Covar, ix, column, mfun)
 	if err != nil {
 		return err
 	}
@@ -83,7 +83,7 @@ func (pa *PCA) Tensor(tsr tensor.Tensor, mfun metric.Func64) error {
 	return pa.PCA()
 }
 
-// TableColStd is a convenience method that computes a covariance matrix
+// TableColumnStd is a convenience method that computes a covariance matrix
 // on given column of table and then performs the PCA on the resulting matrix.
 // If no error occurs, the results can be read out from Vectors and Values
 // or used in Projection methods.
@@ -97,8 +97,8 @@ func (pa *PCA) Tensor(tsr tensor.Tensor, mfun metric.Func64) error {
 // covariance matrix, which extracts the eigenvectors as directions with maximal
 // variance in this matrix.
 // This Std version is usable e.g., in Python where the func cannot be passed.
-func (pa *PCA) TableColStd(ix *table.IndexView, column string, met metric.StdMetrics) error {
-	return pa.TableCol(ix, column, metric.StdFunc64(met))
+func (pa *PCA) TableColumnStd(ix *table.IndexView, column string, met metric.StdMetrics) error {
+	return pa.TableColumn(ix, column, metric.StdFunc64(met))
 }
 
 // TensorStd is a convenience method that computes a covariance matrix
@@ -145,20 +145,20 @@ func (pa *PCA) PCA() error {
 	return nil
 }
 
-// ProjectCol projects values from the given column of given table (via IndexView)
+// ProjectColumn projects values from the given column of given table (via IndexView)
 // onto the idx'th eigenvector (0 = largest eigenvalue, 1 = next, etc).
 // Must have already called PCA() method.
-func (pa *PCA) ProjectCol(vals *[]float64, ix *table.IndexView, column string, idx int) error {
+func (pa *PCA) ProjectColumn(vals *[]float64, ix *table.IndexView, column string, idx int) error {
 	col, err := ix.Table.ColumnByName(column)
 	if err != nil {
 		return err
 	}
 	if pa.Vectors == nil {
-		return fmt.Errorf("PCA.ProjectCol Vectors are nil -- must call PCA first")
+		return fmt.Errorf("PCA.ProjectColumn Vectors are nil -- must call PCA first")
 	}
 	nr := pa.Vectors.DimSize(0)
 	if idx >= nr {
-		return fmt.Errorf("PCA.ProjectCol eigenvector index > rank of matrix")
+		return fmt.Errorf("PCA.ProjectColumn eigenvector index > rank of matrix")
 	}
 	cvec := make([]float64, nr)
 	eidx := nr - 1 - idx // eigens in reverse order
@@ -173,7 +173,7 @@ func (pa *PCA) ProjectCol(vals *[]float64, ix *table.IndexView, column string, i
 	ln := col.Len()
 	sz := ln / col.DimSize(0) // size of cell
 	if sz != nr {
-		return fmt.Errorf("PCA.ProjectCol column cell size != pca eigenvectors")
+		return fmt.Errorf("PCA.ProjectColumn column cell size != pca eigenvectors")
 	}
 	rdim := []int{0}
 	for row := 0; row < rows; row++ {
@@ -188,17 +188,17 @@ func (pa *PCA) ProjectCol(vals *[]float64, ix *table.IndexView, column string, i
 	return nil
 }
 
-// ProjectColToTable projects values from the given column of given table (via IndexView)
+// ProjectColumnToTable projects values from the given column of given table (via IndexView)
 // onto the given set of eigenvectors (idxs, 0 = largest eigenvalue, 1 = next, etc),
 // and stores results along with labels from column labNm into results table.
 // Must have already called PCA() method.
-func (pa *PCA) ProjectColToTable(projections *table.Table, ix *table.IndexView, column, labNm string, idxs []int) error {
+func (pa *PCA) ProjectColumnToTable(projections *table.Table, ix *table.IndexView, column, labNm string, idxs []int) error {
 	_, err := ix.Table.ColumnByName(column)
 	if err != nil {
 		return err
 	}
 	if pa.Vectors == nil {
-		return fmt.Errorf("PCA.ProjectCol Vectors are nil -- must call PCA first")
+		return fmt.Errorf("PCA.ProjectColumn Vectors are nil -- must call PCA first")
 	}
 	rows := ix.Len()
 	projections.DeleteAll()
@@ -214,7 +214,7 @@ func (pa *PCA) ProjectColToTable(projections *table.Table, ix *table.IndexView,
 
 	for ii, idx := range idxs {
 		pcol := projections.Columns[pcolSt+ii].(*tensor.Float64)
-		pa.ProjectCol(&pcol.Values, ix, column, idx)
+		pa.ProjectColumn(&pcol.Values, ix, column, idx)
 	}
 
 	if labNm != "" {
diff --git a/tensor/stats/pca/svd.go b/tensor/stats/pca/svd.go
index 9decc6fbd..d94ab6004 100644
--- a/tensor/stats/pca/svd.go
+++ b/tensor/stats/pca/svd.go
@@ -7,6 +7,7 @@ package pca
 import (
 	"fmt"
 
+	"cogentcore.org/core/base/errors"
 	"cogentcore.org/core/tensor"
 	"cogentcore.org/core/tensor/stats/metric"
 	"cogentcore.org/core/tensor/table"
@@ -44,7 +45,7 @@ func (svd *SVD) Init() {
 	svd.Values = nil
 }
 
-// TableCol is a convenience method that computes a covariance matrix
+// TableColumn is a convenience method that computes a covariance matrix
 // on given column of table and then performs the SVD on the resulting matrix.
 // If no error occurs, the results can be read out from Vectors and Values
 // or used in Projection methods.
@@ -57,11 +58,11 @@ func (svd *SVD) Init() {
 // This is the input to the SVD eigenvalue decomposition of the resulting
 // covariance matrix, which extracts the eigenvectors as directions with maximal
 // variance in this matrix.
-func (svd *SVD) TableCol(ix *table.IndexView, column string, mfun metric.Func64) error {
+func (svd *SVD) TableColumn(ix *table.IndexView, column string, mfun metric.Func64) error {
 	if svd.Covar == nil {
 		svd.Init()
 	}
-	err := CovarTableCol(svd.Covar, ix, column, mfun)
+	err := CovarTableColumn(svd.Covar, ix, column, mfun)
 	if err != nil {
 		return err
 	}
@@ -92,7 +93,7 @@ func (svd *SVD) Tensor(tsr tensor.Tensor, mfun metric.Func64) error {
 	return svd.SVD()
 }
 
-// TableColStd is a convenience method that computes a covariance matrix
+// TableColumnStd is a convenience method that computes a covariance matrix
 // on given column of table and then performs the SVD on the resulting matrix.
 // If no error occurs, the results can be read out from Vectors and Values
 // or used in Projection methods.
@@ -106,8 +107,8 @@ func (svd *SVD) Tensor(tsr tensor.Tensor, mfun metric.Func64) error {
 // covariance matrix, which extracts the eigenvectors as directions with maximal
 // variance in this matrix.
 // This Std version is usable e.g., in Python where the func cannot be passed.
-func (svd *SVD) TableColStd(ix *table.IndexView, column string, met metric.StdMetrics) error {
-	return svd.TableCol(ix, column, metric.StdFunc64(met))
+func (svd *SVD) TableColumnStd(ix *table.IndexView, column string, met metric.StdMetrics) error {
+	return svd.TableColumn(ix, column, metric.StdFunc64(met))
 }
 
 // TensorStd is a convenience method that computes a covariance matrix
@@ -157,20 +158,20 @@ func (svd *SVD) SVD() error {
 	return nil
 }
 
-// ProjectCol projects values from the given column of given table (via IndexView)
+// ProjectColumn projects values from the given column of given table (via IndexView)
 // onto the idx'th eigenvector (0 = largest eigenvalue, 1 = next, etc).
 // Must have already called SVD() method.
-func (svd *SVD) ProjectCol(vals *[]float64, ix *table.IndexView, column string, idx int) error {
+func (svd *SVD) ProjectColumn(vals *[]float64, ix *table.IndexView, column string, idx int) error {
 	col, err := ix.Table.ColumnByName(column)
 	if err != nil {
 		return err
 	}
-	if svd.Vectors == nil {
-		return fmt.Errorf("SVD.ProjectCol Vectors are nil -- must call SVD first")
+	if svd.Vectors == nil || svd.Vectors.Len() == 0 {
+		return fmt.Errorf("SVD.ProjectColumn Vectors are nil: must call SVD first, with Kind = mat.SVDFull so that the vectors are returned")
 	}
 	nr := svd.Vectors.DimSize(0)
 	if idx >= nr {
-		return fmt.Errorf("SVD.ProjectCol eigenvector index > rank of matrix")
+		return fmt.Errorf("SVD.ProjectColumn eigenvector index > rank of matrix")
 	}
 	cvec := make([]float64, nr)
 	// eidx := nr - 1 - idx // eigens in reverse order
@@ -185,7 +186,7 @@ func (svd *SVD) ProjectCol(vals *[]float64, ix *table.IndexView, column string,
 	ln := col.Len()
 	sz := ln / col.DimSize(0) // size of cell
 	if sz != nr {
-		return fmt.Errorf("SVD.ProjectCol column cell size != svd eigenvectors")
+		return fmt.Errorf("SVD.ProjectColumn column cell size != svd eigenvectors")
 	}
 	rdim := []int{0}
 	for row := 0; row < rows; row++ {
@@ -200,17 +201,17 @@ func (svd *SVD) ProjectCol(vals *[]float64, ix *table.IndexView, column string,
 	return nil
 }
 
-// ProjectColToTable projects values from the given column of given table (via IndexView)
+// ProjectColumnToTable projects values from the given column of given table (via IndexView)
 // onto the given set of eigenvectors (idxs, 0 = largest eigenvalue, 1 = next, etc),
 // and stores results along with labels from column labNm into results table.
 // Must have already called SVD() method.
-func (svd *SVD) ProjectColToTable(projections *table.Table, ix *table.IndexView, column, labNm string, idxs []int) error {
+func (svd *SVD) ProjectColumnToTable(projections *table.Table, ix *table.IndexView, column, labNm string, idxs []int) error {
 	_, err := ix.Table.ColumnByName(column)
-	if err != nil {
+	if errors.Log(err) != nil {
 		return err
 	}
 	if svd.Vectors == nil {
-		return fmt.Errorf("SVD.ProjectCol Vectors are nil -- must call SVD first")
+		return fmt.Errorf("SVD.ProjectColumn Vectors are nil -- must call SVD first")
 	}
 	rows := ix.Len()
 	projections.DeleteAll()
@@ -226,12 +227,12 @@ func (svd *SVD) ProjectColToTable(projections *table.Table, ix *table.IndexView,
 
 	for ii, idx := range idxs {
 		pcol := projections.Columns[pcolSt+ii].(*tensor.Float64)
-		svd.ProjectCol(&pcol.Values, ix, column, idx)
+		svd.ProjectColumn(&pcol.Values, ix, column, idx)
 	}
 
 	if labNm != "" {
 		lcol, err := ix.Table.ColumnByName(labNm)
-		if err == nil {
+		if errors.Log(err) == nil {
 			plcol := projections.Columns[0]
 			for row := 0; row < rows; row++ {
 				plcol.SetString1D(row, lcol.String1D(row))
diff --git a/tensor/stats/simat/simat.go b/tensor/stats/simat/simat.go
index 3361630be..49f4f06b0 100644
--- a/tensor/stats/simat/simat.go
+++ b/tensor/stats/simat/simat.go
@@ -39,20 +39,20 @@ func (smat *SimMat) Init() {
 	smat.Columns = nil
 }
 
-// TableColStd generates a similarity / distance matrix from given column name
+// TableColumnStd generates a similarity / distance matrix from given column name
 // in given IndexView of an table.Table, and given standard metric function.
 // if labNm is not empty, uses given column name for labels, which if blankRepeat
 // is true are filtered so that any sequentially repeated labels are blank.
 // This Std version is usable e.g., in Python where the func cannot be passed.
-func (smat *SimMat) TableColStd(ix *table.IndexView, column, labNm string, blankRepeat bool, met metric.StdMetrics) error {
-	return smat.TableCol(ix, column, labNm, blankRepeat, metric.StdFunc64(met))
+func (smat *SimMat) TableColumnStd(ix *table.IndexView, column, labNm string, blankRepeat bool, met metric.StdMetrics) error {
+	return smat.TableColumn(ix, column, labNm, blankRepeat, metric.StdFunc64(met))
 }
 
-// TableCol generates a similarity / distance matrix from given column name
+// TableColumn generates a similarity / distance matrix from given column name
 // in given IndexView of an table.Table, and given metric function.
 // if labNm is not empty, uses given column name for labels, which if blankRepeat
 // is true are filtered so that any sequentially repeated labels are blank.
-func (smat *SimMat) TableCol(ix *table.IndexView, column, labNm string, blankRepeat bool, mfun metric.Func64) error {
+func (smat *SimMat) TableColumn(ix *table.IndexView, column, labNm string, blankRepeat bool, mfun metric.Func64) error {
 	col, err := ix.Table.ColumnByName(column)
 	if err != nil {
 		return err
diff --git a/tensor/stats/split/agg.go b/tensor/stats/split/agg.go
index cbf4c2e23..cea87595b 100644
--- a/tensor/stats/split/agg.go
+++ b/tensor/stats/split/agg.go
@@ -38,9 +38,9 @@ func AggColumn(spl *table.Splits, column string, stat stats.Stats) (*table.Split
 	return AggIndex(spl, colIndex, stat), nil
 }
 
-// AggAllNumericCols performs aggregation using given standard aggregation function across
+// AggAllNumericColumns performs aggregation using given standard aggregation function across
 // all splits, for all number-valued columns in the table.
-func AggAllNumericCols(spl *table.Splits, stat stats.Stats) {
+func AggAllNumericColumns(spl *table.Splits, stat stats.Stats) {
 	dt := spl.Table()
 	for ci, cl := range dt.Columns {
 		if cl.IsString() {
diff --git a/tensor/table/README.md b/tensor/table/README.md
index d4c006a8e..e7ed404e7 100644
--- a/tensor/table/README.md
+++ b/tensor/table/README.md
@@ -47,41 +47,41 @@ The following packages are included:
 Scalar columns:
 
 ```Go
-val := et.CellFloat("ColName", row)
+val := et.Float("ColName", row)
 ```
 
 ```Go
-str := et.CellString("ColName", row)
+str := et.StringValue("ColName", row)
 ```
 
 Tensor (higher-dimensional) columns:
 
 ```Go
-tsr := et.CellTensor("ColName", row) // entire tensor at cell (a row-level SubSpace of column tensor)
+tsr := et.Tensor("ColName", row) // entire tensor at cell (a row-level SubSpace of column tensor)
 ```
 
 ```Go
-val := et.CellTensorFloat1D("ColName", row, cellidx) // idx is 1D index into cell tensor
+val := et.TensorFloat1D("ColName", row, cellidx) // idx is 1D index into cell tensor
 ```
 
 ## Set Table Value
 
 ```Go
-et.SetCellFloat("ColName", row, val)
+et.SetFloat("ColName", row, val)
 ```
 
 ```Go
-et.SetCellString("ColName", row, str)
+et.SetString("ColName", row, str)
 ```
 
 Tensor (higher-dimensional) columns:
 
 ```Go
-et.SetCellTensor("ColName", row, tsr) // set entire tensor at cell 
+et.SetTensor("ColName", row, tsr) // set entire tensor at cell 
 ```
 
 ```Go
-et.SetCellTensorFloat1D("ColName", row, cellidx, val) // idx is 1D index into cell tensor
+et.SetTensorFloat1D("ColName", row, cellidx, val) // idx is 1D index into cell tensor
 ```
 
 ## Find Value(s) in Column
@@ -105,14 +105,14 @@ ix := etable.NewIndexView(et) // new view with all rows
 ### Sort
 
 ```Go
-ix.SortColName("Name", etable.Ascending) // etable.Ascending or etable.Descending
+ix.SortColumnName("Name", etable.Ascending) // etable.Ascending or etable.Descending
 SortedTable := ix.NewTable() // turn an IndexView back into a new Table organized in order of indexes
 ```
 
 or:
 
 ```Go
-nmcl := et.ColByName("Name") // nmcl is an etensor of the Name column, cached
+nmcl := et.ColumnByName("Name") // nmcl is an etensor of the Name column, cached
 ix.Sort(func(t *Table, i, j int) bool {
 	return nmcl.StringValue1D(i) < nmcl.StringValue1D(j)
 })
@@ -121,7 +121,7 @@ ix.Sort(func(t *Table, i, j int) bool {
 ### Filter
 
 ```Go
-nmcl := et.ColByName("Name") // column we're filtering on
+nmcl := et.ColumnByName("Name") // column we're filtering on
 ix.Filter(func(t *Table, row int) bool {
 	// filter return value is for what to *keep* (=true), not exclude
 	// here we keep any row with a name that contains the string "in"
@@ -145,7 +145,7 @@ Describe (basic stats) all columns in a table:
 ix := etable.NewIndexView(et) // new view with all rows
 desc := agg.DescAll(ix) // summary stats of all columns
 // get value at given column name (from original table), row "Mean"
-mean := desc.CellFloat("ColNm", desc.RowsByString("Agg", "Mean", etable.Equals, etable.UseCase)[0])
+mean := desc.Float("ColNm", desc.RowsByString("Agg", "Mean", etable.Equals, etable.UseCase)[0])
 ```
 
 # CSV / TSV file format
diff --git a/tensor/tensorcore/simatgrid.go b/tensor/tensorcore/simatgrid.go
index e6f0c0ebd..a134c3199 100644
--- a/tensor/tensorcore/simatgrid.go
+++ b/tensor/tensorcore/simatgrid.go
@@ -93,7 +93,7 @@ func (tg *SimMatGrid) SizeLabel(lbs []string, col bool) (minBlank, ngps int, sz
 	return minBlank, ngps, tr.BBox.Size()
 }
 
-func (tg *SimMatGrid) MinSize() math32.Vector2 {
+func (tg *SimMatGrid) SizeUp() {
 	tg.rowMinBlank, tg.rowNGps, tg.rowMaxSz = tg.SizeLabel(tg.SimMat.Rows, false)
 	tg.colMinBlank, tg.colNGps, tg.colMaxSz = tg.SizeLabel(tg.SimMat.Columns, true)
 
@@ -113,7 +113,9 @@ func (tg *SimMatGrid) MinSize() math32.Vector2 {
 	gsz = math32.Max(gsz, tg.Display.GridMinSize)
 	gsz = math32.Max(gsz, txtsz)
 	gsz = math32.Min(gsz, tg.Display.GridMaxSize)
-	return math32.Vec2(tg.rowMaxSz.X+LabelSpace+gsz*float32(cols), tg.colMaxSz.Y+LabelSpace+gsz*float32(rows))
+	minsz := math32.Vec2(tg.rowMaxSz.X+LabelSpace+gsz*float32(cols), tg.colMaxSz.Y+LabelSpace+gsz*float32(rows))
+	sz := &tg.Geom.Size
+	sz.FitSizeMax(&sz.Actual.Content, minsz)
 }
 
 func (tg *SimMatGrid) Render() {


Test patch:
diff --git a/tensor/stats/clust/clust_test.go b/tensor/stats/clust/clust_test.go
index 39f921505..858dc0dd6 100644
--- a/tensor/stats/clust/clust_test.go
+++ b/tensor/stats/clust/clust_test.go
@@ -35,7 +35,7 @@ func TestClust(t *testing.T) {
 	}
 	ix := table.NewIndexView(dt)
 	smat := &simat.SimMat{}
-	smat.TableCol(ix, "Input", "Name", false, metric.Euclidean64)
+	smat.TableColumn(ix, "Input", "Name", false, metric.Euclidean64)
 
 	// fmt.Printf("%v\n", smat.Mat)
 	// cl := Glom(smat, MinDist)
diff --git a/tensor/stats/pca/pca_test.go b/tensor/stats/pca/pca_test.go
index a9c576504..fb62388c8 100644
--- a/tensor/stats/pca/pca_test.go
+++ b/tensor/stats/pca/pca_test.go
@@ -26,9 +26,9 @@ func TestPCAIris(t *testing.T) {
 	}
 	ix := table.NewIndexView(dt)
 	pc := &PCA{}
-	// pc.TableCol(ix, "data", metric.Covariance64)
+	// pc.TableColumn(ix, "data", metric.Covariance64)
 	// fmt.Printf("covar: %v\n", pc.Covar)
-	err = pc.TableCol(ix, "data", metric.Correlation64)
+	err = pc.TableColumn(ix, "data", metric.Correlation64)
 	if err != nil {
 		t.Error(err)
 	}
@@ -47,7 +47,7 @@ func TestPCAIris(t *testing.T) {
 	}
 
 	prjt := &table.Table{}
-	err = pc.ProjectColToTable(prjt, ix, "data", "class", []int{0, 1})
+	err = pc.ProjectColumnToTable(prjt, ix, "data", "class", []int{0, 1})
 	if err != nil {
 		t.Error(err)
 	}
diff --git a/tensor/stats/pca/svd_test.go b/tensor/stats/pca/svd_test.go
index af83fa170..f1caad8b7 100644
--- a/tensor/stats/pca/svd_test.go
+++ b/tensor/stats/pca/svd_test.go
@@ -29,9 +29,9 @@ func TestSVDIris(t *testing.T) {
 	pc := &SVD{}
 	pc.Init()
 	pc.Kind = mat.SVDFull
-	// pc.TableCol(ix, "data", metric.Covariance64)
+	// pc.TableColumn(ix, "data", metric.Covariance64)
 	// fmt.Printf("covar: %v\n", pc.Covar)
-	err = pc.TableCol(ix, "data", metric.Correlation64)
+	err = pc.TableColumn(ix, "data", metric.Correlation64)
 	if err != nil {
 		t.Error(err)
 	}
@@ -50,7 +50,7 @@ func TestSVDIris(t *testing.T) {
 	}
 
 	prjt := &table.Table{}
-	err = pc.ProjectColToTable(prjt, ix, "data", "class", []int{0, 1})
+	err = pc.ProjectColumnToTable(prjt, ix, "data", "class", []int{0, 1})
 	if err != nil {
 		t.Error(err)
 	}
diff --git a/tensor/stats/simat/simat_test.go b/tensor/stats/simat/simat_test.go
index 5c07fbfd0..103f7ae9a 100644
--- a/tensor/stats/simat/simat_test.go
+++ b/tensor/stats/simat/simat_test.go
@@ -36,7 +36,7 @@ func TestSimMat(t *testing.T) {
 	}
 	ix := table.NewIndexView(dt)
 	smat := &SimMat{}
-	smat.TableCol(ix, "Input", "Name", false, metric.Euclidean64)
+	smat.TableColumn(ix, "Input", "Name", false, metric.Euclidean64)
 
 	// fmt.Println(smat.Mat)
 	assert.Equal(t, simres, smat.Mat.String())