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

Input types #8

Open
3 of 12 tasks
MartinuzziFrancesco opened this issue Dec 14, 2023 · 2 comments
Open
3 of 12 tasks

Input types #8

MartinuzziFrancesco opened this issue Dec 14, 2023 · 2 comments

Comments

@MartinuzziFrancesco
Copy link
Member

MartinuzziFrancesco commented Dec 14, 2023

Living collection of input types that would be nice to include in SpectralIndices.jl

If you would like to see any other type of array represented here please comment on this issue

List of methods and additions to make to the package for each new data type:

  • Dispatch on _check_params(index, params::NewType)
  • Dispatch on _order_params(index, params::NewType)
  • Dispatch on _create_params(kw_args::Pair{Symbol,<:NewType}...)
  • Dispatch on compute_index(index::String, params::NewType)
  • Dispatch on compute_index(index::Vector{String}, params::NewType)
  • Dispatch on _compute_index(idx::AbstractSpectralIndex, prms::NewType...)
  • Dispatch on linear(params::NewType)
  • Dispatch on poly(params::NewType)
  • Dispatch on RBF(params::NewType)
  • (optional) Dispatch on `load_dataset(dataset::String, ::Type{T}) where {T<:NewType}'
  • Add documentation under "Tutorials" with NewTypes.jl title and through examples for all the new methods
  • Add testing:
    • Create a folder in test with the name of the package containing NewType
    • Add compute_index.jl test file
    • Add compute_kernel.jl test file
    • Add datasets.jl test file
    • Include test files in runtest.jl
@gdkrmr
Copy link

gdkrmr commented Feb 8, 2024

  • The tables interface would go a long way, I think!
  • Named Tuples. They could maybe be a performance gain over Dicts because they don't require allocations, maybe they even work out of the box, because you can just splat them as named arguments:
julia> f(;x = 1, y = 2) = x + y
f (generic function with 1 method)

julia> f(;(x = 1, y = 2)...)
6

@MartinuzziFrancesco
Copy link
Member Author

MartinuzziFrancesco commented Feb 8, 2024

thanks, I've updated the comment! I'll do some tests with namedtuples, they should just work as you said, but they also need to work as argument input so maybe that'll require a dispatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants