iris icon indicating copy to clipboard operation
iris copied to clipboard

Make lazy data the default

Open HGWright opened this issue 4 months ago • 1 comments

📰 Custom Issue

Lazy data should be the default behaviour, accessing it should be a property and realising data should be a method. (Currently there are the other way around.)

Currently you have to run cube.core_data() every time you want lazy data is unnecessary, and is not inline with how dask works.

cube.data currently realises the data but should return lazy data, and something like cube.real_data() should realise the data.

HGWright avatar Jul 30 '25 21:07 HGWright

I like this idea! Under the current behaviour it's quite easy to "accidentally" realise the data. It's also a permanent action, unlike the behaviour in dask. Calling cube.data alters the state of the cube (which is surprising, since it's an attribute/property not a method), whereas in dask, calling array.compute() returns the realised data, it doesn't change the state of array

jrackham-mo avatar Aug 07 '25 11:08 jrackham-mo