Add a context manager as an alternative to monkey patching#91
Conversation
Documentation build overview
80 files changed ·
|
|
|
||
|
|
||
| @contextmanager | ||
| def default_linalg_dims(func_or_dims): |
There was a problem hiding this comment.
I think the body can be kept mostly as is, the only change is I would define it inside the linalg.py file so it is also imported from xarray_einstats.linalg instead of being available at the top level. We might then want to remove the linalg from the name but I am also fine keeping it.
| Yields | ||
| ------ | ||
| None |
There was a problem hiding this comment.
numpydoc doesn't say anything on documenting context managers but I would remove this section and instead add an examples section or a seealso pointing to the docs on using it. In general I would also update all the docs to remove any reference to monkeypatching and rely on the context manager only (I am more than happy to do this myself if you prefer).
Closes #29