diff --git a/src/amrex/space1d/__init__.py b/src/amrex/space1d/__init__.py index 805a7656..6fac7643 100644 --- a/src/amrex/space1d/__init__.py +++ b/src/amrex/space1d/__init__.py @@ -26,6 +26,9 @@ __license__ = amrex_1d_pybind.__license__ __author__ = amrex_1d_pybind.__author__ + # at this place we can enhance Python classes with additional methods written # in pure Python or add some other Python logic # +def d_decl(x, y, z): + return (x,) diff --git a/src/amrex/space2d/__init__.py b/src/amrex/space2d/__init__.py index 81e4edce..c30ed8c5 100644 --- a/src/amrex/space2d/__init__.py +++ b/src/amrex/space2d/__init__.py @@ -26,6 +26,9 @@ __license__ = amrex_2d_pybind.__license__ __author__ = amrex_2d_pybind.__author__ + # at this place we can enhance Python classes with additional methods written # in pure Python or add some other Python logic # +def d_decl(x, y, z): + return (x, y) diff --git a/src/amrex/space3d/__init__.py b/src/amrex/space3d/__init__.py index 46e03a89..d8163ea8 100644 --- a/src/amrex/space3d/__init__.py +++ b/src/amrex/space3d/__init__.py @@ -26,6 +26,9 @@ __license__ = amrex_3d_pybind.__license__ __author__ = amrex_3d_pybind.__author__ + # at this place we can enhance Python classes with additional methods written # in pure Python or add some other Python logic # +def d_decl(x, y, z): + return (x, y, z) diff --git a/tests/test_intvect.py b/tests/test_intvect.py index d280efa7..32c878bf 100644 --- a/tests/test_intvect.py +++ b/tests/test_intvect.py @@ -140,3 +140,8 @@ def test_iv_iter(): b1 = [x for x in b0] np.testing.assert_allclose(a1, b1) + + +def test_iv_d_decl(): + iv = amr.IntVect(*amr.d_decl(1, 2, 3)) + assert iv == amr.IntVect(1, 2, 3)