YAXArrays.jl icon indicating copy to clipboard operation
YAXArrays.jl copied to clipboard

Loading data in memory vs out of memory: indication in show + conversion + option when opening dataset

Open briochemc opened this issue 1 year ago • 4 comments

I'm not sure if this had not been asked before or if I should ask elsewhere, but since I was using YAXArrays I thought I should ask here. Maybe this is already doable and I just don't know how. Anyway, here is a triple feature request:

  • [ ] It would be nice if the (very nice) show method also showed whether the parent data has been loaded in memory or not. Maybe a "(loaded lazily)/(loaded in memory)" or similar wording?

  • [ ] It would also be nice if the docs showed how to load the data in memory from a lazily loaded variable var. My understanding is that I should use modify(Array, var).

  • [ ] It may be worth having an option to load data in memory when "opening" a dataset, e.g., maybe with the syntax ds = open_dataset(...; in_memory = true), it would force the data to be loaded in memory? (With default in_memory = false I guess?)

briochemc avatar Oct 04 '24 06:10 briochemc

hey,

  1. loaded lazily)/(loaded in memory). I guess we could do that.
  2. see readcubedata. Better docs are needed for that one.
  3. maybe just combine with 2?

lazarusA avatar Oct 04 '24 06:10 lazarusA

Rasters uses Base.read and DD forwards it on to the parent (have to check that). Maybe YAX could add that too?

rafaqz avatar Oct 04 '24 07:10 rafaqz

Yeah, don't know. open and save -> open_dataset, savecube and save_dataset, need some unification work.

lazarusA avatar Oct 04 '24 09:10 lazarusA

Another one would be to be able to read en entire YAXArray Dataset in memory. Is it possible to do so at this stage or does one need to readdatacube for all vars separately?

briochemc avatar Oct 04 '24 10:10 briochemc

I implemented readcubedata for Datasets in #453 and I also added a hint to the data loading in the show method. This should solve this issue.

felixcremer avatar Oct 17 '24 11:10 felixcremer

close by https://github.com/JuliaDataCubes/YAXArrays.jl/pull/453 , https://github.com/JuliaDataCubes/YAXArrays.jl/pull/457

lazarusA avatar Oct 23 '24 09:10 lazarusA