From e27ad865ee26fa8037f7d9619cde9e054136d813 Mon Sep 17 00:00:00 2001 From: AzeezIsh Date: Thu, 18 Apr 2024 16:40:41 -0400 Subject: [PATCH 1/5] fixes pyproject.toml failures --- arrayfire/library/constants.py | 2 -- pyproject.toml | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arrayfire/library/constants.py b/arrayfire/library/constants.py index f6cfb43..4fd76e2 100644 --- a/arrayfire/library/constants.py +++ b/arrayfire/library/constants.py @@ -51,5 +51,3 @@ import arrayfire_wrapper.lib as wrapper import arrayfire as af - -pi = wrapper.constant(math.pi, (1,), af.float64) diff --git a/pyproject.toml b/pyproject.toml index 49db3af..4ea40fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta" [project] name = "arrayfire" -dynamic = ["version"] -dependencies = ["arrayfire-binary-python-wrapper == 0.7.0+af3.9.0"] +version = "0.1.0" +dependencies = ["arrayfire-binary-python-wrapper == 0.7.0"] requires-python = ">=3.10" description = "ArrayFire Python" readme = "README.md" @@ -49,9 +49,6 @@ benchmarks = ["numpy ~= 1.26.4"] [project.entry-points.array_api] array_api = "arrayfire.array_api" -[tool.setuptools.dynamic] -version = { attr = "arrayfire.__version__" } - [tool.black] line-length = 119 exclude = ''' From f4543c04a66f335fba717abac775a2d205079ce0 Mon Sep 17 00:00:00 2001 From: AzeezIsh Date: Thu, 18 Apr 2024 16:46:41 -0400 Subject: [PATCH 2/5] Pi import issues --- arrayfire/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/arrayfire/__init__.py b/arrayfire/__init__.py index b48b9ca..e5f2079 100755 --- a/arrayfire/__init__.py +++ b/arrayfire/__init__.py @@ -160,7 +160,6 @@ "Interp", "IterativeDeconv", "Pad", - "pi", ] from arrayfire.library.constants import ( @@ -183,7 +182,6 @@ TopK, VarianceBias, YCCStd, - pi, ) __all__ += [ From 299a650782b004948fa53382312cb5f679f87c6a Mon Sep 17 00:00:00 2001 From: AzeezIsh Date: Thu, 18 Apr 2024 17:43:09 -0400 Subject: [PATCH 3/5] fixed constants imports --- arrayfire/array_api/__init__.py | 4 ++-- arrayfire/array_api/_constants.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arrayfire/array_api/__init__.py b/arrayfire/array_api/__init__.py index 798a886..846b343 100644 --- a/arrayfire/array_api/__init__.py +++ b/arrayfire/array_api/__init__.py @@ -4,9 +4,9 @@ __all__ = ["__array_api_version__"] -from ._constants import Device +from ._constants import Device, e, inf, nan, pi, newaxis -__all__ += ["Device"] +__all__ += ["Device", "e", "inf", "nan", "pi", "newaxis"] from ._creation_function import ( arange, diff --git a/arrayfire/array_api/_constants.py b/arrayfire/array_api/_constants.py index a578d13..5b5346c 100644 --- a/arrayfire/array_api/_constants.py +++ b/arrayfire/array_api/_constants.py @@ -105,3 +105,11 @@ def __post_init__(self) -> None: class SupportsDLPack(Protocol): def __dlpack__(self, /, *, stream: None = ...) -> PyCapsule: ... + +import math + +e = math.e +inf = math.inf +nan = math.nan +pi = math.pi +newaxis = None \ No newline at end of file From c8b8fcfe7706de3f4e7bb2258921d4d9f689cba5 Mon Sep 17 00:00:00 2001 From: AzeezIsh Date: Tue, 23 Apr 2024 17:20:07 -0400 Subject: [PATCH 4/5] adhered to all checkstyle requirements --- arrayfire/array_api/_constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arrayfire/array_api/_constants.py b/arrayfire/array_api/_constants.py index 5b5346c..ebbe05c 100644 --- a/arrayfire/array_api/_constants.py +++ b/arrayfire/array_api/_constants.py @@ -8,6 +8,7 @@ from __future__ import annotations +import math from dataclasses import dataclass import arrayfire as af @@ -106,10 +107,9 @@ def __post_init__(self) -> None: class SupportsDLPack(Protocol): def __dlpack__(self, /, *, stream: None = ...) -> PyCapsule: ... -import math e = math.e inf = math.inf nan = math.nan pi = math.pi -newaxis = None \ No newline at end of file +newaxis = None From bc9c1e71b563414bdffafdbd17dff2760b001eb6 Mon Sep 17 00:00:00 2001 From: AzeezIsh Date: Tue, 23 Apr 2024 17:33:21 -0400 Subject: [PATCH 5/5] fixed init file imports --- arrayfire/array_api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arrayfire/array_api/__init__.py b/arrayfire/array_api/__init__.py index 846b343..0a21bf0 100644 --- a/arrayfire/array_api/__init__.py +++ b/arrayfire/array_api/__init__.py @@ -4,7 +4,7 @@ __all__ = ["__array_api_version__"] -from ._constants import Device, e, inf, nan, pi, newaxis +from ._constants import Device, e, inf, nan, newaxis, pi __all__ += ["Device", "e", "inf", "nan", "pi", "newaxis"]