bdb2021

package
v0.0.0-...-de618e6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NilScore  = -1
	NilCount  = -1
	NilHeight = -1
	NilJersey = -1
)
View Source
const (
	DateFormat      = "01/02/2006"
	TimeFormat      = "15:04:05"
	BirthDateFormat = "2006-01-02"
	TimestampFormat = "2006-01-02T15:04:05.999Z07:00"
)

Variables

This section is empty.

Functions

func ReadZip

func ReadZip(zipFile string) error

Types

type DataSet

type DataSet struct {
	Players  []*Player
	Games    []*Game
	Plays    []*Play
	Tracking []*Track
}

type Game

type Game struct {
	GameID          string     // 0
	Date            *time.Time // 1
	Time            *time.Time // 2
	HomeTeamAbbr    string     // 3
	VisitorTeamAbbr string     // 4
	Week            int        // 5
}

func ParseGame

func ParseGame(r io.Reader) ([]*Game, error)

func (*Game) Unmarshal

func (g *Game) Unmarshal(row []string) error

type Play

type Play struct {
	GameID                 string           // 0
	PlayID                 string           // 1
	PlayDescription        string           // 2
	Quarter                int              // 3
	Down                   int              // 4
	YardsToGo              int              // 5
	PossessionTeam         string           // 6
	PlayType               string           // 7
	YardlineSide           string           // 8
	YardlineNumber         int              // 9
	OffenseFormation       string           // 10
	PersonnelO             map[string]int   // 11
	DefendersInTheBox      int              // 12
	NumberOfPassRushers    int              // 13
	PersonnelD             map[string]int   // 14
	TypeDropback           string           // 15
	PreSnapVisitorScore    int              // 16
	PreSnapHomeScore       int              // 17
	GameClock              string           // 18
	AbsoluteYardlineNumber string           // 19
	PenaltyCodes           string           // 20
	PenaltyJerseyNumbers   map[string][]int // 21
	PassResult             string           // 22
	OffensePlayResult      int              // 23
	PlayResult             int              // 24
	EPA                    float64          // 25
	IsDefensivePI          bool             // 26
}

func ParsePlay

func ParsePlay(r io.Reader) ([]*Play, error)

func (*Play) UnmarshalCSV

func (p *Play) UnmarshalCSV(row []string) error

type Player

type Player struct {
	NFLID       string     // 0
	Height      int        // 1
	Weight      int        // 2
	BirthDate   *time.Time // 3
	College     string     // 4
	Position    string     // 5
	DisplayName string     // 6
}

func ParsePlayer

func ParsePlayer(r io.Reader) ([]*Player, error)

func (*Player) Unmarshal

func (p *Player) Unmarshal(row []string) error

type Track

type Track struct {
	Timestamp     int64    // 0
	X, Y          *float64 // 1,2
	S, A          *float64 // 3,4
	Dis, O, Dir   *float64 // 5,6,7
	Event         string   // 8
	NFLID         string   // 9
	DisplayName   string   // 10
	JerseyNumber  int      // 11
	Position      string   // 12
	FrameID       int      // 13
	Team          string   // 14
	GameID        string   // 15
	PlayID        string   // 16
	PlayDirection string   // 17
	Route         *string  // 18
}

func ParseTrack

func ParseTrack(r io.Reader) ([]*Track, error)

func (*Track) Unmarshal

func (t *Track) Unmarshal(row []string) error

Jump to

Keyboard shortcuts

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