Commit 572a528
Preserve attrs with coarsen (#4360)
* pass **kwargs into
_coarsen_reshape
* change _replace to copy in coarsen return
* copy back to replace, variable=copy
* take out self.copy
* update pre-commit config (tags not branches)
* add test that coarsen maintains OG object
* del comment
* check global for keep attrs
* black reformatter
* line break
* variable._attrs to variable.attrs
* if not keep_attrs
* {} to None
* set_options goes in a with block
* remove test dependency on netcdf
* add bug fix to whats-new.rst
* Update doc/whats-new.rst
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
* go back to v0.1.2 of blackdock
* add test_coarsen_keep_attrs to test_dataarray.py
* fix tests
* black test_dataarray
* xr.set_options
* move keep_attrs to coarsen from _reshape_coarsen
* flake8
* clean up
* move keep_attrs to fx signature
* remove kwarg check for keep_attrs
* black on variable.py
* fix test_variable
* Format with black
* fix test
* check for global attribute
* black variable.py
* black test_variable.py
* format w black
* Update xarray/core/variable.py
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
Co-authored-by: Maximilian Roos <m@maxroos.com>1 parent 66259d1 commit 572a528
File tree
7 files changed
+55
-8
lines changed- doc
- xarray
- core
- tests
7 files changed
+55
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
693 | | - | |
| 693 | + | |
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| 706 | + | |
706 | 707 | | |
707 | 708 | | |
708 | 709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1993 | 1993 | | |
1994 | 1994 | | |
1995 | 1995 | | |
1996 | | - | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
1997 | 1999 | | |
1998 | 2000 | | |
1999 | 2001 | | |
2000 | 2002 | | |
2001 | 2003 | | |
2002 | 2004 | | |
2003 | 2005 | | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
2004 | 2014 | | |
2005 | 2015 | | |
2006 | 2016 | | |
2007 | 2017 | | |
2008 | 2018 | | |
2009 | 2019 | | |
2010 | | - | |
| 2020 | + | |
| 2021 | + | |
2011 | 2022 | | |
2012 | 2023 | | |
2013 | 2024 | | |
| |||
2072 | 2083 | | |
2073 | 2084 | | |
2074 | 2085 | | |
2075 | | - | |
2076 | | - | |
2077 | | - | |
2078 | 2086 | | |
2079 | 2087 | | |
2080 | 2088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6186 | 6186 | | |
6187 | 6187 | | |
6188 | 6188 | | |
| 6189 | + | |
| 6190 | + | |
| 6191 | + | |
| 6192 | + | |
| 6193 | + | |
| 6194 | + | |
| 6195 | + | |
| 6196 | + | |
| 6197 | + | |
| 6198 | + | |
| 6199 | + | |
| 6200 | + | |
| 6201 | + | |
| 6202 | + | |
| 6203 | + | |
| 6204 | + | |
| 6205 | + | |
| 6206 | + | |
| 6207 | + | |
| 6208 | + | |
| 6209 | + | |
| 6210 | + | |
| 6211 | + | |
| 6212 | + | |
| 6213 | + | |
| 6214 | + | |
| 6215 | + | |
| 6216 | + | |
| 6217 | + | |
6189 | 6218 | | |
6190 | 6219 | | |
6191 | 6220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5956 | 5956 | | |
5957 | 5957 | | |
5958 | 5958 | | |
| 5959 | + | |
| 5960 | + | |
5959 | 5961 | | |
5960 | 5962 | | |
5961 | 5963 | | |
| |||
5969 | 5971 | | |
5970 | 5972 | | |
5971 | 5973 | | |
| 5974 | + | |
| 5975 | + | |
| 5976 | + | |
5972 | 5977 | | |
5973 | 5978 | | |
5974 | 5979 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1949 | 1949 | | |
1950 | 1950 | | |
1951 | 1951 | | |
1952 | | - | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
1953 | 1956 | | |
1954 | 1957 | | |
1955 | 1958 | | |
| |||
0 commit comments