-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor tests, and only run integration tests on `main` * set test dir in step 1 * add runs-on * divide out workflows * format * tidy * fix * use tests dir * add comment * change check to repo owner * tidy * change to !- pull request * update comment * echo * use github output * run second job if push * format * pytest.mark.integration * add timeout * remove timeout from merge * turn normalised error into percent * limit metrics to 3sf * update site used in test_evaluation script to give non nan result * add pytest.ini file to mark integration tests * update forecast test with no ts * update forecast test with no ts spelling --------- Co-authored-by: Megawattz <[email protected]>
- Loading branch information
1 parent
d00f5a8
commit 6d0e697
Showing
18 changed files
with
57 additions
and
34 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[pytest] | ||
markers = | ||
integration: marks tests as integration tests |
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
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
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
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pandas as pd | ||
from quartz_solar_forecast.forecast import run_forecast | ||
from quartz_solar_forecast.pydantic_models import PVSite | ||
|
||
|
||
def test_run_forecast_no_ts(): | ||
# make input data | ||
site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25) | ||
|
||
current_ts = pd.Timestamp.now() | ||
|
||
# run gradient boosting model with no ts | ||
predictions_df = run_forecast(site=site, model="gb") | ||
# check current ts agrees with dataset | ||
assert predictions_df.index.min() >= current_ts - pd.Timedelta(hours=1) | ||
|
||
print(predictions_df) | ||
print(f"Current time: {current_ts}") | ||
print(f"Max: {predictions_df['power_kw'].max()}") | ||
|
||
# run xgb model with no ts | ||
predictions_df = run_forecast(site=site, model="xgb") | ||
# check current ts agrees with dataset | ||
assert predictions_df.index.min() >= current_ts - pd.Timedelta(hours=1) | ||
|
||
print(predictions_df) | ||
print(f"Current time: {current_ts}") | ||
print(f"Max: {predictions_df['power_kw'].max()}") |
File renamed without changes.
File renamed without changes.