Skip to content

Commit df0db5c

Browse files
author
andre_ramos
committed
hot fix empty cycle
1 parent e4f4fe2 commit df0db5c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)