Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare release 0.7.0 #58

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Change Log

## v0.x.x (Unreleased)
## v0.7.0 (2024 Jan 17)
### New features
* Add support for hashable dimension names {pull}`56`

### Maintenance and fixes

### Documentation
* Fix tests to be compatible with latest xarray {pull}`56`
* Address numpy deprecation warnings {pull}`56`

## v0.6.0 (2023 Jul 11)
### New features
Expand Down
33 changes: 17 additions & 16 deletions docs/source/tutorials/einops-basics-port.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"import numpy\n",
"import xarray\n",
"from xarray_einstats.tutorial import display_np_arrays_as_images\n",
"\n",
"display_np_arrays_as_images()"
]
},
Expand Down Expand Up @@ -458,7 +459,7 @@
"Dimensions: (batch: 6, height: 96, width: 96, channel: 3)\n",
"Dimensions without coordinates: batch, height, width, channel\n",
"Data variables:\n",
" ims (batch, height, width, channel) float64 1.0 0.902 ... 1.0 0.8039</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-8de6a043-1928-4cf9-a4d5-894879c86774' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-8de6a043-1928-4cf9-a4d5-894879c86774' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>batch</span>: 6</li><li><span>height</span>: 96</li><li><span>width</span>: 96</li><li><span>channel</span>: 3</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-99aa168b-0b3b-4d70-b1bf-a4891539b69c' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-99aa168b-0b3b-4d70-b1bf-a4891539b69c' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-60c18481-ec75-4cfb-8df4-737da742d80b' class='xr-section-summary-in' type='checkbox' checked><label for='section-60c18481-ec75-4cfb-8df4-737da742d80b' class='xr-section-summary' >Data variables: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>ims</span></div><div class='xr-var-dims'>(batch, height, width, channel)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.0 0.902 0.902 ... 1.0 1.0 0.8039</div><input id='attrs-ae4a001f-7c76-482b-96fd-95013ac91a30' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ae4a001f-7c76-482b-96fd-95013ac91a30' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7e9c039e-c178-4da6-b7c8-386ffcd06719' class='xr-var-data-in' type='checkbox'><label for='data-7e9c039e-c178-4da6-b7c8-386ffcd06719' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[[1. , 0.90196078, 0.90196078],\n",
" ims (batch, height, width, channel) float64 1.0 0.902 ... 1.0 0.8039</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-3eec4040-5856-441f-a836-5e03835a0b88' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3eec4040-5856-441f-a836-5e03835a0b88' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>batch</span>: 6</li><li><span>height</span>: 96</li><li><span>width</span>: 96</li><li><span>channel</span>: 3</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-9c5bf0d5-07dc-410d-bccd-6bfff020901b' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-9c5bf0d5-07dc-410d-bccd-6bfff020901b' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-acd7bcef-aff7-4348-9b27-01a4199bfc36' class='xr-section-summary-in' type='checkbox' checked><label for='section-acd7bcef-aff7-4348-9b27-01a4199bfc36' class='xr-section-summary' >Data variables: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>ims</span></div><div class='xr-var-dims'>(batch, height, width, channel)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.0 0.902 0.902 ... 1.0 1.0 0.8039</div><input id='attrs-f0841d19-41a9-4c43-8827-96261613a4f8' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-f0841d19-41a9-4c43-8827-96261613a4f8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f3e88cda-9cfd-4a98-9234-0151154149e7' class='xr-var-data-in' type='checkbox'><label for='data-f3e88cda-9cfd-4a98-9234-0151154149e7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[[1. , 0.90196078, 0.90196078],\n",
" [1. , 0.90196078, 0.90196078],\n",
" [1. , 0.90196078, 0.90196078],\n",
" ...,\n",
Expand Down Expand Up @@ -498,7 +499,7 @@
" ...,\n",
" [1. , 1. , 0.80392157],\n",
" [1. , 1. , 0.80392157],\n",
" [1. , 1. , 0.80392157]]]])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-59440460-0a4c-49d3-9193-d30ca0db0447' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-59440460-0a4c-49d3-9193-d30ca0db0447' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-448a0721-bca8-463c-9b20-dcdd0e3c44d9' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-448a0721-bca8-463c-9b20-dcdd0e3c44d9' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
" [1. , 1. , 0.80392157]]]])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f0211063-41d1-4cdb-83e8-d05358d2138e' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-f0211063-41d1-4cdb-83e8-d05358d2138e' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-dea59cb1-db8d-4a0e-9112-3183be97db31' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-dea59cb1-db8d-4a0e-9112-3183be97db31' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
Expand Down Expand Up @@ -1141,9 +1142,9 @@
}
],
"source": [
"# the previous is identical to familiar:\n",
"ims.values.mean(axis=0)\n",
"# but is so much more readable"
"# the previous is identical to:\n",
"ims.mean(dim=\"batch\") # as xarray operation\n",
"ims.values.mean(axis=0) # as numpy operation"
]
},
{
Expand Down Expand Up @@ -1619,7 +1620,6 @@
],
"source": [
"# subtract background in each image individually and normalize\n",
"# pay attention to () - this is composition of 0 axis, a dummy axis with 1 element.\n",
"im2 = reduce(ims, 'batch channel', 'max') - ims\n",
"im2 /= reduce(im2, 'batch channel', 'max')\n",
"rearrange(im2, '(batch width) channel').values"
Expand Down Expand Up @@ -1702,17 +1702,18 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: Tue Jul 11 2023\n",
"Last updated: Wed Jan 17 2024\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.10.12\n",
"IPython version : 8.14.0\n",
"Python version : 3.11.7\n",
"IPython version : 8.18.1\n",
"\n",
"einops : 0.6.1\n",
"xarray_einstats: 0.6.0\n",
"einops : 0.7.0\n",
"xarray_einstats: 0.7.0\n",
"\n",
"numpy : 1.24.4\n",
"xarray: 2023.6.0\n",
"sys : 3.11.7 | packaged by conda-forge | (main, Dec 15 2023, 08:38:37) [GCC 12.3.0]\n",
"numpy : 1.26.2\n",
"xarray: 2023.12.0\n",
"\n",
"Watermark: 2.4.3\n",
"\n"
Expand All @@ -1734,9 +1735,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "ArviZ (minimal env)",
"language": "python",
"name": "python3"
"name": "arviz"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1748,7 +1749,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
Loading