-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I try to run the example from nice documentation at https://juliaclimate.github.io/ClimateSatellite.jl/dev/tutorials/downloads.html:
julia> using ClimateSatellite, Dates
julia> clisatdownload("mptw2m",Date(2018,1))
[ Info: 2020-07-14T08:22:33.714 - No directory path was given. Setting to default path: /home/abarth/research/CliSat/mptw2m for ClimateSatellite data downloads.
┌ Warning: 2020-07-14T08:22:33.729 - The path /home/abarth/research/CliSat/mptw2m does not exist. A new directory will be created here. Therefore if you already have an existing repository for ClimateSatellite data, make sure that /home/abarth/research/CliSat/mptw2m is the correct location.
└ @ ClimateSatellite ~/.julia/dev/ClimateSatellite/src/frontend.jl:21
[ Info: 2020-07-14T08:22:33.732 - Creating path /home/abarth/research/CliSat/mptw2m ...
ERROR: BoundsError: attempt to access 0-element Array{Any,1} at index [1]
Stacktrace:
[1] getindex(::Array{Any,1}, ::Int64) at ./array.jl:788
[2] clisatinfo!(::Dict{Any,Any}, ::String) at /home/abarth/.julia/dev/ClimateSatellite/src/frontend.jl:82
[3] clisatdownload(::String, ::Date; email::String, path::String, regions::Array{String,1}, overwrite::Bool) at /home/abarth/.julia/dev/ClimateSatellite/src/raw.jl:27
[4] clisatdownload(::String, ::Date) at /home/abarth/.julia/dev/ClimateSatellite/src/raw.jl:22
[5] top-level scope at REPL[5]:1
[6] eval(::Module, ::Any) at ./boot.jl:331
[7] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
[8] run_backend(::REPL.REPLBackend) at /home/abarth/.julia/packages/Revise/AMRie/src/Revise.jl:1023
[9] top-level scope at none:0
Could it be that the id mptw2m should be spelled mtpw2m in the documentation ?
I am wondering if you considered julia types and dispatch to simplify code like here
https://github.com/JuliaClimate/ClimateSatellite.jl/blob/master/src/raw.jl#L29
Every dataset could be a type which implements a specific download function (common download function could be handled by abstract types).
dataset = CliSatSomeIdentifier(email = ..., ) # all parameter specific to the dataset
download(dataset,Date(2018,1),region) # only generic space/time query information Of course, this is just a suggestion. Thank you for this useful package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels