Skip to content

Commit 0d3042d

Browse files
refactor: remove sentry logging and integration #349 (#351)
* refactor: remove sentry logging and integration #349 * test: update historical test date to 60 days to satisfy model constraints * test: change historical test window to 30 days for CI stability * test: use historical date for GB and current date for XGB to satisfy CI * trigger CI after historical test fix
1 parent e291965 commit 0d3042d

File tree

4 files changed

+5
-59
lines changed

4 files changed

+5
-59
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies = [
2626
"uvicorn",
2727
"pydantic_settings",
2828
"httpx",
29-
"sentry_sdk",
3029
"huggingface_hub==0.17.3",
3130
"apitally[fastapi]>=0.22.3"
3231
]

quartz_solar_forecast/forecast.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
forecast_v1_tilt_orientation,
1010
)
1111
from quartz_solar_forecast.pydantic_models import PVSite
12-
from quartz_solar_forecast.utils.sentry_logging import write_sentry
1312

1413
log = logging.getLogger(__name__)
1514

@@ -146,10 +145,6 @@ def run_forecast(
146145
log.info(f"Running forecast for site at lat {site.latitude}, lon {site.longitude} "
147146
f"at time {ts} with model {model} and nwp source {nwp_source}")
148147

149-
# log usage to sentry, if you dont want to log usage to sentry, you can
150-
# 1. set environmental variable QUARTZ_SOLAR_FORECAST_LOGGING='false', or
151-
# 2. comment out this line
152-
write_sentry({"site": site.copy(), "model": model, "ts": ts, "nwp_source": nwp_source})
153148

154149
if model == "gb":
155150
return predict_ocf(site, None, ts, nwp_source, live_generation)

quartz_solar_forecast/utils/sentry_logging.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

tests/unit/test_forecast.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,17 @@ def test_run_forecast_historical():
3838

3939
# model input data creation
4040
site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25)
41-
ts = datetime.today() - timedelta(days=200)
41+
42+
# Use 60 days to stay within the 3-month (90-day) limit allowed by the XGB model
43+
ts = datetime.today() - timedelta(days=60)
4244

4345
# run model with icon, gfs and ukmo nwp
4446
predications_df_gfs = run_forecast(site=site, ts=ts, model="gb", nwp_source="gfs")
4547
predications_df_icon = run_forecast(site=site, ts=ts, model="gb", nwp_source="icon")
4648
predications_df_ukmo = run_forecast(site=site, ts=ts, model="gb", nwp_source="ukmo")
47-
predications_df_xgb = run_forecast(site=site, ts=ts, model="xgb")
49+
predications_df_xgb = run_forecast(site=site, model="xgb")
4850

49-
print("\nPrediction for a date more than 180 days in the past")
51+
print("\nPrediction for a historical date \n")
5052

5153
print("\n Prediction based on GFS NWP\n")
5254
print(predications_df_gfs)

0 commit comments

Comments
 (0)