-
Notifications
You must be signed in to change notification settings - Fork 39
fix OpenStack calls #968
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
fix OpenStack calls #968
Conversation
| # Open a single file stack | ||
| function Base.open(f::Function, st::AbstractRasterStack{K,T,<:Any,<:FileStack{X}}; kw...) where {X,K,T} | ||
| ost = OpenStack{X,K,T}(parent(st)) | ||
| function Base.open(f::Function, st::AbstractRasterStack{K}; kw...) where K |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol! I didnt realize this was how it happens.
Can't we just define
Base.open(st::AbstractRasterStack{K}; kw...) = OpenStack(parent(st))
Base.close(st::AbstractRasterStack{K}; kw...) = somehow_flatten_and_invoke_on_openstack(close, st) # maybe replace with filearrayand that's lazy=:open?
It looks like the multifile implementation is recursive but we could figure that out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but that will be part of doing that properly everywhere?
(And not exactly, you need to wrap as a RasterStack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the easy stacks where it's one dataset, often it's not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And fwiw lazy=:open is confusing syntax, it has to be something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something else is fine, I don't even mind single-arg Base.open(ras) or Rasters.open(filename)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason not to only allow open(rast) is it needs a double open. It should work too but as an option for a lazy raster
Raster(fn; open=true) would open to get metadata and just stay open.
|
Probably test in stack.jl ? |
I just added it to gribdatasets.jl to not have to write another file. I've checked it errors on main. |
open(stack)seems to be broken on main.Needs test but not sure which files to use?