Skip to content

Commit

Permalink
adding wrapper for AMREX_D_DECL (#150)
Browse files Browse the repository at this point in the history
* adding wrapper for AMREX_D_DECL
  • Loading branch information
RevathiJambunathan authored Jul 20, 2023
1 parent 08ce3d4 commit d8ca28d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/amrex/space1d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,)
3 changes: 3 additions & 0 deletions src/amrex/space2d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 3 additions & 0 deletions src/amrex/space3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions tests/test_intvect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d8ca28d

Please sign in to comment.