pickem4me

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

README

pickem4me

Pick my B1G Pick 'em picks for me

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModels

func GetModels(ctx context.Context, suPath, nsPath, sdPath string) (map[string]*firestore.DocumentSnapshot, error)

GetModels returns the model requested by the given identifier string, or the most conservative model if an empty path is given.

func LookupStreakPick

func LookupStreakPick(ctx context.Context, picker, season *firestore.DocumentRef, week int) (*bpefs.StreakPick, error)

LookupStreakPick looks up the streak pick for a picker in Firestore

func PickEm

func PickEm(ctx context.Context, m PubSubMessage) error

PickEm consumes a Pub/Sub message.

Types

type Model

type Model struct {
	Performance    bpefs.ModelPerformance
	Predictions    []bpefs.Prediction
	Distribution   distuv.Normal
	PredictionRefs []*firestore.DocumentRef
	// contains filtered or unexported fields
}

Model is a collection of performance metrics, predictions, and a distribution.

func (*Model) Lookup

func (m *Model) Lookup(home, road *firestore.DocumentRef) (*bpefs.Prediction, *firestore.DocumentRef, bool, error)

Lookup prediction by home and road teams, and whether or not to swap them for the slate.

type PickEmMessage

type PickEmMessage struct {
	// Slate is the path to a parsed slate in Firestore
	Slate string `json:"slate"`

	// Picker is the path to a picker in Firestore
	Picker string `json:"picker"`

	// StraightModel is a path to a model to use when picking striaght-up picks (empty value means use the best model possible)
	StraightModel string `json:"straightModel"`

	// NoisySpreadModel is a path to a model to use when picking noisy spread picks (empty value means use the best model possible)
	NoisySpreadModel string `json:"noisySpreadModel"`

	// SuperdogModel is a path to a model to use when picking superdog picks (empty value means use the best model possible)
	SuperdogModel string `json:"superdogModel"`

	// DryRun tells the code to print what would be written, but not two create the excel output.
	DryRun bool `json:"dryrun,omitempty"`
}

PickEmMessage tells the function what to pick and for whom.

type PubSubMessage

type PubSubMessage struct {
	Data []byte `json:"data"`
}

PubSubMessage is the payload of a Pub/Sub event.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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