Skip to content

Commit

Permalink
chore: gh action debug
Browse files Browse the repository at this point in the history
  • Loading branch information
BlairCurrey committed Feb 6, 2024
1 parent df9c184 commit 41b3ba0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/train-spread-predictor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Print current working directory
run: echo "$(pwd)"

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
17 changes: 8 additions & 9 deletions nfl_analytics/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@
import pandas as pd

from nfl_analytics.config import (
DATA_DIR as DATA_DIR_,
DATA_DIR,
ASSET_DIR as ASSET_DIR_,
)


THIS_DIR = os.path.dirname(os.path.abspath(__file__))
ASSET_DIR = os.path.join(THIS_DIR, ASSET_DIR_)
DATA_DIR = os.path.join(THIS_DIR, DATA_DIR_)
# DATA_DIR = os.path.join(THIS_DIR, DATA_DIR_)


def download_data(years=range(1999, 2024)):
print(THIS_DIR)
print(DATA_DIR)
DATA_DIR = DATA_DIR_
os.makedirs(DATA_DIR, exist_ok=True)

for year in years:
Expand Down Expand Up @@ -62,10 +59,12 @@ def load_dataframe_from_remote(years=range(1999, 2024)):


def load_dataframe_from_raw():
if not os.path.exists(DATA_DIR):
raise FileNotFoundError(f"Data directory '{DATA_DIR}' not found.")
data_directory = os.path.join(THIS_DIR, DATA_DIR)

files = os.listdir(DATA_DIR)
if not os.path.exists(data_directory):
raise FileNotFoundError(f"Data directory '{data_directory}' not found.")

files = os.listdir(data_directory)

if not files:
raise FileNotFoundError(f"No data files found in the data directory.")
Expand All @@ -88,7 +87,7 @@ def load_dataframe_from_raw():
for filename in files:
if filename.endswith(".csv.gz"):
print(f"Reading {filename}")
file_path = os.path.join(DATA_DIR, filename)
file_path = os.path.join(data_directory, filename)

df = pd.read_csv(file_path, compression="gzip", low_memory=False)

Expand Down

0 comments on commit 41b3ba0

Please sign in to comment.