From 34ed562d5b678e498007ea86cec7022e851bab2a Mon Sep 17 00:00:00 2001
From: Peder <pbac@dtu.dk>
Date: Tue, 7 Sep 2021 10:52:29 +0200
Subject: [PATCH] pi was not allowed in transformations in model(), now set as
 a special case

---
 DESCRIPTION       | 2 +-
 R/forecastmodel.R | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 235db09..553a704 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: onlineforecast
 Type: Package
 Title: Forecast Modelling for Online Applications
-Version: 0.10.0
+Version: 0.10.1
 Description: A framework for fitting adaptive forecasting models. Provides a way to use forecasts as input to models, e.g. weather forecasts for energy related forecasting. The models can be fitted recursively and can easily be setup for updating parameters when new data arrives. See the included vignettes, the website <https://onlineforecasting.org> and the paper "Short-term heat load forecasting for single family houses" <doi:10.1016/j.enbuild.2013.04.022>.
 License: GPL-3
 Encoding: UTF-8
diff --git a/R/forecastmodel.R b/R/forecastmodel.R
index 2c0c595..1de0860 100644
--- a/R/forecastmodel.R
+++ b/R/forecastmodel.R
@@ -292,7 +292,9 @@ forecastmodel <- R6::R6Class("forecastmodel", public = list(
                         stop("The input variable '",nm,"' doesn't have the same number of observations as time vector 't' in the data. It has ",length(data[[nm]]),", but 't' has ",length(data$t))
                     }
                 }else{
-                    stop("The variable '",nm,"' is missing in data, or it has the wrong class.\nIt must be class: data.frame, matrix or vector.\nIt is needed for the input expression '",self$inputs[[i]]$expr[[1]],"'")
+                    if(!nm == "pi"){
+                        stop("The variable '",nm,"' is missing in data, or it has the wrong class.\nIt must be class: data.frame, matrix or vector.\nIt is needed for the input expression '",self$inputs[[i]]$expr[[1]],"'")
+                    }
                 }
             }
         }
-- 
GitLab