diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cd6d638..d34d2c4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,7 @@ name: Publish library +permissions: {} + on: push: branches: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index def12e0..1d86950 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,7 @@ name: Run tests + +permissions: {} + on: pull_request: push: @@ -11,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11", "3.12", "3.13"] + python-version: ["3.12", "3.13", "3.14"] fail-fast: false steps: - uses: actions/checkout@v6 diff --git a/docs/source/changelog.md b/docs/source/changelog.md index c351480..a363a1d 100644 --- a/docs/source/changelog.md +++ b/docs/source/changelog.md @@ -1,11 +1,9 @@ # Change Log -## v0.x.x (Unreleased) -### New features - +## v0.10.0 (2025 Feb 19) ### Maintenance and fixes - -### Documentation +* Remove leftover print in `pinv` {pull}`87` +* Update minimum dependency versions {pull}`88` ## v0.9.1 (2025 June 18) ### Maintenance and fixes diff --git a/docs/source/index.md b/docs/source/index.md index 6e65742..f3a1b46 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -97,13 +97,19 @@ Get started with xarray-einstats ::: ## Similar projects -Here we list some similar projects we know of. Note that all of -them are complementary and don't overlap: +Here we list some similar projects we know of that aim to extend and complement xarray +in specific computations. Note that all of them are complementary and don't overlap: + * [xr-scipy](https://xr-scipy.readthedocs.io/en/latest/index.html) * [xarray-extras](https://xarray-extras.readthedocs.io/en/latest/) * [xhistogram](https://xhistogram.readthedocs.io/en/latest/) * [xrft](https://xrft.readthedocs.io/en/latest/) +There is also a much more comprehensive list of xarray related projects [on xarray's docs](https://docs.xarray.dev/en/stable/user-guide/ecosystem.html). + +In addition, there is an [xtensor module](https://pytensor.readthedocs.io/en/latest/library/xtensor/index.html) in PyTensor, +a library for tensor/array operations with symbolic computation elements, with similar dimension based syntax. + ## Cite xarray-einstats If you use this software, please cite it using the following template and the version specific DOI provided by Zenodo. Click on the badge to go to the Zenodo page diff --git a/docs/source/tutorials/einops-basics-port.ipynb b/docs/source/tutorials/einops-basics-port.ipynb index 9f3562f..5424e55 100644 --- a/docs/source/tutorials/einops-basics-port.ipynb +++ b/docs/source/tutorials/einops-basics-port.ipynb @@ -107,39 +107,86 @@ "\n", "\n", "\n", - "
<xarray.Dataset> Size: 1MB\n",
"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 1MB 1.0 0.902 ... 0.8039"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4, dim2: 4)> Size: 4kB\n",
"0.7075 1.025 0.5685 0.8951 0.2065 3.384 ... 1.239 0.4527 0.5749 0.4766 0.859\n",
- "Dimensions without coordinates: batch, experiment, dim, dim2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3)> Size: 240B\n",
"4.854 4.74 4.457 2.637 2.79 3.163 1.998 ... 2.804 4.58 2.888 4.936 5.983 4.07\n",
- "Dimensions without coordinates: batch, experiment"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4, dim2: 4)> Size: 4kB\n",
"11.26 -2.363 -10.84 -0.2744 10.99 -2.017 ... -3.444 0.7703 0.316 0.01949 -1.162\n",
- "Dimensions without coordinates: batch, experiment, dim, dim2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4, dim2: 4)> Size: 4kB\n",
"-0.5452 0.01652 -0.5624 -0.6214 -0.1592 ... -0.3322 -0.4013 0.2607 0.8128\n",
- "Dimensions without coordinates: batch, experiment, dim, dim2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4, dim2: 4)> Size: 4kB\n",
"-1.298 -1.975 -1.858 -1.228 0.0 -3.137 ... -0.4307 1.052 0.0 0.0 0.0 -0.6995\n",
- "Dimensions without coordinates: batch, experiment, dim, dim2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4, dim2: 4)> Size: 4kB\n",
"1.845 5.326 2.407 3.89 3.378 14.68 5.449 ... 5.586 6.55 1.279 1.373 1.791 2.658\n",
- "Dimensions without coordinates: batch, experiment, dim, dim2"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2_bis: 4, batch_bis: 10, batch: 10, dim2: 4)> Size: 51kB\n",
"10.79 3.926 1.503 3.986 0.1886 0.1844 ... 1.289 4.187 5.251 3.372 2.81 13.1\n",
- "Dimensions without coordinates: dim, dim2_bis, batch_bis, batch, dim2"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2: 4, batch: 10, batch2: 10)> Size: 13kB\n",
"10.79 0.1886 5.402 1.471 1.243 5.348 2.639 ... 3.462 3.618 11.21 9.47 4.187 13.1\n",
- "Dimensions without coordinates: dim, dim2, batch, batch2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, different_dim: 4, different_dim2: 4)> Size: 4kB\n",
"0.7075 1.025 0.5685 0.8951 0.2065 3.384 ... 1.239 0.4527 0.5749 0.4766 0.859\n",
- "Dimensions without coordinates: batch, experiment, different_dim, different_dim2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4, different_dim2: 4)> Size: 4kB\n",
"1.845 5.326 2.407 3.89 3.378 14.68 5.449 ... 5.586 6.55 1.279 1.373 1.791 2.658\n",
- "Dimensions without coordinates: batch, experiment, dim, different_dim2"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2: 4, experiment: 3, experiment2: 3)> Size: 1kB\n",
"9.727 6.68 3.595 6.68 18.66 6.065 3.595 ... 10.81 36.08 8.181 3.233 8.181 14.77\n",
- "Dimensions without coordinates: dim, dim2, experiment, experiment2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, dim: 4, dim2: 4)> Size: 1kB\n",
"4.487 3.158 0.9252 2.683 0.5319 3.799 ... 3.387 1.796 2.601 2.455 1.538 5.402\n",
- "Dimensions without coordinates: batch, dim, dim2"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2: 4)> Size: 128B\n",
"22.27 32.55 29.06 40.96 23.96 33.48 ... 25.27 29.59 34.97 20.57 34.89 30.26\n",
- "Dimensions without coordinates: dim, dim2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, dim: 4, dim2: 4)> Size: 1kB\n",
"10.79 3.543 0.4447 2.399 0.111 11.58 10.95 ... 5.104 1.799 2.513 3.052 0.79 13.1\n",
- "Dimensions without coordinates: batch, dim, dim2"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2: 4, batch: 10, experiment: 3)> Size: 4kB\n",
"33.15 44.26 22.52 1.318 1.76 0.8951 ... 19.52 36.93 18.42 42.62 80.64 40.23\n",
- "Dimensions without coordinates: dim, dim2, batch, experiment"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2: 4)> Size: 128B\n",
"496.0 1.06e+03 844.2 1.678e+03 573.9 ... 875.4 1.223e+03 423.1 1.218e+03 915.8\n",
- "Dimensions without coordinates: dim, dim2"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2: 4)> Size: 128B\n",
"32.03 68.57 42.6 101.0 40.06 76.88 59.44 ... 33.78 83.88 72.41 32.43 76.33 60.63\n",
- "Dimensions without coordinates: dim, dim2"
],
"text/plain": [
"<xarray.DataArray (dim: 4, dim2: 4)> Size: 128B\n",
"32.03 68.57 42.6 101.0 40.06 76.88 59.44 ... 33.78 83.88 72.41 32.43 76.33 60.63\n",
- "Dimensions without coordinates: dim, dim2"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4)> Size: 960B\n",
"2.676 19.38 0.8116 5.562 11.33 2.104 ... 6.259 12.24 6.737 0.5945 7.355 1.5\n",
- "Dimensions without coordinates: batch, experiment, dim"
],
"text/plain": [
"<xarray.DataArray (batch: 10, experiment: 3, dim: 4, dim_auto2: 4)> Size: 4kB\n",
"2.676 6.135 1.302 3.007 6.135 19.38 2.018 ... 7.355 2.884 2.942 0.8866 2.884 1.5\n",
- "Dimensions without coordinates: batch, experiment, dim, dim_auto2"
],
"text/plain": [
"<xarray.DataArray (experiment: 3, dim: 4, dim2: 4, batch: 10, batch2: 10)> Size: 38kB\n",
"0.5006 0.09001 0.1315 0.3874 0.5949 0.6645 ... 2.931 0.2908 0.5802 0.4342 0.7379\n",
- "Dimensions without coordinates: experiment, dim, dim2, batch, batch2"
],
"text/plain": [
"<xarray.DataArray (height: 768, width: 1024, color: 3)> Size: 2MB\n",
"121 112 131 138 129 148 153 144 165 155 ... 98 120 156 95 119 155 93 118 154 92\n",
"Coordinates:\n",
" * color (color) <U1 12B 'R' 'G' 'B'\n",
- "Dimensions without coordinates: height, widtharray(['R', 'G', 'B'], dtype='<U1')
<xarray.DataArray (height: 768, width: 1024)> Size: 786kB\n",
"121 138 153 155 155 158 159 156 147 137 ... 113 116 117 120 121 121 120 119 118\n",
"Coordinates:\n",
" color <U1 4B 'R'\n",
- "Dimensions without coordinates: height, widtharray('R', dtype='<U1')<xarray.DataArray (height: 768, width: 1024)> Size: 6MB\n",
"0.4521 0.5188 0.5782 0.586 0.586 0.5955 ... 0.5667 0.5662 0.5645 0.5603 0.5564\n",
- "Dimensions without coordinates: height, width"
],
"text/plain": [
"<xarray.DataArray (height: 768, height2: 768)> Size: 5MB\n",
"0.03181 0.01899 0.01773 0.00738 0.01887 ... 0.03089 0.005258 0.0146 0.004079\n",
- "Dimensions without coordinates: height, height2"
],
"text/plain": [
"<xarray.DataArray (height: 768)> Size: 6kB\n",
"410.4 85.56 63.61 45.85 41.97 38.26 ... 0.01117 0.01085 0.01079 0.01032 0.009925\n",
- "Dimensions without coordinates: height"
],
"text/plain": [
"<xarray.DataArray (width: 1024, width2: 1024)> Size: 8MB\n",
"0.03587 0.03582 0.03581 0.03574 0.03553 ... 0.03706 0.0731 -0.2073 0.1374\n",
- "Dimensions without coordinates: width, width2"
],
"text/plain": [
"<xarray.DataArray (height: 768, width: 1024)> Size: 6MB\n",
"410.4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
- "Dimensions without coordinates: height, width"
],
"text/plain": [
"<xarray.DataArray ()> Size: 8B\n", - "1.43e-12" + "1.386e-12" ], "text/plain": [ "
<xarray.DataArray (height: 768, width: 10)> Size: 61kB\n",
"410.4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
- "Dimensions without coordinates: height, width"
],
"text/plain": [
"<xarray.DataArray (width: 10, width2: 1024)> Size: 82kB\n",
"0.03587 0.03582 0.03581 0.03574 0.03553 ... -0.07889 -0.07779 -0.07644 -0.07542\n",
- "Dimensions without coordinates: width, width2"
],
"text/plain": [
"<xarray.DataArray (color: 3, height: 768, width: 1024)> Size: 19MB\n",
"0.4745 0.5412 0.6 0.6078 0.6078 0.6196 ... 0.3922 0.3843 0.3725 0.3647 0.3608\n",
"Coordinates:\n",
" * color (color) <U1 12B 'R' 'G' 'B'\n",
- "Dimensions without coordinates: height, widtharray(['R', 'G', 'B'], dtype='<U1')
<xarray.DataArray (color: 3, height: 768, width: 1024)> Size: 19MB\n",
"0.4745 0.4822 0.4893 0.492 0.4967 0.5061 ... 0.2838 0.2866 0.2899 0.2925 0.2938\n",
"Coordinates:\n",
" * color (color) <U1 12B 'R' 'G' 'B'\n",
- "Dimensions without coordinates: height, widtharray(['R', 'G', 'B'], dtype='<U1')
<xarray.Dataset> Size: 6kB\n",
"Dimensions: (plot_dim: 20, chain: 4, draw: 10, team: 6, match: 12)\n",
"Coordinates:\n",
- " * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'\n",
" * chain (chain) int64 32B 0 1 2 3\n",
" * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
+ " * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'\n",
"Dimensions without coordinates: plot_dim, match\n",
"Data variables:\n",
" x_plot (plot_dim) float64 160B 0.0 0.5263 1.053 1.579 ... 8.947 9.474 10.0\n",
" mu (chain, draw, team) float64 2kB 0.2296 0.5383 ... 0.4452 2.004\n",
" sigma (chain, draw) float64 320B 0.3703 0.00899 0.1398 ... 0.2246 0.2875\n",
- " score (chain, draw, match) int64 4kB 1 0 0 1 4 1 1 0 ... 0 0 2 1 2 1 0 2"
],
"text/plain": [
"<xarray.DataArray (rv_dim0: 100, chain: 4, draw: 10, team: 6)> Size: 192kB\n",
- "-0.1369 0.312 1.122 0.296 -0.3041 2.919 ... 0.2673 0.07624 0.02325 0.3478 2.179\n",
+ "-0.2056 0.492 1.427 0.215 0.3821 3.649 ... 0.4924 -0.1149 0.1473 0.4786 1.957\n",
"Coordinates:\n",
- " * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'\n",
" * chain (chain) int64 32B 0 1 2 3\n",
" * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
- "Dimensions without coordinates: rv_dim0array([0, 1, 2, 3])
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array(['a', 'b', 'c', 'd', 'e', 'f'], dtype='<U1')
<xarray.DataArray (subject: 5, batch: 3, chain: 4, draw: 10, team: 6)> Size: 29kB\n",
- "0.1375 0.729 1.113 0.5688 0.1979 3.794 ... -0.1246 0.2988 0.3684 0.1294 1.877\n",
+ "0.1381 0.5446 1.332 -0.1725 -0.507 3.723 ... 0.1261 -0.1208 0.8665 0.4237 1.732\n",
"Coordinates:\n",
- " * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'\n",
" * chain (chain) int64 32B 0 1 2 3\n",
" * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
- "Dimensions without coordinates: subject, batcharray([0, 1, 2, 3])
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array(['a', 'b', 'c', 'd', 'e', 'f'], dtype='<U1')
<xarray.DataArray (subject: 5, batch: 3, chain: 4, draw: 10, team: 6)> Size: 29kB\n",
- "-0.1794 0.5826 1.101 -0.07705 0.1534 3.711 ... 0.7631 0.2766 0.4849 0.5801 2.014\n",
+ "-0.1143 0.2968 0.7802 0.4579 -0.3176 4.263 ... 0.2388 -0.3806 0.2841 0.5201 2.1\n",
"Coordinates:\n",
" * subject (subject) <U23 460B 'Monstera deliciosa' ... 'Monstera pinnatipa...\n",
" * batch (batch) <U7 84B 'March' 'June' 'October'\n",
- " * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'\n",
" * chain (chain) int64 32B 0 1 2 3\n",
- " * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9array(['Monstera deliciosa', 'Monstera borsigiana', 'Monstera siltepecana',\n", + " 'Monstera variegata', 'Monstera pinnatipartita'], dtype='<U23')
array(['March', 'June', 'October'], dtype='<U7')
array([0, 1, 2, 3])
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array(['a', 'b', 'c', 'd', 'e', 'f'], dtype='<U1')
<xarray.DataArray 'x_plot' (plot_dim: 20, chain: 4, draw: 10, team: 6)> Size: 38kB\n",
"-0.1177 -0.9821 -4.519 0.06682 0.02491 ... -594.3 -600.6 -561.9 -551.8 -386.4\n",
"Coordinates:\n",
" * chain (chain) int64 32B 0 1 2 3\n",
" * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
" * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'\n",
- "Dimensions without coordinates: plot_dimarray([0, 1, 2, 3])
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array(['a', 'b', 'c', 'd', 'e', 'f'], dtype='<U1')
<xarray.DataArray (quantile: 3, chain: 4, draw: 10, team: 6)> Size: 6kB\n",
"-0.02018 0.2885 0.8726 -0.204 -0.1332 ... 0.2786 0.2264 0.5523 0.6391 2.198\n",
"Coordinates:\n",
" * quantile (quantile) float64 24B 0.25 0.5 0.75\n",
" * chain (chain) int64 32B 0 1 2 3\n",
" * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
- " * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'array([0.25, 0.5 , 0.75])
array([0, 1, 2, 3])
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array(['a', 'b', 'c', 'd', 'e', 'f'], dtype='<U1')
<xarray.DataArray (point: 50, chain: 4, draw: 10, team: 6)> Size: 96kB\n",
"5.321e-44 2.898e-49 4.753e-60 5.206e-41 ... 3.563e-57 4.449e-55 3.664e-24\n",
"Coordinates:\n",
" * point (point) float64 400B -5.0 -4.796 -4.592 -4.388 ... 4.592 4.796 5.0\n",
" * chain (chain) int64 32B 0 1 2 3\n",
" * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
- " * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'"
],
"text/plain": [
"<xarray.DataArray 'mu' (chain: 4, draw: 10)> Size: 320B\n",
"0.1588 0.2123 0.5543 0.7826 0.1913 0.6035 ... 0.1269 0.712 0.3044 0.1936 0.1223\n",
"Coordinates:\n",
" * chain (chain) int64 32B 0 1 2 3\n",
- " * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9array([0, 1, 2, 3])
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
<xarray.DataArray 'score' (match: 12, chain: 4, draw: 10)> Size: 4kB\n",
"14 14 14 14 14 31 14 1 31 14 31 1 14 1 ... 15 15 15 15 15 1 34 15 15 1 34 34 34\n",
- "Dimensions without coordinates: match, chain, draw"
],
"text/plain": [
"<xarray.Dataset> Size: 176B\n",
"Dimensions: (match: 12, team: 6)\n",
"Coordinates:\n",
@@ -4621,10 +5682,10 @@
"Data variables:\n",
" score (match) float64 96B 1.466 0.2149 0.6788 1.361 ... 1.099 1.156 1.265\n",
" mu (team) float64 48B 0.8152 1.84 2.102 1.806 1.091 0.9678\n",
- " sigma float64 8B 1.314"
],
"text/plain": [
"<xarray.Dataset> Size: 32B\n",
"Dimensions: ()\n",
"Data variables:\n",
" x_plot float64 8B 2.632\n",
" mu float64 8B 0.4878\n",
" sigma float64 8B 0.39\n",
- " score float64 8B 1.0"
+ " score float64 8B 1.0"
],
"text/plain": [
"