diff --git a/docs/source/api-reference/constants.md b/docs/source/api-reference/constants.md deleted file mode 100644 index 21fb31ed..00000000 --- a/docs/source/api-reference/constants.md +++ /dev/null @@ -1 +0,0 @@ -# Constants diff --git a/docs/source/api-reference/constants.rst b/docs/source/api-reference/constants.rst new file mode 100644 index 00000000..9eb47bfa --- /dev/null +++ b/docs/source/api-reference/constants.rst @@ -0,0 +1 @@ +.. automodule:: numpy.doc.constants diff --git a/nums/numpy/api/__init__.py b/nums/numpy/api/__init__.py index c5343d97..2df81cc9 100644 --- a/nums/numpy/api/__init__.py +++ b/nums/numpy/api/__init__.py @@ -17,6 +17,7 @@ import warnings from nums.numpy.api.algebra import * +from nums.numpy.api.constants import * from nums.numpy.api.creation import * from nums.numpy.api.generated import * from nums.numpy.api.manipulation import * @@ -61,43 +62,3 @@ def wrapped(*args, **kwargs): return nps_res return wrapped - - -############################################ -# Constants -############################################ - -# Distributed memory access of these values will be optimized downstream. -pi = np.pi -e = np.e -euler_gamma = np.euler_gamma -inf = infty = Inf = Infinity = PINF = np.inf -NINF = np.NINF -PZERO = np.PZERO -NZERO = np.NZERO -nan = NAN = NaN = np.nan - -############################################ -# Data Types -############################################ - - -bool_ = np.bool_ - -uint = np.uint -uint8 = np.uint8 -uint16 = np.uint16 -uint32 = np.uint32 -uint64 = np.uint64 - -int8 = np.int8 -int16 = np.int16 -int32 = np.int32 -int64 = np.int64 - -float16 = np.float16 -float32 = np.float32 -float64 = np.float64 - -complex64 = np.complex64 -complex128 = np.complex128 diff --git a/nums/numpy/api/constants.py b/nums/numpy/api/constants.py new file mode 100644 index 00000000..1af1b6e5 --- /dev/null +++ b/nums/numpy/api/constants.py @@ -0,0 +1,56 @@ +import numpy as np + +__all__ = [ + "pi", + "e", + "euler_gamma", + "NINF", + "PZERO", + "NZERO", + "nan", + "bool_", + "uint", + "uint8", + "uint16", + "uint32", + "uint64", + "int8", + "int16", + "int32", + "int64", + "float16", + "float32", + "float64", + "complex64", + "complex128", +] + +# Distributed memory access of these values will be optimized downstream. +pi = np.pi +e = np.e +euler_gamma = np.euler_gamma +inf = infty = Inf = Infinity = PINF = np.inf +NINF = np.NINF +PZERO = np.PZERO +NZERO = np.NZERO +nan = NAN = NaN = np.nan + +bool_ = np.bool_ + +uint = np.uint +uint8 = np.uint8 +uint16 = np.uint16 +uint32 = np.uint32 +uint64 = np.uint64 + +int8 = np.int8 +int16 = np.int16 +int32 = np.int32 +int64 = np.int64 + +float16 = np.float16 +float32 = np.float32 +float64 = np.float64 + +complex64 = np.complex64 +complex128 = np.complex128