Skip to content

Commit 68a0640

Browse files
authored
Merge pull request #4235 from GEOS-ESM/feature/wdboggs/acg3_add_export_name
Implement & test EXPORT_NAME column for ACG3
2 parents 8ff80b1 + 63d218a commit 68a0640

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

.github/workflows/workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ jobs:
142142

143143
build_gcm:
144144
strategy:
145+
fail-fast: false
145146
matrix:
146147
compiler: [ifort, gfortran-14, gfortran-15]
147148
build-type: [Debug]

Apps/MAPL_GridCompSpecs_ACGv3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
ARRAY = 'array'
5757
CONDITION = 'condition'
5858
DIMS = 'dims'
59+
EXPORT_NAME = 'export_name'
5960
INTENT_ARG = 'intent_arg'
6061
INTERNAL_NAME = 'internal_name'
6162
MANGLED = 'mangled'
@@ -152,6 +153,7 @@ def get_options(args):
152153
'attributes' : {MAPPING: STRINGVECTOR},
153154
CONDITION: {FLAGS: {STORE}},
154155
'dependencies': {MAPPING: STRINGVECTOR},
156+
EXPORT_NAME: {MAPPING: STRING},
155157
'itemtype': {},
156158
'orientation': {},
157159
'regrid_method': {},

Apps/tests/acg3/acg3_unittests.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from functools import reduce, partial
66
from operator import concat
77
from collections import namedtuple
8+
from collections.abc import Sequence
89
import sys
910
import MAPL_GridCompSpecs_ACGv3 as acg3
1011

@@ -114,6 +115,26 @@ def test_compute_rank_None(self):
114115
r = acg3.compute_rank('txyz', UNGRIDDED)
115116
self.assertIsNone(r, m)
116117

118+
def test_string_mapping(self):
119+
options = acg3.get_options({})
120+
column_name = acg3.EXPORT_NAME
121+
column_value = 'ZYZZY'
122+
specs = [{column_name: column_value}]
123+
values = acg3.get_values(specs, options)
124+
self.assertIsInstance(values, Sequence)
125+
specs_values, *_ = values
126+
self.assertIsInstance(specs_values, Sequence)
127+
spec_values, *_ = specs_values
128+
self.assertIsInstance(spec_values, dict)
129+
val = spec_values.get(column_name)
130+
self.assertIsInstance(val, str)
131+
self.assertTrue(len(val) >= 2)
132+
first, *middle, last = val
133+
self.assertEqual(last, first)
134+
self.assertIn(first, r'\'"')
135+
middle = ''.join(middle)
136+
self.assertEqual(middle, column_value)
137+
117138
class TestHelpers(unittest.TestCase):
118139

119140
def test_isiterable(self):

0 commit comments

Comments
 (0)