Skip to content

Avoid full slices #69

@ocefpaf

Description

@ocefpaf

pysgrid code perform full data slices in some places like:

https://github.com/sgrid/pysgrid/blob/master/pysgrid/sgrid.py#L497-L532

That can be memory expensive and/or slow when the data origin in remote.

Options:

  1. Pass along the netCDF4-python variable instead of the slice. Maybe with little to no modification all the 2D processing will just work.
  2. Make them a lazy array using either dask or biggus.

Option 2 adds a dependency and the smart thing to do would be to implement 1 having 2 as an optional behavior when the dependency is available. The advantages of 2 over 1 are: (a) to be able to load data that is bigger than memory; (b) avoid worrying about index logic when performing lazy computations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions