From df0db5c483ce00b1ccc61970c901f0ba6cd2025a Mon Sep 17 00:00:00 2001 From: andre_ramos Date: Fri, 1 Aug 2025 17:18:32 -0300 Subject: [PATCH 1/2] hot fix empty cycle --- src/models/structural_model.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/structural_model.jl b/src/models/structural_model.jl index 72b85f6..5a2241a 100644 --- a/src/models/structural_model.jl +++ b/src/models/structural_model.jl @@ -109,6 +109,9 @@ mutable struct StructuralModel <: StateSpaceLearningModel if typeof(cycle_period) <: Vector (@assert all(cycle_period .>= 0) "Cycle period must be greater than or equal to 0") + if isempty(cycle_period) + cycle_period = 0 + end else (@assert cycle_period >= 0 "Cycle period must be greater than or equal to 0") end @@ -1618,7 +1621,7 @@ function simulate_states( seasonals_t = [zeros(N_scenarios) for _ in eachindex(model.freq_seasonal)] end - if model.cycle_period != 0 && model.cycle_period != [] + if model.cycle_period != 0 cycles_t = [] for i in eachindex(model.cycle_period) λ = 2 * pi * (1:(T + steps_ahead)) / model.cycle_period[i] From e8b64f267d6d24d8f00e775d42066acc6264c930 Mon Sep 17 00:00:00 2001 From: andre_ramos Date: Fri, 1 Aug 2025 17:21:28 -0300 Subject: [PATCH 2/2] update version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d8f95a4..de1962a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StateSpaceLearning" uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b" authors = ["andreramosfc "] -version = "2.0.8" +version = "2.0.9" [deps] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"