From 42da60c307402440e6ec0f07a9133600b9e2bdbb Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Thu, 16 Mar 2023 20:03:52 +0100
Subject: [PATCH] Bugfix: Extract observations correctly [IDEC-349]

---
 .../model/negativeprognosismodel/NegativePrognosisModel.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/no/nibio/vips/model/negativeprognosismodel/NegativePrognosisModel.java b/src/main/java/no/nibio/vips/model/negativeprognosismodel/NegativePrognosisModel.java
index 27a2fde..cb48177 100755
--- a/src/main/java/no/nibio/vips/model/negativeprognosismodel/NegativePrognosisModel.java
+++ b/src/main/java/no/nibio/vips/model/negativeprognosismodel/NegativePrognosisModel.java
@@ -245,7 +245,7 @@ public class NegativePrognosisModel extends I18nImpl implements Model{
         // Setting timezone
         this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone"));
         // Getting weather data
-        List<WeatherObservation> observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<WeatherObservation>>(){});
+        List<WeatherObservation> observations = modelUtil.extractWeatherObservationList(config.getConfigParameter("observations"));
         for(WeatherObservation o:observations)
         {
             this.dataMatrix.setParamDoubleValueForDate(o.getTimeMeasured(), o.getElementMeasurementTypeId(), o.getValue());
-- 
GitLab