xbarray 0.0.1a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xbarray might be problematic. Click here for more details.

Files changed (40) hide show
  1. xbarray-0.0.1a1/LICENSE +21 -0
  2. xbarray-0.0.1a1/PKG-INFO +14 -0
  3. xbarray-0.0.1a1/README.md +29 -0
  4. xbarray-0.0.1a1/array_api_typing/__init__.py +9 -0
  5. xbarray-0.0.1a1/array_api_typing/typing_2024_12/__init__.py +12 -0
  6. xbarray-0.0.1a1/array_api_typing/typing_2024_12/_api_constant.py +32 -0
  7. xbarray-0.0.1a1/array_api_typing/typing_2024_12/_api_fft_typing.py +717 -0
  8. xbarray-0.0.1a1/array_api_typing/typing_2024_12/_api_linalg_typing.py +897 -0
  9. xbarray-0.0.1a1/array_api_typing/typing_2024_12/_api_return_typing.py +103 -0
  10. xbarray-0.0.1a1/array_api_typing/typing_2024_12/_api_typing.py +5855 -0
  11. xbarray-0.0.1a1/array_api_typing/typing_2024_12/_array_typing.py +1265 -0
  12. xbarray-0.0.1a1/array_api_typing/typing_compat/__init__.py +12 -0
  13. xbarray-0.0.1a1/array_api_typing/typing_compat/_api_typing.py +27 -0
  14. xbarray-0.0.1a1/array_api_typing/typing_compat/_array_typing.py +36 -0
  15. xbarray-0.0.1a1/array_api_typing/typing_extra/__init__.py +12 -0
  16. xbarray-0.0.1a1/array_api_typing/typing_extra/_api_typing.py +651 -0
  17. xbarray-0.0.1a1/array_api_typing/typing_extra/_at.py +87 -0
  18. xbarray-0.0.1a1/pyproject.toml +25 -0
  19. xbarray-0.0.1a1/setup.cfg +4 -0
  20. xbarray-0.0.1a1/xbarray/__init__.py +1 -0
  21. xbarray-0.0.1a1/xbarray/base/__init__.py +1 -0
  22. xbarray-0.0.1a1/xbarray/base/base.py +199 -0
  23. xbarray-0.0.1a1/xbarray/common/implementations.py +61 -0
  24. xbarray-0.0.1a1/xbarray/jax/__init__.py +25 -0
  25. xbarray-0.0.1a1/xbarray/jax/_extra.py +98 -0
  26. xbarray-0.0.1a1/xbarray/jax/_typing.py +15 -0
  27. xbarray-0.0.1a1/xbarray/jax/random.py +116 -0
  28. xbarray-0.0.1a1/xbarray/numpy/__init__.py +19 -0
  29. xbarray-0.0.1a1/xbarray/numpy/_extra.py +83 -0
  30. xbarray-0.0.1a1/xbarray/numpy/_typing.py +14 -0
  31. xbarray-0.0.1a1/xbarray/numpy/random.py +106 -0
  32. xbarray-0.0.1a1/xbarray/pytorch/__init__.py +20 -0
  33. xbarray-0.0.1a1/xbarray/pytorch/_extra.py +109 -0
  34. xbarray-0.0.1a1/xbarray/pytorch/_typing.py +13 -0
  35. xbarray-0.0.1a1/xbarray/pytorch/random.py +102 -0
  36. xbarray-0.0.1a1/xbarray.egg-info/PKG-INFO +14 -0
  37. xbarray-0.0.1a1/xbarray.egg-info/SOURCES.txt +38 -0
  38. xbarray-0.0.1a1/xbarray.egg-info/dependency_links.txt +1 -0
  39. xbarray-0.0.1a1/xbarray.egg-info/requires.txt +10 -0
  40. xbarray-0.0.1a1/xbarray.egg-info/top_level.txt +3 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yunhao Cao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: xbarray
3
+ Version: 0.0.1a1
4
+ Requires-Python: >=3.10
5
+ License-File: LICENSE
6
+ Requires-Dist: typing_extensions>=4.5
7
+ Requires-Dist: array_api_compat
8
+ Requires-Dist: array_api_extra
9
+ Requires-Dist: numpy
10
+ Provides-Extra: torch
11
+ Requires-Dist: torch; extra == "torch"
12
+ Provides-Extra: jax
13
+ Requires-Dist: jax; extra == "jax"
14
+ Dynamic: license-file
@@ -0,0 +1,29 @@
1
+ # xarray
2
+ Cross-backend Python N-dimensional array library based on Array API.
3
+
4
+ This allows you to write array transformations that can run on different backends like NumPy, PyTorch, and Jax.
5
+
6
+ ## Usage:
7
+
8
+ Abstract typing:
9
+
10
+ ```python
11
+ from xarray import ComputeBackend, BArrayType, BDeviceType, BDtypeType, BRNGType
12
+ from typing import Generic
13
+
14
+ class ABC(Generic[BArrayType, BDeviceType, BDtypeType, BRNGType]):
15
+ def __init__(self, backend : ComputeBackend[BArrayType, BDeviceType, BDtypeType, BRNGType]) -> None:
16
+ self.backend = backend
17
+
18
+ def create_array(self) -> BArrayType:
19
+ return self.backend.zeros(5, dtype=self.backend.default_floating_dtype)
20
+ ```
21
+
22
+ Concrete usage:
23
+
24
+ ```python
25
+ from xarray import pytorch as pytorch_backend
26
+
27
+ abc_pytorch_instance = ABC(pytorch_backend)
28
+ abc_pytorch_array = abc_pytorch_instance.create_array()
29
+ ```
@@ -0,0 +1,9 @@
1
+ from . import typing_2024_12 as typing_2024_12
2
+ from . import typing_compat
3
+ from . import typing_extra
4
+
5
+ __all__ = [
6
+ "typing_2024_12",
7
+ "typing_compat",
8
+ "typing_extra",
9
+ ]
@@ -0,0 +1,12 @@
1
+ from ._array_typing import Array as ArrayAPIArray, Device as ArrayAPIDevice, DType as ArrayAPIDType, PyCapsule, SupportsDLPack, SetIndex, GetIndex
2
+ from ._api_typing import ArrayAPINamespace
3
+
4
+ __all__ = [
5
+ "ArrayAPIArray",
6
+ "ArrayAPIDevice",
7
+ "ArrayAPIDType",
8
+ "SetIndex",
9
+ "GetIndex",
10
+ "SupportsDLPack",
11
+ "ArrayAPINamespace",
12
+ ]
@@ -0,0 +1,32 @@
1
+ """
2
+ From https://github.com/data-apis/array-api/blob/main/src/array_api_stubs/_2024_12/constants.py
3
+ """
4
+
5
+ e = 2.718281828459045
6
+ """
7
+ IEEE 754 floating-point representation of Euler's constant.
8
+
9
+ ``e = 2.71828182845904523536028747135266249775724709369995...``
10
+ """
11
+
12
+ inf = float("inf")
13
+ """
14
+ IEEE 754 floating-point representation of (positive) infinity.
15
+ """
16
+
17
+ nan = float("nan")
18
+ """
19
+ IEEE 754 floating-point representation of Not a Number (``NaN``).
20
+ """
21
+
22
+ newaxis = None
23
+ """
24
+ An alias for ``None`` which is useful for indexing arrays.
25
+ """
26
+
27
+ pi = 3.141592653589793
28
+ """
29
+ IEEE 754 floating-point representation of the mathematical constant ``π``.
30
+
31
+ ``pi = 3.1415926535897932384626433...``
32
+ """