Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Jun 11, 2024
1 parent b71335e commit dec4ee4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/operation/operation_model_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -487,22 +487,22 @@ function validate_time_series!(model::OperationModel)
if get_resolution(settings) == UNSET_RESOLUTION && length(available_resolutions) != 1
throw(
IS.ConflictingInputsError(
"Data contains multiple resolutions, the resolution keyword argument must be added to the Model. Time Series Resolutions: $(available_resolutions)",
"Data contains multiple resolutions, the resolution keyword argument must be added to the Model. Time Series Resolutions: $(Dates.canonicalize(first(available_resolutions)))",
),
)
elseif get_resolution(settings) != UNSET_RESOLUTION &&
length(available_resolutions) >= 1
if get_resolution(settings) available_resolutions
throw(
IS.ConflictingInputsError(
"Resolution $(get_resolution(settings)) is not available in the system data. Time Series Resolutions: $(available_resolutions)",
"Resolution $(get_resolution(settings)) is not available in the system data. Time Series Resolutions: $(Dates.canonicalize(first(available_resolutions)))",
),
)
end
set_resolution!(settings, first(available_resolutions))
else
IS.@assert_op get_resolution(settings) == UNSET_RESOLUTION
@info "Resolution not set, using $(first(available_resolutions)) from the system data"
@info "Resolution not set, using $(Dates.canonicalize(first(available_resolutions))) from the system data"
set_resolution!(settings, first(available_resolutions))
end

Expand Down

0 comments on commit dec4ee4

Please sign in to comment.