Skip to content

Commit

Permalink
Merge pull request #352 from douglasjacobsen/revert_expander_fixes
Browse files Browse the repository at this point in the history
Revert expander fixes
  • Loading branch information
rfbgo authored Dec 14, 2023
2 parents dabf06f + 7e0b3d9 commit f3b0bfe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
7 changes: 0 additions & 7 deletions lib/ramble/ramble/expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,6 @@ def perform_math_eval(self, in_str):
"""
try:
math_ast = ast.parse(in_str, mode='eval')
# If the only node in the AST is a constant, return an unmodified
# in_str.
is_num_const = isinstance(math_ast.body, ast.Constant) and \
hasattr(math_ast.body, 'value')
backport_num_const = isinstance(math_ast.body, ast.Num) and hasattr(math_ast.body, 'n')
if is_num_const or backport_num_const:
return in_str
out_str = self.eval_math(math_ast.body)
return out_str
except MathEvaluationError as e:
Expand Down
2 changes: 2 additions & 0 deletions lib/ramble/ramble/test/expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def exp_dict():
'var2': '{var3}',
'var3': '3',
'decimal.06.var': 'foo',
'size': '0000.96'
}


Expand All @@ -51,6 +52,7 @@ def exp_dict():
('{{n_ranks}+2}', '6'),
('{{n_ranks}*{var{processes_per_node}}:05d}', '00012'),
('{{n_ranks}-1}', '3'),
('{{{n_ranks}/2}:0.0f}', '2')
]
)
def test_expansions(input, output):
Expand Down
4 changes: 2 additions & 2 deletions var/ramble/repos/builtin/applications/gromacs/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ class Gromacs(SpackApplication):
description='Workload type.',
values=['pme', 'rf'],
workloads=['water_gmx50', 'water_bare'])
workload_variable('input_path', default='{water_gmx50_bare}/{size}',
workload_variable('input_path', default='{water_gmx50_bare}/*{size}',
description='Input path for water GMX50',
workload='water_gmx50')
workload_variable('input_path', default='{water_bare_hbonds}/{size}',
workload_variable('input_path', default='{water_bare_hbonds}/*{size}',
description='Input path for water bare hbonds',
workload='water_bare')
workload_variable('input_path', default='{lignocellulose}/lignocellulose-rf.tpr',
Expand Down

0 comments on commit f3b0bfe

Please sign in to comment.