Exemplo n.º 1
0
from backend.src.dataAnalytics import dataAnalytics
from backend.src.playsSeperator import playsSeperator
from backend.src.dataCollector import dataCollector
import warnings
import pytest

warnings.simplefilter(action='ignore', category=FutureWarning)

da = dataAnalytics()
dc = dataCollector()
data = dc.readfile(
    "https://github.com/jayeshjakkani/American-Football-Analytics-Application/blob/master/backend/src/NCSU.csv?raw=true"
)
ps = playsSeperator()
all_plays = ps.getDataframesByPlays("NCST", data, "Season", "2019")
offensive_plays = {"PUNT", "KICKOFF_RETURN", "FIELDGOAL"}
defensive_plays = {"PUNT_RETURN", "KICKOFF", "FIELDGOAL_BLOCK"}


def test03():
    for playType, playData in all_plays.items():

        if playType in offensive_plays:
            formations = playData["pff_OFFPLAYERS"]
            ratings = playData["pff_OFFPLAYERSRATINGS"]

        elif playType in defensive_plays:
            formations = playData["pff_DEFPLAYERS"]
            ratings = playData["pff_DEFPLAYERSRATINGS"]

        countsAndRatings = da.generateTotalCountsAndRatings(
from backend.src.playsSeperator import playsSeperator
from backend.src.dataCollector import dataCollector

data_collector = dataCollector()
data = data_collector.readfile("https://github.com/jayeshjakkani/American-Football-Analytics-Application/blob/master/backend/src/NCSU.csv?raw=true")
play_separator = playsSeperator()
plays = play_separator.getDataframesByPlays("NCST", data,'Season','2019')

def test02():
  for k, v in plays.items():
    assert v is not None