Debian Codegraph @

autoray/__init__.py

raw
1 try:
2 # -- Distribution mode --
3 # import from _version.py generated by setuptools_scm during release
4 from ._version import version as __version__
5 except ImportError:
6 # -- Source mode --
7 try:
8 # use setuptools_scm to get the current version from src using git
9 from setuptools_scm import get_version as _gv
10 from pathlib import Path as _Path
11
12 __version__ = _gv(_Path(__file__).parent.parent)
13 except ImportError:
14 # setuptools_scm is not available, use a default version
15 __version__ = "0.0.0+unknown"
16
17
18 from .autoray import (
19 astype,
20 backend_like,
21 compose,
22 conj,
23 dag,
24 do,
25 get_backend,
26 get_common_dtype,
27 get_dtype_name,
28 get_lib_fn,
29 get_namespace,
30 imag,
31 is_array,
32 infer_backend_multi,
33 infer_backend,
34 ndim,
35 real,
36 register_backend,
37 register_function,
38 reshape,
39 set_backend,
40 shape,
41 size,
42 to_backend_dtype,
43 to_numpy,
44 transpose,
45 # tree utilities
46 tree_apply,
47 tree_flatten,
48 tree_iter,
49 tree_map,
50 tree_unflatten,
51 # the numpy mimic submodule
52 numpy,
53 )
54 from .compiler import autojit
55 from . import lazy
56
57 # useful constants
58 from math import (
59 e,
60 pi,
61 inf,
62 nan,
63 )
64
65 __all__ = (
66 "do",
67 "get_backend",
68 "set_backend",
69 "backend_like",
70 "infer_backend",
71 "infer_backend_multi",
72 "get_lib_fn",
73 "get_namespace",
74 "shape",
75 "ndim",
76 "size",
77 "conj",
78 "transpose",
79 "dag",
80 "real",
81 "imag",
82 "reshape",
83 "to_backend_dtype",
84 "get_dtype_name",
85 "get_common_dtype",
86 "astype",
87 "to_numpy",
88 "register_backend",
89 "register_function",
90 # tree utilities
91 "is_array",
92 "tree_map",
93 "tree_iter",
94 "tree_apply",
95 "tree_flatten",
96 "tree_unflatten",
97 "compose",
98 # the numpy mimic submodule
99 "numpy",
100 # abstract function compilation
101 "autojit",
102 # lazy array library
103 "lazy",
104 # math constants,
105 "e",
106 "pi",
107 "inf",
108 "nan",
109 )