home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1185232773

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1185232773 I_kwDOAMm_X85GpTeF 6425 Expose `coord_mode` in `.pad()` 14314623 open 0     1 2022-03-29T18:06:35Z 2022-03-30T09:19:05Z   CONTRIBUTOR      

Is your feature request related to a problem?

I am experiencing some issues with the way coordinates are padded. Currently the coordinates are padded according to the mode parameter passed to pad() here. For my particular issue I want to be able to have different modes for the data, but effectively pin the mode that is used to pad the coordinate values.

A simple example: ```python import xarray as xr import numpy as np

da = xr.DataArray([1,2,3], dims=['x'], coords={'x':[4,5,6]}) da ```

If I pad with constant python da.pad(x=(0,1), mode='constant') I get this: which is the coordinate padding I need.

But if I pad with wrap: python da.pad(x=(0,1), mode='wrap') which gives me repeated coordinate values

Describe the solution you'd like

I would like to be able to do something like this:

python da.pad(x=(0,1), mode='wrap', coord_pad_mode='constant') and get something like this

Since #3596 internally already defines coord_pad_mode it should be easy enough to expose this to the user?

Possibly related (but I think not incompatible with the changes propsed here?): #3868

Happy to work with @TomNicholas on a PR, but wanted to get some feedback/comments first.

cc @dcherian @mark-boer who worked on this code.

Describe alternatives you've considered

No response

Additional context

No response

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6425/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.62ms · About: xarray-datasette