xbarray 0.0.1a13__py3-none-any.whl

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.
Files changed (51) hide show
  1. array_api_typing/__init__.py +9 -0
  2. array_api_typing/typing_2024_12/__init__.py +12 -0
  3. array_api_typing/typing_2024_12/_api_constant.py +32 -0
  4. array_api_typing/typing_2024_12/_api_fft_typing.py +717 -0
  5. array_api_typing/typing_2024_12/_api_linalg_typing.py +897 -0
  6. array_api_typing/typing_2024_12/_api_return_typing.py +103 -0
  7. array_api_typing/typing_2024_12/_api_typing.py +5855 -0
  8. array_api_typing/typing_2024_12/_array_typing.py +1265 -0
  9. array_api_typing/typing_compat/__init__.py +12 -0
  10. array_api_typing/typing_compat/_api_typing.py +27 -0
  11. array_api_typing/typing_compat/_array_typing.py +36 -0
  12. array_api_typing/typing_extra/__init__.py +12 -0
  13. array_api_typing/typing_extra/_api_typing.py +651 -0
  14. array_api_typing/typing_extra/_at.py +87 -0
  15. xbarray/__init__.py +1 -0
  16. xbarray/backends/_cls_base.py +9 -0
  17. xbarray/backends/_implementations/_common/implementations.py +87 -0
  18. xbarray/backends/_implementations/jax/__init__.py +33 -0
  19. xbarray/backends/_implementations/jax/_extra.py +127 -0
  20. xbarray/backends/_implementations/jax/_typing.py +15 -0
  21. xbarray/backends/_implementations/jax/random.py +115 -0
  22. xbarray/backends/_implementations/numpy/__init__.py +25 -0
  23. xbarray/backends/_implementations/numpy/_extra.py +98 -0
  24. xbarray/backends/_implementations/numpy/_typing.py +14 -0
  25. xbarray/backends/_implementations/numpy/random.py +105 -0
  26. xbarray/backends/_implementations/pytorch/__init__.py +26 -0
  27. xbarray/backends/_implementations/pytorch/_extra.py +135 -0
  28. xbarray/backends/_implementations/pytorch/_typing.py +13 -0
  29. xbarray/backends/_implementations/pytorch/random.py +101 -0
  30. xbarray/backends/base.py +218 -0
  31. xbarray/backends/jax.py +19 -0
  32. xbarray/backends/numpy.py +19 -0
  33. xbarray/backends/pytorch.py +22 -0
  34. xbarray/jax.py +4 -0
  35. xbarray/numpy.py +4 -0
  36. xbarray/pytorch.py +4 -0
  37. xbarray/transformations/pointcloud/__init__.py +1 -0
  38. xbarray/transformations/pointcloud/base.py +449 -0
  39. xbarray/transformations/pointcloud/jax.py +24 -0
  40. xbarray/transformations/pointcloud/numpy.py +23 -0
  41. xbarray/transformations/pointcloud/pytorch.py +23 -0
  42. xbarray/transformations/rotation_conversions/__init__.py +1 -0
  43. xbarray/transformations/rotation_conversions/base.py +713 -0
  44. xbarray/transformations/rotation_conversions/jax.py +41 -0
  45. xbarray/transformations/rotation_conversions/numpy.py +41 -0
  46. xbarray/transformations/rotation_conversions/pytorch.py +41 -0
  47. xbarray-0.0.1a13.dist-info/METADATA +20 -0
  48. xbarray-0.0.1a13.dist-info/RECORD +51 -0
  49. xbarray-0.0.1a13.dist-info/WHEEL +5 -0
  50. xbarray-0.0.1a13.dist-info/licenses/LICENSE +21 -0
  51. xbarray-0.0.1a13.dist-info/top_level.txt +2 -0
@@ -0,0 +1,103 @@
1
+ from typing import Protocol, TypeVar, Optional, Any, Tuple, Union, Type, TypedDict, List, TypeAlias
2
+ from dataclasses import dataclass
3
+ from abc import abstractmethod
4
+ from ._array_typing import Device, DType
5
+
6
+ __all__ = [
7
+ "SupportsBufferProtocol",
8
+ "DefaultDataTypes",
9
+ "DataTypes",
10
+ "Capabilities",
11
+ "finfo_object",
12
+ "iinfo_object",
13
+ "NestedSequence",
14
+ "Info"
15
+ ]
16
+
17
+ SupportsBufferProtocol = TypeVar("SupportsBufferProtocol")
18
+
19
+ """
20
+ https://github.com/data-apis/array-api/blob/main/src/array_api_stubs/_2024_12/_types.py#L55
21
+ """
22
+ DefaultDataTypes = TypedDict(
23
+ "DefaultDataTypes",
24
+ {
25
+ "real floating": DType,
26
+ "complex floating": DType,
27
+ "integral": DType,
28
+ "indexing": DType,
29
+ },
30
+ )
31
+ DataTypes = TypedDict(
32
+ "DataTypes",
33
+ {
34
+ "bool": DType,
35
+ "float32": DType,
36
+ "float64": DType,
37
+ "complex64": DType,
38
+ "complex128": DType,
39
+ "int8": DType,
40
+ "int16": DType,
41
+ "int32": DType,
42
+ "int64": DType,
43
+ "uint8": DType,
44
+ "uint16": DType,
45
+ "uint32": DType,
46
+ "uint64": DType,
47
+ },
48
+ total=False,
49
+ )
50
+ Capabilities = TypedDict(
51
+ "Capabilities",
52
+ {
53
+ "boolean indexing": bool,
54
+ "data-dependent shapes": bool,
55
+ "max rank": Optional[int],
56
+ },
57
+ )
58
+
59
+ @dataclass
60
+ class finfo_object:
61
+ """Dataclass returned by `finfo`."""
62
+ bits: int
63
+ eps: float
64
+ max: float
65
+ min: float
66
+ smallest_normal: float
67
+ dtype: DType
68
+
69
+ @dataclass
70
+ class iinfo_object:
71
+ """Dataclass returned by `iinfo`."""
72
+ bits: int
73
+ max: int
74
+ min: int
75
+ dtype: DType
76
+
77
+ _T_co = TypeVar("_T_co", covariant=True)
78
+ class NestedSequence(Protocol[_T_co]):
79
+ def __getitem__(self, key: int, /) -> Union[_T_co, 'NestedSequence[_T_co]']:
80
+ ...
81
+
82
+ def __len__(self, /) -> int:
83
+ ...
84
+
85
+ class Info(Protocol):
86
+ """Namespace returned by `__array_namespace_info__`."""
87
+
88
+ def capabilities(self) -> Capabilities:
89
+ ...
90
+
91
+ def default_device(self) -> Device:
92
+ ...
93
+
94
+ def default_dtypes(self, *, device: Optional[Device]) -> DefaultDataTypes:
95
+ ...
96
+
97
+ def devices(self) -> List[Device]:
98
+ ...
99
+
100
+ def dtypes(
101
+ self, *, device: Optional[Device] = None, kind: Optional[Union[str, Tuple[str, ...]]] = None
102
+ ) -> DataTypes: # In the original signature there's no default parameters for `device` and `kind`, but we add them since they exist in `array_api_compat` modules
103
+ ...