Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic JuliaFormatter.jl run #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/SpectralIndicesDataFramesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function create_params(kw_args::Pair{Symbol,DataFrame}...)
end

function compute_index(
index::AbstractSpectralIndex, params::DataFrame; indices = create_indices()
index::AbstractSpectralIndex, params::DataFrame; indices=create_indices()
)
# Convert DataFrame to a dictionary for each row and compute the index
results = [
Expand All @@ -38,7 +38,7 @@ function compute_index(
end

function compute_index(
index::Vector{<:AbstractSpectralIndex}, params::DataFrame; indices = create_indices()
index::Vector{<:AbstractSpectralIndex}, params::DataFrame; indices=create_indices()
)
# Similar conversion and computation for a vector of indices
result_dfs = DataFrame()
Expand Down
4 changes: 2 additions & 2 deletions ext/SpectralIndicesYAXArraysExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end
## TODO: simplify even further
# this is same function contente as dispatch on Dict
function compute_index(
index::AbstractSpectralIndex, params::YAXArray; indices = create_indices()
index::AbstractSpectralIndex, params::YAXArray; indices=create_indices()
)
check_params(index, params)
params = order_params(index, params)
Expand All @@ -62,7 +62,7 @@ function compute_index(
end

function compute_index(
index::Vector{<:AbstractSpectralIndex}, params::YAXArray; indices = create_indices()
index::Vector{<:AbstractSpectralIndex}, params::YAXArray; indices=create_indices()
)
results = []
for (nidx, idx) in enumerate(index)
Expand Down
19 changes: 12 additions & 7 deletions src/SpectralIndices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ indices = create_indices()
bands = create_bands()
constants = create_constants()

@compat(public, (create_indices,
create_bands,
create_constants,
load_json,
check_params,
create_params,
order_params))
@compat(
public,
(
create_indices,
create_bands,
create_constants,
load_json,
check_params,
create_params,
order_params,
)
)

export get_indices, create_indexfun
export get_datasets, load_dataset
Expand Down
16 changes: 8 additions & 8 deletions src/compute_index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ julia> compute_index(
"""
function compute_index(
index::AbstractSpectralIndex,
params = nothing,
online::Bool = false;
indices = indices,
params=nothing,
online::Bool=false;
indices=indices,
kwargs...,
)
if isnothing(params)
Expand All @@ -68,7 +68,7 @@ function compute_index(
end

function compute_index(
index::String, params = nothing, online::Bool = false; indices=indices, kwargs...
index::String, params=nothing, online::Bool=false; indices=indices, kwargs...
)
names = keys(indices)
@assert index in names "$index is not a valid Spectral Index!"
Expand All @@ -92,9 +92,9 @@ end

function compute_index(
index::Vector{String},
params = nothing,
online::Bool = false;
indices = create_indices(online),
params=nothing,
online::Bool=false;
indices=create_indices(online),
kwargs...,
)
names = keys(indices)
Expand All @@ -106,7 +106,7 @@ function compute_index(
return results
end

function compute_index(index::AbstractSpectralIndex, params::Dict; indices = indices)
function compute_index(index::AbstractSpectralIndex, params::Dict; indices=indices)
check_params(index, params)
params = order_params(index, params)
T = eltype(first(values(params)))
Expand Down
4 changes: 2 additions & 2 deletions src/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ get_datasets(; datasets=["custom_dataset.json"], data_loc="path/to/custom/direct
This is particularly useful for setting up local environments with necessary data files for further processing or analysis.
"""
function get_datasets(;
datasets = ["S2_10m.json", "spectral.json"],
data_loc = joinpath(dirname(@__FILE__), "..", "data"),
datasets=["S2_10m.json", "spectral.json"],
data_loc=joinpath(dirname(@__FILE__), "..", "data"),
)
for ds in datasets
file_dest = joinpath(data_loc, ds)
Expand Down
Loading