Skip to content

Commit

Permalink
Fix time horizon validation
Browse files Browse the repository at this point in the history
  • Loading branch information
merschformann committed Dec 9, 2024
1 parent b4afc63 commit 92df677
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions factory/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,8 @@ func validateTimeHorizon(input schema.Input, modelOptions Options) error {
}

// Keep track of minimum and maximum time in the input data
minTime := time.Time{} // zero time
maxTime := time.Unix(1<<63-62135596801, 999999999) // max time
minTime := time.Unix(1<<63-62135596801, 999999999) // zero time
maxTime := time.Time{} // max time

// Define some helper functions
updateMinMaxTime := func(t time.Time) {
Expand All @@ -1207,12 +1207,7 @@ func validateTimeHorizon(input schema.Input, modelOptions Options) error {
if t.IsZero() {
continue
}
if t.Before(minTime) {
minTime = t
}
if t.After(maxTime) {
maxTime = t
}
updateMinMaxTime(t)
}
}
}
Expand Down

0 comments on commit 92df677

Please sign in to comment.