Skip to content

Too narrow types; regridding functions can also take xr.DataArray types as argument #64

Open

Description

@jensdebruijn

Hello!

I noticed that all of the regridding functions only take xr.DataSet as a type argument, but can also receive a xr.DataArray.

xr.DataSet

->

xr.DataArray | xr.DataSet

One example is here, but it is the case for all of the regridders;

ds_target_grid: xr.Dataset,

Activity

  1. BSchilperoort commented on Jan 28, 2026

    @BSchilperoort
    Contributor

    Thanks for reporting this! I think target grid can indeed be a DataArray, however I should test it properly before modifying this.

    The reason I typed it as xr.Dataset, is because a dataset can have coordinates and dimensions, without having any variables associated with it. That's why Grid.create_regridding_dataset returns a dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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