File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ Bug Fixes
3939 By `Ian Hunt-Isaak <https://github.com/ianhi >`_
4040- Coerce masked dask arrays to filled (:issue: `9374 ` :pull: `11157 `).
4141 By `Julia Signell <https://github.com/jsignell >`_
42+ - Expose ``coord_pad_mode `` and associated parameters in ``Dataset.pad `` and
43+ ``DataArray.pad `` (:issue: `3868 ` :issue: `6425 ` :pull: `11213 `). By `Ian Cooke
44+ <https://github.com/ircwaves> `_.
4245
4346Documentation
4447~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -5998,6 +5998,23 @@ def pad(
59985998 * x (x) float64 32B nan 0.0 1.0 nan
59995999 z (x) float64 32B nan 100.0 200.0 nan
60006000 * y (y) int64 32B 10 20 30 40
6001+
6002+ Note that the default behavior of coordinate padding uses NaNs (or NaTs), which
6003+ requires that integer types be promoted to floats. Providing values via
6004+ ``coord_constant_values`` then follows the coercion behavior mentioned above,
6005+ where array types are preserved:
6006+
6007+ >>> da.pad(x=1, constant_values=1.23456789, coord_constant_values=-999.9)
6008+ <xarray.DataArray (x: 4, y: 4)> Size: 128B
6009+ array([[ 1, 1, 1, 1],
6010+ [ 0, 1, 2, 3],
6011+ [10, 11, 12, 13],
6012+ [ 1, 1, 1, 1]])
6013+ Coordinates:
6014+ * x (x) int64 32B -999 0 1 -999
6015+ z (x) int64 32B -999 100 200 -999
6016+ * y (y) int64 32B 10 20 30 40
6017+
60016018 """
60026019 ds = self ._to_temp_dataset ().pad (
60036020 pad_width = pad_width ,
You can’t perform that action at this time.
0 commit comments