[fix] Pytest for fix ValueError when plotting events components #1755
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: model | |
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: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install -e . | |
pip3 install pytest | |
pip3 install tabulate # required to md export | |
pip3 install kaleido # required for plotly export | |
- name: Train model | |
run: | | |
pytest tests/test_model_performance.py | |
- 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: Compare performance | |
run: | | |
echo "## Model Benchmark" >> report.md | |
python tests/metrics/compareMetrics.py >> report.md | |
- name: Publish report | |
env: | |
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "<details>\n<summary>Model training plots</summary>\n" >> report.md | |
echo "## Model Training" >> report.md | |
echo "### PeytonManning" >> report.md | |
cml asset publish tests/metrics/PeytonManning.svg --md >> report.md | |
echo "### YosemiteTemps" >> report.md | |
cml asset publish tests/metrics/YosemiteTemps.svg --md >> report.md | |
echo "### AirPassengers" >> report.md | |
cml asset publish tests/metrics/AirPassengers.svg --md >> report.md | |
echo "\n</details>" >> report.md | |
# Post reports as comments in GitHub PRs | |
cml comment update --pr report.md # post to PR | |
cml check create --title=ModelReport report.md # update status of check in PR | |
- name: Upload metrics if on main | |
uses: actions/upload-artifact@v3 | |
with: | |
name: metrics | |
path: tests/metrics/ |