Skip to content

Commit

Permalink
metro endpoint as env var - issue noi-techpark#31
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Angheben committed Sep 30, 2024
1 parent 2fb42f4 commit a2a3c1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pollution_v2/src/common/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@
TMP_DIR = f'{MAIN_DIR}/tmp'
if not os.path.exists(TMP_DIR):
os.makedirs(TMP_DIR)

METRO_WS_PREDICTION_ENDPOINT = Variable.get("METRO_WS_PREDICTION_ENDPOINT", "http://metro:80/predict/?station_code=")
5 changes: 2 additions & 3 deletions pollution_v2/src/road_weather/model/road_weather_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import urllib.request
import mimetypes

from common.settings import TMP_DIR
from common.settings import TMP_DIR, METRO_WS_PREDICTION_ENDPOINT

logger = logging.getLogger("pollution_v2.road_weather.model.road_weather_model")

Expand Down Expand Up @@ -73,8 +73,7 @@ def compute_data(self, observation: RoadWeatherObservationMeasureCollection,
f"{observation_filename} and forecast from {forecast_filename}")
logger.info(f"Forecast start: {forecast_start}")

# TODO cablato
url = f"http://metro:80/predict/?station_code={station.wrf_code}"
url = f"{METRO_WS_PREDICTION_ENDPOINT}{station.wrf_code}"

# List of files to upload
files_to_upload = [forecast_filename, observation_filename]
Expand Down

0 comments on commit a2a3c1a

Please sign in to comment.