Skip to content

Commit

Permalink
add pytest + one test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Nov 23, 2023
1 parent 0ac8b9c commit 88acb64
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Python package tests

on:
push:
schedule:
- cron: "0 12 * * 1"
jobs:
call-run-python-tests:
uses: openclimatefix/.github/.github/workflows/python-test.yml@main
with:
# pytest-cov looks at this folder
pytest_cov_dir: "quartz_solar_forecast"
os_list: '["ubuntu-latest"]'
python-version: "['3.10','3.11']"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pandas
xarray
psp # need to put on pypi
pv-site-prediction
pydantic
14 changes: 14 additions & 0 deletions tests/test_forecast.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from quartz_solar_forecast.forecast import run_forecast
from quartz_solar_forecast.pydantic_models import PVSite


def test_run_forecast():
# make input data
site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25)

# run model
predications_df = run_forecast(site=site, ts='2023-10-30')

print(predications_df)
print(f"Max: {predications_df['power_wh'].max()}")

0 comments on commit 88acb64

Please sign in to comment.