Skip to content

Commit

Permalink
Merge pull request #84 from MichaHllx/settingUpTheProject
Browse files Browse the repository at this point in the history
Setting up the project: Introduced new dependency installation pipeline via ```run_project_setup.sh``` (Linux/MacOs) and ```run_project_setup.ba``` (Windows). Changed ```README.md``` to incorporate the changes.
  • Loading branch information
nickpadd authored Nov 26, 2024
2 parents c3ccf95 + dbfc1bf commit 2067c9a
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 3,950 deletions.
36 changes: 4 additions & 32 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- completed
workflow_dispatch:


jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -28,40 +27,13 @@ jobs:
python-version: '3.10'

#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
# install dependencies
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --no-interaction

run: pip install -r requirements.txt

#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: |
source .venv/bin/activate
pytest tests/
run: pytest tests/
48 changes: 8 additions & 40 deletions .github/workflows/script_pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,63 +27,31 @@ jobs:
python-version: '3.10'

#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
# install dependencies
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --no-interaction
run: pip install -r requirements.txt

#----------------------------------------------
# run data collection
#----------------------------------------------
- name: Run data collection script
run: |
source $VENV
python run_data_collection.py
run: python run_data_collection.py

#----------------------------------------------
# run updates
#----------------------------------------------
#- name: Run updates script
# run: |
# source $VENV
# python run_updates.py
# run: python run_updates.py

#----------------------------------------------
# run predictions
#----------------------------------------------
- name: Run predictions script
run: |
source $VENV
python run_predictions.py
run: python run_predictions.py

#----------------------------------------------
# run evaluation
#----------------------------------------------
- name: Run evaluation script
run: |
source $VENV
python run_evaluation_per_season.py
run: python run_evaluation_per_season.py
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
mlruns/**
htmlcov/**
poetry.lock
.coverage
/raw_files/**
/preprocessed_files/**
/evaluation/**
*.pyc
updates_script.sh
updates_script.sh
/eflp_venv/**
60 changes: 23 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EuropeanFotballLeaguePredictor
# EuropeanFootballLeaguePredictor

EuropeanFootballLeaguePredictor is a predictor of europes top league games based on historic performances of teams, taking into account only advanced league table statistics. It uses traditional machine learning techniques and statistical modeling in order to deduct data driven predictions based on the team’s season performance and recent form. The EuropeanFootballLeaguePredictor includes EnglishPremierLegue, La Liga, Ligue 1, Bundesliga, Serie A.

Expand All @@ -14,48 +14,34 @@ The [EuropeanFootballLeaguePredictor Github Page](https://nickpadd.github.io/Eur


## How to run the project
### Installing Project Dependencies
### Haven’t installed the project yet? Time to dive in!
1. Clone this repository to your local machine or download the project files.

```bash
git clone https://github.com/nickpadd/EuropeanFootballLeaguePredictor

2. Navigate to the project directory using the command line.
```bash
cd EuropeanFootballLeaguePredictor
- Managing dependencies with Poetry:
- Installing poetry:
```bash
pip install poetry
```
- Installing project dependencies:
```bash
poetry install
```

- Running the poetry shell (a virtual environment with the dependencies installed):
```bash
poetry shell
- Alternative method via venv:
- Create a virtual environment using venv:
```bash
python3 -m venv venv
```
- Activate the virtual environment:
- On Windows:
```bash
venv\Scripts\activate
```
- On macOS/Linux:
```bash
source venv/bin/activate
```
- Install requirements:
```bash
pip install -r requirements.txt
```
3. Run the following command in the terminal:
- macOS/Linux users
```bash
bash run_project_setup.sh

- Windows users
```bash
run_project_setup.bat
The script will install the project dependencies and create a virtual environment for the project.<br>
**Wait until it's finished and don't close the terminal.**
### (Already) installed the project? Let's get started!
1. Open the terminal and navigate to the project folder *EuropeanFootballLeaguePredictor*.
2. Run the following command in the terminal:
- macOS/Linux users
```bash
source eflp_venv/bin/activate
- Windows users
```bash
eflp_venv\Scripts\activate
### Configuration
The configuration file europeanfootballleaguepredictor/config/config.yaml includes many of the models parameters such as:
Expand Down
Loading

0 comments on commit 2067c9a

Please sign in to comment.