utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

This package is intended to be used by other ml-essentials' packages. There is nothing of value here for as far as end users are concerned.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBoolSliceEquals

func AssertBoolSliceEquals(name string, actual []bool, expected []bool, t *testing.T) bool

func AssertFalse

func AssertFalse(message string, value bool, t *testing.T) bool

func AssertFloatEquals

func AssertFloatEquals(name string, actual float64, expected float64, t *testing.T) bool

func AssertFloatSliceEquals

func AssertFloatSliceEquals(name string, actual []float64, expected []float64, t *testing.T) bool

func AssertIntEquals

func AssertIntEquals(name string, actual int, expected int, t *testing.T) bool

func AssertIntNotEquals

func AssertIntNotEquals(name string, actual int, notExpected int, t *testing.T) bool

func AssertIntSliceEquals

func AssertIntSliceEquals(name string, actual []int, expected []int, t *testing.T) bool

func AssertIntSliceNotEquals

func AssertIntSliceNotEquals(name string, actual []int, notExpected []int, t *testing.T) bool

func AssertNoError

func AssertNoError(err error, t *testing.T) bool

func AssertStringEquals

func AssertStringEquals(name string, actual string, expected string, t *testing.T) bool

func AssertStringNotEquals

func AssertStringNotEquals(name string, actual string, notExpected string, t *testing.T) bool

func AssertStringSliceEquals

func AssertStringSliceEquals(name string, actual []string, expected []string, orderMatters bool, t *testing.T) bool

func AssertTrue

func AssertTrue(message string, value bool, t *testing.T) bool

func FloatArgSort

func FloatArgSort(values []float64, readonly bool) []int

func HashIntSlice

func HashIntSlice(indices []int) int

func IndexOfString

func IndexOfString(element string, array []string) int

func MakeRange

func MakeRange(from int, to int, interval int) []int

func SplitStringSlice

func SplitStringSlice(strings []string, nGroups int) [][]string

func StringSetKeys

func StringSetKeys(set map[string]bool) []string

func ToStringSet

func ToStringSet(strings []string) map[string]bool

Types

type GroupIndexer

type GroupIndexer struct {
	NGroups int
	// contains filtered or unexported fields
}

func CreateGroupIndexer

func CreateGroupIndexer(nElements int, nGroups int) GroupIndexer

func (GroupIndexer) HasNext

func (indexer GroupIndexer) HasNext() bool

func (*GroupIndexer) Initialize

func (indexer *GroupIndexer) Initialize(nElements int, nGroups int)

func (*GroupIndexer) Next

func (indexer *GroupIndexer) Next() (int, int, int)

type ProcessedJob

type ProcessedJob struct {
	Key    string
	Error  error
	Result interface{}
}

type StringQ

type StringQ struct {
	Keys    chan string
	Errors  chan ProcessedJob
	Workers int
	NumJobs int
}

func CreateStringQueue

func CreateStringQueue(keys []string, maxWorkers int) StringQ

func (StringQ) Next

func (q StringQ) Next() string

func (StringQ) Notify

func (q StringQ) Notify(err ProcessedJob)

func (StringQ) Results

func (q StringQ) Results() []ProcessedJob

func (StringQ) Wait

func (q StringQ) Wait()

Jump to

Keyboard shortcuts

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