Skip to content

Commit 6e5fb3d

Browse files
authored
add logsumexp, sort, searchsorted and ecdf functions (#40)
* add logsumexp, searchsorted and ecdf functions * avoid full obj name + module in page headings * try matplotlib plot directive * extend tests * lint fixes * changelog and doc improvements
1 parent 36d8961 commit 6e5fb3d

File tree

16 files changed

+392
-88
lines changed

16 files changed

+392
-88
lines changed

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ good-names=a,
239239
m,
240240
t,
241241
q,
242+
v,
242243
x,
243244
y,
244245
z,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{ objname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. auto{{ objtype }}:: {{ objname }}

docs/source/_templates/autosummary/class.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ fullname | escape | underline}}
1+
{{ objname | escape | underline}}
22

33
.. currentmodule:: {{ module }}
44

docs/source/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Moreover, it also provides some convenience functions in the top-level namespace
2828
.. autosummary::
2929
:toctree: generated/
3030
31+
sort
3132
empty_ref
3233
ones_ref
3334
zeros_ref

docs/source/api/numba.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
:toctree: generated/
99
1010
histogram
11+
searchsorted
12+
ecdf
1113
```

docs/source/api/stats.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ but the output will be a numpy array.
4747
:toctree: generated/
4848
4949
rankdata
50+
logsumexp
5051
```
5152

5253
## Convenience functions

docs/source/changelog.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22

33
## v0.x.x (Unreleased)
44
### New features
5-
* Added `empty_ref`, `ones_ref` and `zeros_ref` DataArray creation helpers {pull}`37`
6-
* Added `linalg.diagonal` wrapper {pull}`37`
5+
* Added {func}`.empty_ref`, {func}`.ones_ref` and {func}`.zeros_ref` DataArray creation helpers {pull}`37`
6+
* Added {func}`.linalg.diagonal` wrapper {pull}`37`
7+
* Added {func}`.stats.logsumexp` wrapper {pull}`40`
8+
* Added {func}`.searchsorted` and {func}`.ecdf` in {mod}`~xarray_einstats.numba` module {pull}`40`
9+
* Added {func}`~xarray_einstats.sort` wrapper for vectorized sort along specific dimension using values {pull}`40`
710

811
### Maintenance and fixes
912
* Fix issue in `linalg.svd` for non-square matrices {pull}`37`
1013
* Fix evaluation of distribution methods (e.g. `.pdf`) on scalars {pull}`38` and {pull}`39`
14+
* Ensure support on inputs with stacked dimensions {pull}`40`
1115

1216
### Documentation
1317
* Ported NumPy tutorial on linear algebra with multidimensional arrays {pull}`37`
18+
* Added ecdf usage example and plotting reference {pull}`40`
1419

1520
## v0.4.0 (2022 Dec 9)
1621
### New features

docs/source/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"sphinx_copybutton",
4141
"jupyter_sphinx",
4242
"sphinx_design",
43+
"matplotlib.sphinxext.plot_directive",
4344
]
4445

4546
templates_path = ["_templates"]
@@ -88,6 +89,11 @@
8889
**{f"{singular}s": f":any:`{singular}s <{singular}>`" for singular in singulars},
8990
}
9091

92+
# Include the example source for plots in API docs
93+
plot_include_source = True
94+
plot_formats = [("png", 90)]
95+
plot_html_show_formats = False
96+
plot_html_show_source_link = False
9197

9298
# -- Options for HTML output
9399

docs/source/tutorials/np_linalg_tutorial_port.ipynb

Lines changed: 61 additions & 67 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ doc = [
6363
"jupyter-sphinx",
6464
"sphinx-design",
6565
"watermark",
66+
"matplotlib",
6667
]
6768

6869
[tool.black]

0 commit comments

Comments
 (0)