Skip to content

Commit

Permalink
Merge pull request #393 from kdayday/semicolon_bug_fix
Browse files Browse the repository at this point in the history
Add missing or move incorrect semicolons
  • Loading branch information
jd-lara authored Sep 9, 2024
2 parents c235864 + dbcb3e2 commit 0462a5e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions docs/src/dev_guide/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Note that you can use `Logging.ConsoleLogger` if you don't have `TerminalLoggers
```julia
console_logger = TerminalLogger(stderr, Logging.Error)

open_file_logger("log.txt", Logging.Info) do file_logger
open_file_logger("log.txt"; level = Logging.Info) do file_logger
multi_logger = MultiLogger([console_logger, file_logger])
global_logger(multi_logger)

Expand All @@ -125,7 +125,7 @@ try/finally block and reset the global logger upon exit.
function run_tests()
console_logger = TerminalLogger(stderr, Logging.Error)

open_file_logger("log.txt", Logging.Info) do file_logger
open_file_logger("log.txt"; level = Logging.Info) do file_logger
multi_logger = MultiLogger([console_logger, file_logger])
global_logger(multi_logger)

Expand Down
4 changes: 2 additions & 2 deletions src/system_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ See also: [`get_time_series_multiple` from an individual component or attribute]
))
"""
function get_time_series_multiple(
data::SystemData,
filter_func = nothing;
data::SystemData;
filter_func = nothing,
type = nothing,
name = nothing,
)
Expand Down
20 changes: 10 additions & 10 deletions src/time_series_formats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Pass component_name when the file does not have the component name in a column h
"""
function read_time_series(
::Type{T},
data_file::AbstractString,
component_name = nothing;
data_file::AbstractString;
component_name = nothing,
kwargs...,
) where {T <: TimeSeriesData}
if !isfile(data_file)
Expand All @@ -34,8 +34,8 @@ end
function read_time_series(metadata::TimeSeriesFileMetadata; kwargs...)
return read_time_series(
metadata.time_series_type,
metadata.data_file,
metadata.component_name;
metadata.data_file;
component_name = metadata.component_name,
kwargs...,
)
end
Expand Down Expand Up @@ -174,8 +174,8 @@ Pass component_name when the file does not have the component name in a column h
function read_time_series(
::Type{T},
::Type{Deterministic},
file::CSV.File,
component_name = nothing;
file::CSV.File;
component_name = nothing,
kwargs...,
) where {T <: TimeSeriesFormatDateTimeAsColumn}
@debug "Read CSV data from $file." _group = LOG_GROUP_TIME_SERIES
Expand All @@ -201,8 +201,8 @@ This version of the function only has component_name to match the interface. It
function read_time_series(
::Type{T},
::Type{<:StaticTimeSeries},
file::CSV.File,
component_name = nothing;
file::CSV.File;
component_name = nothing,
kwargs...,
) where {T <: Union{TimeSeriesFormatPeriodAsColumn, TimeSeriesFormatDateTimeAsColumn}}
first_timestamp = get_timestamp(T, file, 1)
Expand Down Expand Up @@ -247,8 +247,8 @@ day is used.
function read_time_series(
::Type{T},
::Type{<:StaticTimeSeries},
file::CSV.File,
component_name = nothing;
file::CSV.File;
component_name = nothing,
kwargs...,
) where {T <: TimeSeriesFormatComponentsAsColumnsNoTime}
first_timestamp = get(kwargs, :start_datetime, Dates.DateTime(Dates.today()))
Expand Down
22 changes: 11 additions & 11 deletions src/time_series_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ See also: [`get_time_series` by name](@ref get_time_series(
"""
function get_time_series(
owner::TimeSeriesOwners,
key::TimeSeriesKey,
key::TimeSeriesKey;
start_time::Union{Nothing, Dates.DateTime} = nothing,
len::Union{Nothing, Int} = nothing,
count::Union{Nothing, Int} = nothing,
Expand Down Expand Up @@ -146,8 +146,8 @@ See also: [`get_time_series_multiple` from a `System`](@ref get_time_series_mult
))
"""
function get_time_series_multiple(
owner::TimeSeriesOwners,
filter_func = nothing;
owner::TimeSeriesOwners;
filter_func = nothing,
type = nothing,
name = nothing,
)
Expand Down Expand Up @@ -374,8 +374,8 @@ See also: [`get_time_series_values`](@ref get_time_series_values(owner::TimeSeri
"""
function get_time_series_array(
owner::TimeSeriesOwners,
time_series::StaticTimeSeries,
start_time::Union{Nothing, Dates.DateTime} = nothing;
time_series::StaticTimeSeries;
start_time::Union{Nothing, Dates.DateTime} = nothing,
len::Union{Nothing, Int} = nothing,
ignore_scaling_factors = false,
)
Expand Down Expand Up @@ -496,8 +496,8 @@ See also: [`get_time_series_array`](@ref get_time_series_array(
"""
function get_time_series_timestamps(
owner::TimeSeriesOwners,
forecast::Forecast,
start_time::Union{Nothing, Dates.DateTime} = nothing;
forecast::Forecast;
start_time::Union{Nothing, Dates.DateTime} = nothing,
len::Union{Nothing, Int} = nothing,
)
return TimeSeries.timestamp(
Expand Down Expand Up @@ -541,8 +541,8 @@ See also: [`get_time_series_array`](@ref get_time_series_array(
"""
function get_time_series_timestamps(
owner::TimeSeriesOwners,
time_series::StaticTimeSeries,
start_time::Union{Nothing, Dates.DateTime} = nothing;
time_series::StaticTimeSeries;
start_time::Union{Nothing, Dates.DateTime} = nothing,
len::Union{Nothing, Int} = nothing,
)
return TimeSeries.timestamp(
Expand Down Expand Up @@ -726,8 +726,8 @@ See also: [`get_time_series_array`](@ref get_time_series_array(
"""
function get_time_series_values(
owner::TimeSeriesOwners,
time_series::StaticTimeSeries,
start_time::Union{Nothing, Dates.DateTime} = nothing;
time_series::StaticTimeSeries;
start_time::Union{Nothing, Dates.DateTime} = nothing,
len::Union{Nothing, Int} = nothing,
ignore_scaling_factors = false,
)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ end
"""
function open_file_logger(
func::Function,
filename::String,
filename::String;
level = Logging.Info,
mode = "w+",
)
Expand Down
10 changes: 5 additions & 5 deletions src/utils/recorder_events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Return the events of type T in filename.
"""
function list_recorder_events(
::Type{T},
filename::AbstractString,
filename::AbstractString;
filter_func::Union{Nothing, Function} = nothing,
) where {T <: AbstractRecorderEvent}
events = Vector{T}()
Expand Down Expand Up @@ -214,8 +214,8 @@ show_recorder_events(TestEvent, test_recorder.log, x -> x.val2 > 2)
"""
function show_recorder_events(
::Type{T},
filename::AbstractString,
filter_func::Union{Nothing, Function} = nothing;
filename::AbstractString;
filter_func::Union{Nothing, Function} = nothing,
kwargs...,
) where {T <: AbstractRecorderEvent}
return show_recorder_events(stdout, T, filename, filter_func; kwargs...)
Expand All @@ -224,8 +224,8 @@ end
function show_recorder_events(
io::IO,
::Type{T},
filename::AbstractString,
filter_func::Union{Nothing, Function} = nothing;
filename::AbstractString;
filter_func::Union{Nothing, Function} = nothing,
kwargs...,
) where {T <: AbstractRecorderEvent}
events = list_recorder_events(T, filename, filter_func)
Expand Down
2 changes: 1 addition & 1 deletion test/InfrastructureSystemsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function run_tests(args...; kwargs...)
end
console_logger = TerminalLogger(config.console_stream, config.console_level)

IS.open_file_logger(config.filename, config.file_level) do file_logger
IS.open_file_logger(config.filename; level = config.file_level) do file_logger
levels = (Logging.Info, Logging.Warn, Logging.Error)
multi_logger =
IS.MultiLogger([console_logger, file_logger], IS.LogEventTracker(levels))
Expand Down

0 comments on commit 0462a5e

Please sign in to comment.