Skip to content

[Minor] Reduce DataFrame copies (#1648) #2303

[Minor] Reduce DataFrame copies (#1648)

[Minor] Reduce DataFrame copies (#1648) #2303

Workflow file for this run

name: Measure Model Performance
on:
push:
paths: # Run only when files under neuralprophet/ are modified
- neuralprophet/**
branches: # Run only on these branches
- main
- develop
pull_request: # Run on pull requests
branches:
- main
- develop
workflow_dispatch:
jobs:
metrics:
runs-on: ubuntu-latest # container: docker://ghcr.io/iterative/cml:0-dvc2-base1
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup NodeJS (for CML)
uses: actions/setup-node@v3 # For CML
with:
node-version: '20'
- name: Setup CML
uses: iterative/setup-cml@v1
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install Dependencies
run: poetry install --no-interaction --no-root --with=pytest,metrics --without=dev,docs,linters
- name: Install Project
run: poetry install --no-interaction --with=pytest,metrics --without=dev,docs,linters
- name: Train model
run: poetry run pytest tests/test_model_performance.py -n 1 --durations=0
- name: Download metrics from main
uses: dawidd6/action-download-artifact@v2
with:
repo: ourownstory/neural_prophet
branch: main
name: metrics
path: tests/metrics-main/
if_no_artifact_found: warn
- name: Open Benchmark Report
run: echo "## Model Benchmark" >> report.md
- name: Write Benchmark Report
run: poetry run python tests/metrics/compareMetrics.py >> report.md
- name: Publish Report with CML
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "<details><summary>Model training plots</summary>" >> report.md
echo "" >> report.md
echo "## Model Training" >> report.md
echo "" >> report.md
echo "### PeytonManning" >> report.md
cml asset publish tests/metrics/PeytonManning.svg --md >> report.md
echo "" >> report.md
echo "### YosemiteTemps" >> report.md
cml asset publish tests/metrics/YosemiteTemps.svg --md >> report.md
echo "" >> report.md
echo "### AirPassengers" >> report.md
cml asset publish tests/metrics/AirPassengers.svg --md >> report.md
echo "" >> report.md
echo "### EnergyPriceDaily" >> report.md
cml asset publish tests/metrics/EnergyPriceDaily.svg --md >> report.md
echo "" >> report.md
echo "</details>" >> report.md
echo "" >> report.md
cml comment update --target=pr report.md # Post reports as comments in GitHub PRs
cml check create --title=ModelReport report.md # update status of check in PR
- name: Upload metrics if on main
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: metrics
path: tests/metrics/