Skip to content

Commit

Permalink
Merge branch 'main' into users/phschaad/loop_lifting_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad authored Jan 9, 2025
2 parents 508f41b + 37b466a commit fcae83f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/general-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7,'3.12']
python-version: ['3.9','3.13']
simplify: [0,1,autoopt]

steps:
Expand Down
12 changes: 8 additions & 4 deletions dace/frontend/python/replacements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,18 +1565,22 @@ def _representative_num(dtype: Union[dtypes.typeclass, Number]) -> Number:
nptype = dtype.type
else:
nptype = dtype
if issubclass(nptype, bool):
if isinstance(nptype, type):
nptype_class = nptype
else:
nptype_class = type(nptype)
if issubclass(nptype_class, bool):
return True
elif issubclass(nptype, np.bool_):
elif issubclass(nptype_class, np.bool_):
return np.bool_(True)
elif issubclass(nptype, Integral):
elif issubclass(nptype_class, Integral):
# NOTE: Returning the max representable integer seems a better choice
# than 1, however it was causing issues with some programs. This should
# be revisited in the future.
# return nptype(np.iinfo(nptype).max)
return nptype(1)
else:
return nptype(np.finfo(nptype).resolution)
return nptype(np.finfo(nptype_class).resolution)


def _np_result_type(nptypes):
Expand Down
2 changes: 1 addition & 1 deletion doc/setup/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Installation
============

DaCe is routinely tested on and officially supports Python 3.7 or newer (Python 3.6 is also supported, but not actively tested).
DaCe is routinely tested on and officially supports Python 3.9 to 3.13.

.. _dependencies:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
],
python_requires='>=3.6, <3.13',
python_requires='>=3.9, <3.14',
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
package_data={
'': [
Expand Down
4 changes: 3 additions & 1 deletion tests/python_frontend/method_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Tests dace.program as class methods """
import pytest
import dace
import numpy as np
import sys
Expand Down Expand Up @@ -126,6 +127,7 @@ def test_static_withclass():
assert np.allclose(MyTestClass.static_withclass(A), A + 3)


@pytest.mark.skip(reason="Python 3.13 removed chained @classmethods, making this impossible for now")
def test_classmethod():
# Only available in Python 3.9+
if sys.version_info >= (3, 9):
Expand Down Expand Up @@ -282,7 +284,7 @@ def tester(a):
test_callable()
test_static()
test_static_withclass()
test_classmethod()
#test_classmethod()
test_nested_methods()
test_decorator()
test_sdfgattr_method_jit()
Expand Down

0 comments on commit fcae83f

Please sign in to comment.