Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py-gt4py, py-icon4py] Renaming gt4py versions + Adding icon4py v0.0.3.1 to latest #835

Merged
merged 31 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
91890fb
adding patched v0.0.3.1
abishekg7 Sep 20, 2023
91c2c98
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 20, 2023
8021a19
updating condition
abishekg7 Sep 20, 2023
3e90bcd
trying special case for v0.0.3
abishekg7 Sep 20, 2023
b5d203f
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 20, 2023
21c3b10
Update package.py
abishekg7 Sep 20, 2023
eefe13f
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 24, 2023
c8d29ab
renaming gt4py versions
abishekg7 Sep 28, 2023
be1d446
testing new icon4py gt4py tags
abishekg7 Sep 28, 2023
cd14fac
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 28, 2023
7df3871
Update package.py
abishekg7 Sep 29, 2023
6cd6350
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 29, 2023
c75eee0
Update package.py
abishekg7 Sep 29, 2023
4b56ed3
Update package.py
abishekg7 Oct 3, 2023
860e0a8
adding test for gt4py 1.0.1.1b
abishekg7 Oct 16, 2023
0baa030
GitHub Action: Apply Pep8-formatting
invalid-email-address Oct 16, 2023
4437e0c
adding icon4py v0.0.8
abishekg7 Oct 16, 2023
f30025c
Update system_test.py
abishekg7 Oct 17, 2023
64f5ac0
Update package.py
abishekg7 Oct 17, 2023
bd19057
folder mapping for lower versions
abishekg7 Oct 17, 2023
64c658d
folder mapping
abishekg7 Oct 17, 2023
76c318d
GitHub Action: Apply Pep8-formatting
invalid-email-address Oct 17, 2023
5f543ba
temp test for dsl
abishekg7 Oct 17, 2023
edaa2dc
Update system_test.py
abishekg7 Oct 18, 2023
bbd2d06
Update package.py
abishekg7 Oct 18, 2023
69079d6
Pick parent dir for ver < 0.0.4
abishekg7 Oct 18, 2023
79676aa
GitHub Action: Apply Pep8-formatting
invalid-email-address Oct 18, 2023
c29491d
Update package.py
abishekg7 Oct 18, 2023
d9f1e4e
GitHub Action: Apply Pep8-formatting
invalid-email-address Oct 18, 2023
225844f
Update system_test.py
abishekg7 Oct 18, 2023
44c2d86
Reverting repo/branch
abishekg7 Oct 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions repos/c2sm/packages/icon/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,18 +586,28 @@ def configure_args(self):
config_vars['LOC_GT4PY'].append(self.spec['py-gt4py'].prefix)
config_vars['LOC_ICON4PY_BIN'].append(
self.spec['py-icon4py'].prefix)

config_vars['LOC_ICON4PY_ATM_DYN_ICONAM'].append(
self.spec['py-icon4py:atm_dyn_iconam'].headers.directories[0])
config_vars['LOC_ICON4PY_TOOLS'].append(
self.spec['py-icon4py:tools'].headers.directories[0])
if self.spec['py-icon4py'].version > Version("0.0.7"):
config_vars['LOC_ICON4PY_DIFFUSION'].append(
self.spec['py-icon4py:diffusion'].headers.directories[0])
config_vars['LOC_ICON4PY_INTERPOLATION'].append(
self.spec['py-icon4py:interpolation'].headers.
directories[0])
config_vars['LOC_ICON4PY_ADVECTION'].append(
self.spec['py-icon4py:advection'].headers.directories[0])

if self.spec['py-icon4py'].version < Version("0.0.4"):
config_vars['LOC_ICON4PY_UTILS'].append(
os.path.dirname(
self.spec['py-icon4py:utils'].headers.directories[0]))
else:
config_vars['LOC_ICON4PY_TOOLS'].append(
self.spec['py-icon4py:tools'].headers.directories[0])
if self.spec['py-icon4py'].version > Version("0.0.7"):
config_vars['LOC_ICON4PY_DIFFUSION'].append(
self.spec['py-icon4py:diffusion'].headers.
directories[0])
config_vars['LOC_ICON4PY_INTERPOLATION'].append(
self.spec['py-icon4py:interpolation'].headers.
directories[0])
if self.spec['py-icon4py'].version > Version("0.0.8"):
config_vars['LOC_ICON4PY_ADVECTION'].append(
self.spec['py-icon4py:advection'].headers.
directories[0])
config_vars['LOC_GRIDTOOLS'].append(
self.spec['py-gridtools-cpp:data'].headers.directories[0])
config_vars['GT4PYNVCFLAGS'] = config_vars['NVCFLAGS']
Expand Down
11 changes: 6 additions & 5 deletions repos/c2sm/packages/py-gt4py/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ class PyGt4py(PythonPackage):
url = "[email protected]:GridTools/gt4py.git"

version('main', branch='main', git=url)
version('1.1.1', tag='icon4py_20230413', git=url)
version('1.1.2', tag='icon4py_20230621', git=url)
version('1.1.3', tag='icon4py_20230817', git=url)
version('1.1.4', tag='icon4py_20230926', git=url)
version('1.0.1.1', tag='icon4py_20230413', git=url)
version('1.0.1.1b', tag='icon4py_20230530', git=url)
version('1.0.1.2', tag='icon4py_20230621', git=url)
version('1.0.1.3', tag='icon4py_20230817', git=url)
version('1.0.1.4', tag='icon4py_20230926', git=url)

maintainers = ['samkellerhals']

Expand Down Expand Up @@ -60,7 +61,7 @@ class PyGt4py(PythonPackage):
# See: https://github.com/C2SM/spack-c2sm/issues/803
depends_on('[email protected]:2.9.2', type=('build', 'run'))

depends_on('[email protected]:', when="@1.1.3:", type=('build', 'run'))
depends_on('[email protected]:', when="@1.0.1.3:", type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:4.6', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
Expand Down
18 changes: 13 additions & 5 deletions repos/c2sm/packages/py-icon4py/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class PyIcon4py(PythonPackage):

version('main', branch='main', git=git)
version('0.0.3', tag='v0.0.3', git=git)
version('0.0.3.1', tag='v0.0.3.1', git=git)
version('0.0.4', tag='v0.0.4', git=git)
version('0.0.5', tag='v0.0.5', git=git)
version('0.0.6', tag='v0.0.6', git=git)
Expand Down Expand Up @@ -69,6 +70,16 @@ def headers(self):
version = self.spec.version

folder_mapping = {
ver('=0.0.3'): {
'atm_dyn_iconam': 'atm_dyn_iconam',
'utils':
'liskov' #utils will eventually map to parent directory of liskov
},
ver('=0.0.3.1'): {
'atm_dyn_iconam': 'atm_dyn_iconam',
'utils':
'liskov' #utils will eventually map to parent directory of liskov
},
ver('=0.0.4'): {
'atm_dyn_iconam': 'atm_dyn_iconam',
'tools': 'icon4pytools'
Expand Down Expand Up @@ -103,10 +114,6 @@ def headers(self):
if len(query_parameters) > 1:
raise ValueError('Only one query parameter allowed')

if version == ver('=0.0.3') and len(query_parameters) == 1:
msg = 'Not implemented for version {0}'.format(version)
raise spack.error.NoHeadersError(msg)

folder_name = folder_mapping.get(version, {})

if not folder_name:
Expand Down Expand Up @@ -154,7 +161,8 @@ def install(self, pkg, spec, prefix):

pip = inspect.getmodule(pkg).pip

if self.spec.version == ver('=0.0.3'):
if self.spec.version == ver('=0.0.3') or self.spec.version == ver(
'=0.0.3.1'):
build_dirs = [
'common', 'pyutils', 'testutils', 'liskov', 'atm_dyn_iconam'
]
Expand Down
32 changes: 19 additions & 13 deletions test/system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ def test_install_nwp_test_cpu_cce(self):
def test_install_exclaim_test_gpu_dsl(self):
spack_env_dev_install_and_test(
'config/cscs/spack/v0.18.1.7/daint_dsl_nvhpc',
'[email protected]:C2SM/icon.git',
'ci_dsl',
'[email protected]:abishekg7/icon.git',
abishekg7 marked this conversation as resolved.
Show resolved Hide resolved
'patch1',
abishekg7 marked this conversation as resolved.
Show resolved Hide resolved
'icon',
build_on_login_node=True)

Expand Down Expand Up @@ -645,19 +645,22 @@ def test_install_default(self):
@pytest.mark.no_tsa # Irrelevant
class PyGt4pyTest(unittest.TestCase):

def test_install_version_1_1_1(self):
spack_install_and_test('py-gt4py @1.1.1')
def test_install_version_1_0_1_1(self):
spack_install_and_test('py-gt4py @1.0.1.1')

def test_install_version_1_0_1_1b(self):
spack_install_and_test('py-gt4py @1.0.1.1b')

def test_install_version_1_1_2(self):
spack_install_and_test('py-gt4py @1.1.2')
def test_install_version_1_0_1_2(self):
spack_install_and_test('py-gt4py @1.0.1.2')

@pytest.mark.no_daint # fails with ModuleNotFoundError: No module named 'dace'
@pytest.mark.no_balfrin # fails with ModuleNotFoundError: No module named 'dace'
def test_install_version_1_1_3(self):
spack_install_and_test('py-gt4py @1.1.3')
def test_install_version_1_0_1_3(self):
spack_install_and_test('py-gt4py @1.0.1.3')

def test_install_version_1_1_4(self):
spack_install_and_test('py-gt4py @1.1.4')
def test_install_version_1_0_1_4(self):
spack_install_and_test('py-gt4py @1.0.1.4')


class PyHatchlingTest(unittest.TestCase):
Expand All @@ -669,15 +672,18 @@ def test_install_default(self):
@pytest.mark.no_tsa # py-isort install fails with: No module named 'poetry'.
class PyIcon4pyTest(unittest.TestCase):

def test_install_version_0_0_3(self):
spack_install_and_test('py-icon4py @ 0.0.3.1 %gcc ^[email protected]')

def test_install_version_0_0_5(self):
spack_install_and_test('py-icon4py @ 0.0.5 %gcc ^[email protected]')
spack_install_and_test('py-icon4py @ 0.0.5 %gcc ^py-gt4py@1.0.1.1')

def test_install_version_0_0_6(self):
spack_install_and_test('py-icon4py @ 0.0.6 %gcc ^[email protected]')
spack_install_and_test('py-icon4py @ 0.0.6 %gcc ^py-gt4py@1.0.1.2')

def test_install_version_0_0_7(self):
spack_install_and_test(
'py-icon4py @ 0.0.7 %gcc ^[email protected] ^[email protected]')
'py-icon4py @ 0.0.7 %gcc ^py-gt4py@1.0.1.3 ^[email protected]')


class PyInflectionTest(unittest.TestCase):
Expand Down
Loading