Skip to content

Commit

Permalink
Merge pull request #237 from config-i1/master
Browse files Browse the repository at this point in the history
Bringing this up to speed.
  • Loading branch information
config-i1 authored Jan 24, 2025
2 parents 15d23f6 + e008d63 commit 999ef4b
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 13 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ubuntu-gcc-ubsan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Script generated by ChatGPT

name: R Package UBSan Check

on:
pull_request:
workflow_dispatch:

jobs:
ubsan-check:
runs-on: ubuntu-latest

env:
_R_CHECK_FORCE_SUGGESTS_: "false"

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up R
uses: r-lib/actions/setup-r@v2

- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y gfortran gcc libcurl4-openssl-dev libxml2-dev libssl-dev libreadline-dev
- name: Install R package dependencies
run: |
Rscript -e 'install.packages(c("remotes", "devtools", "r-lib/pkgbuild", "r-lib/pkgdown"))'
Rscript -e 'remotes::install_deps(dependencies = TRUE)'
- name: Install R-devel
run: |
wget https://stat.ethz.ch/R/daily/R-devel.tar.gz
tar -xzf R-devel.tar.gz
cd R-devel
./configure --enable-strict-barrier --with-ubsan --with-gcc --with-x=no
make
echo "R-devel installed."
- name: Run UBSan checks
run: |
R CMD check --as-cran --use-valgrind --no-manual .
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: smooth
Type: Package
Title: Forecasting Using State Space Models
Version: 4.1.1.41004
Date: 2024-11-16
Version: 4.1.1.41005
Date: 2025-01-05
Authors@R: person("Ivan", "Svetunkov", email = "ivan@svetunkov.com", role = c("aut", "cre"),
comment="Senior Lecturer at Centre for Marketing Analytics and Forecasting, Lancaster University, UK")
URL: https://github.com/config-i1/smooth
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
smooth v4.1.1 (Release data: 2024-11-16)
smooth v4.1.1 (Release data: 2025-01-05)
=======

Changes:
Expand All @@ -9,6 +9,7 @@ Changes:
Bugfixes:
* Corrected the author details in the documentation.
* reapply() would not work with bootstrap in case of negative data. Now it does.
* Added a check in adam() to make sure that model is not estimated when all parameters are provided in case of ARIMA.


smooth v4.1.0 (Release data: 2024-10-01)
Expand Down
2 changes: 1 addition & 1 deletion R/adam-sma.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ sma <- function(y, order=NULL, ic=c("AICc","AIC","BIC","BICc"),
stop("The provided model is not Simple Moving Average!",call.=FALSE);
}
else{
order <- model$order;
order <- model$orders[1];
}
}

Expand Down
10 changes: 5 additions & 5 deletions R/adamGeneral.R
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,7 @@ parametersChecker <- function(data, model, lags, formulaToUse, orders, constant=
# If we don't need to estimate anything, flag initialEstimate
if(!any(c(etsModel && initialLevelEstimate,
(etsModel && modelIsTrendy && initialTrendEstimate),
(etsModel & modelIsSeasonal & initialSeasonalEstimate),
(etsModel && modelIsSeasonal && all(initialSeasonalEstimate)),
(arimaModel && initialArimaEstimate),
(xregModel && initialXregEstimate)))){
initialEstimate[] <- FALSE;
Expand All @@ -2447,7 +2447,7 @@ parametersChecker <- function(data, model, lags, formulaToUse, orders, constant=
# If at least something is provided, flag it as "provided"
if((etsModel && !initialLevelEstimate) ||
(etsModel && modelIsTrendy && !initialTrendEstimate) ||
any(etsModel & modelIsSeasonal & !initialSeasonalEstimate) ||
(etsModel && modelIsSeasonal && any(!initialSeasonalEstimate)) ||
(arimaModel && !initialArimaEstimate) ||
(xregModel && !initialXregEstimate)){
initialType[] <- "provided";
Expand Down Expand Up @@ -3050,9 +3050,9 @@ parametersChecker <- function(data, model, lags, formulaToUse, orders, constant=
if(!any(c(etsModel & c(persistenceLevelEstimate, persistenceTrendEstimate,
persistenceSeasonalEstimate, phiEstimate,
(initialType!="complete") & c(initialLevelEstimate,
initialTrendEstimate,
initialSeasonalEstimate)),
arimaModel & c(arEstimate, maEstimate, (initialType!="complete") & initialArimaEstimate),
initialTrendEstimate,
initialSeasonalEstimate)),
arimaModel & c(arEstimate, maEstimate, (initialType!="complete") & initialEstimate & initialArimaEstimate),
xregModel & c(persistenceXregEstimate, (initialType!="complete") & initialXregEstimate),
constantEstimate,
otherParameterEstimate))){
Expand Down
8 changes: 4 additions & 4 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.onAttach <- function(libname, pkgname) {
startUpMessage <- paste0("This is package \"smooth\", v",packageVersion(pkgname));
randomNumber <- trunc(runif(1,1,101));
randomNumber <- sample(c(1:100), 1);
if(randomNumber<=4){
if(randomNumber==1){
startUpMessage <- paste0(startUpMessage,"\nBy the way, have you already tried adam() function from smooth?");
}
else if(randomNumber==2){
startUpMessage <- paste0(startUpMessage,"\nIf you want to know more about the smooth package and forecasting, ",
"you can visit my website: https://forecasting.svetunkov.ru/");
"you can visit my website: https://www.openforecast.org/");
}
else if(randomNumber==3){
startUpMessage <- paste0(startUpMessage,"\nHave you tried adam() yet? If you want to know more about this function, ",
"you can visit my online textbook: https://www.openforecast.org/adam/");
"you can read the online monograph about it: https://www.openforecast.org/adam/");
}
else if(randomNumber==4){
startUpMessage <- paste0(startUpMessage,"\nAny thought or suggestions about the package? ",
startUpMessage <- paste0(startUpMessage,"\nAny thoughts or suggestions about the package? ",
"Have you found a bug? File an issue on github: https://github.com/config-i1/smooth/issues");
}
}
Expand Down

0 comments on commit 999ef4b

Please sign in to comment.