diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml new file mode 100644 index 00000000..e68a6c25 --- /dev/null +++ b/.github/workflows/pytest.yaml @@ -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']" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 56a54fe8..8d28cade 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ pandas xarray -psp # need to put on pypi +pv-site-prediction pydantic \ No newline at end of file diff --git a/tests/test_forecast.py b/tests/test_forecast.py new file mode 100644 index 00000000..4d0d1e06 --- /dev/null +++ b/tests/test_forecast.py @@ -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()}") +