Custom Struct as outtype in OutDims?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with YAXArrays.DAT registration.jl at the OutDims constructors shown in the stack trace, then compare the successful foo example with MaximumLikelihoodAbstractExtremeValueModel. Reproduce both OutDims calls and inspect the conversion failure. Done means determining whether the custom model type can be accepted consistently as outtype and documenting or testing the resulting behavior.
Written by the indexing model from the issue text.
Description
Hello,
I am trying to do GEV estimation using mapCube, using the following logic. The objective is to get the timeseries for each gridpoints and return the GEV model associated with the timeserie, for each gridpoint, storing the following information into a YAXArray:
MaximumLikelihoodAbstractExtremeValueModel
model :
ThresholdExceedance
data : Vector{Float64}[28]
logscale : ϕ ~ 1
shape : ξ ~ 1
θ̂ : [2.0154230098844907, 0.09042541506171095]
Hence, when I try the following:
indims = InDims("Ti")
outdims = OutDims(outtype=MaximumLikelihoodAbstractExtremeValueModel)
I get the error:
ERROR: MethodError: Cannot `convert` an object of type
Type{MaximumLikelihoodAbstractExtremeValueModel} to an object of type
Union{Int64, DataType}
Closest candidates are:
convert(::Type{T}, ::T) where T
@ Base Base.jl:84
Stacktrace:
[1] OutDims(axisdesc::Tuple{}, backend::Symbol, backendargs::@Kwargs{}, update::Bool, artype::Type, chunksize::Symbol, outtype::Type)
@ YAXArrays.DAT ~/.julia/packages/YAXArrays/ppMtD/src/DAT/registration.jl:102
[2] OutDims(; backend::Symbol, update::Bool, artype::Type, chunksize::Symbol, outtype::Type, backendargs::@Kwargs{})
@ YAXArrays.DAT ~/.julia/packages/YAXArrays/ppMtD/src/DAT/registration.jl:134
[3] top-level scope
@ REPL[64]:1
It seems to be possible to assign a custom type to outtype, but I am unsure why it fails for MaximumLikelihoodAbstractExtremeValueModel:
struct foo
a
end
outdims = OutDims(outtype=foo)
OutDims((), :auto, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}(), false, Array, :input, foo)
Thanks for any intput!
- Dominant language
- Julia
- Stars
- 132
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaDataCubes/YAXArrays.jl
-
reexport `hasdim` Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
JuliaDataCubes/YAXArrays.jl#607 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaDataCubes/YAXArrays.jl#609 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
JuliaDataCubes/YAXArrays.jl#605 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
JuliaDataCubes/YAXArrays.jl#602 ·
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
JuliaDataCubes/YAXArrays.jl#599 · 2 comments ·
All issues in JuliaDataCubes/YAXArrays.jl
Similar issues
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Sienna-Platform/PowerSystems.jl#1800 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100