clouddrift icon indicating copy to clipboard operation
clouddrift copied to clipboard

🔎 Simplify RaggedArray API

Open philippemiron opened this issue 7 months ago • 0 comments

Currently, the RaggedArray object can be created with:

class RaggedArray:
    def __init__(
        self,
        coords: dict,
        metadata: dict,
        data: dict,
        attrs_global: dict | None = {},
        attrs_variables: dict | None = {},
        name_dims: dict[str, DimNames] = {},
        coord_dims: dict[str, str] = {},
    ):

We could simplify the required arguments by implementing:

  • add a default value for name_dims = {"rows": "rows", "obs": "obs"}
  • coord_dims: could this be replaced by a function? The coordinates can either be the size of the rows or the obs so they could be assigned automatically.

philippemiron avatar Jun 25 '24 15:06 philippemiron