Skip to content

Commit 398387b

Browse files
Merge pull request #77 from LAMPSPUC/hot_fix_empty_cycle
Hot fix empty cycle
2 parents 4334a5f + e8b64f2 commit 398387b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StateSpaceLearning"
22
uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b"
33
authors = ["andreramosfc <[email protected]>"]
4-
version = "2.0.8"
4+
version = "2.0.9"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"

src/models/structural_model.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ mutable struct StructuralModel <: StateSpaceLearningModel
109109

110110
if typeof(cycle_period) <: Vector
111111
(@assert all(cycle_period .>= 0) "Cycle period must be greater than or equal to 0")
112+
if isempty(cycle_period)
113+
cycle_period = 0
114+
end
112115
else
113116
(@assert cycle_period >= 0 "Cycle period must be greater than or equal to 0")
114117
end
@@ -1618,7 +1621,7 @@ function simulate_states(
16181621
seasonals_t = [zeros(N_scenarios) for _ in eachindex(model.freq_seasonal)]
16191622
end
16201623

1621-
if model.cycle_period != 0 && model.cycle_period != []
1624+
if model.cycle_period != 0
16221625
cycles_t = []
16231626
for i in eachindex(model.cycle_period)
16241627
λ = 2 * pi * (1:(T + steps_ahead)) / model.cycle_period[i]

0 commit comments

Comments
 (0)