-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update poetry.lock * ⬆️ Pump simplug to 0.2 * 🔖 0.10.1 * 🚑 Fix false warning when importing from all * 🔖 0.10.2 * ✨ Add `array_ufunc` hook * 💥 Change hook `data_api` to `load_dataset` * ✨ Allow backend for `c[]` * ✨ Add `c.with_backend()` for `c[]` * ✨ Add `DatarOperator.with_backend()` to select backend for operators * ⬆️ Bump simplug to 0.2.2 * ✅ Add tests * 📝 Update docs for backends * 📝 Fix docs * 🔖 0.10.3rc0 * 💚 Fix CI * 💚 Try add six in CI * 💚 Add dev-deps * 💚 Add python-slugify as dev-deps * 💚 Fix coverage file in CI * 🔖 0.10.3 * 📝 [0.10.3] Fix docs building * 💚 Try to ignore optional deps in CI * 💚 Install dev-deps in CI
- Loading branch information
Showing
36 changed files
with
1,627 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
if TYPE_CHECKING: | ||
omit = | ||
datar/datasets.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from contextlib import contextmanager | ||
|
||
from pipda import register_func | ||
|
||
|
||
@contextmanager | ||
def _array_ufunc_with_backend(backend: str): | ||
"""Use a backend for the operator""" | ||
old_backend = array_ufunc.backend | ||
array_ufunc.backend = backend | ||
yield | ||
array_ufunc.backend = old_backend | ||
|
||
|
||
@register_func(cls=object, dispatchable="first") | ||
def array_ufunc(x, ufunc, *args, **kwargs): | ||
"""Implement the array ufunc | ||
Allow other backends to override the behavior of the ufunc on | ||
different types of data. | ||
""" | ||
return ufunc(x, *args, **kwargs) | ||
|
||
|
||
array_ufunc.backend = None | ||
array_ufunc.with_backend = _array_ufunc_with_backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# pragma: no cover | ||
import warnings | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.