sisl icon indicating copy to clipboard operation
sisl copied to clipboard

Allow extra dimensions in grid

Open pfebrer opened this issue 3 years ago • 3 comments

I think it could be quite useful to facilitate the processing that grids allowed extra dimensions.

My thought arised from the need to have spin and E (energy) dimensions, but I think allowing arbitrary dimensions could be a good idea. To me it seems that xarray would give lots of functionality for free in this respect, but I guess wrapping a numpy array (the current approach) would also work.

Let me know what you think of it or if there are any reasons for this not to be implemented that I'm missing. Cheers!

pfebrer avatar May 25 '21 08:05 pfebrer

Yes, I have also stumbled upon this my self.

The current reason was that there were some cases where it was a bit difficult to make work along side with the supercell + geometry. Also, for spin and E arguments you'll probably find that the memory blows up extremely fast. In that sense the grid would be better of using some kind of lazy loading where stuff could be handled on-disk. I.e. Grid(["file1", "file2"]) and then data would be read as needed. It would be slow for some stuff, but make stuff way more manageable in other cases.

zerothi avatar May 28 '21 09:05 zerothi

Maybe it would be good to incorporate dask, which distributes arrays on processes (generalizes to clusters if needed) and does lazy computations, instead of implementing it ourselves. Dask already supports numpy, pandas and xarray, so it is just a matter of thinking how to integrate it with sisl's functionality.

pfebrer avatar Jun 01 '21 08:06 pfebrer

Agreed. Using dask is the way forward.

zerothi avatar Jun 01 '21 11:06 zerothi