Skip to content

Commit

Permalink
Fix mypy errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Sep 26, 2024
1 parent 3b6e0bd commit 16d3ff5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/fab/tools/psyclone.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def check_available(self) -> bool:

# Search for the version info:
exp = r"PSyclone version: (\d[\d.]+\d)"
print("VERSION [", version_output, "]")
matches = re.search(exp, version_output)
if not matches:
warnings.warn(f"Unexpected version information for PSyclone: "
Expand Down Expand Up @@ -151,7 +150,6 @@ def process(self,
# as parameter. No API is required if PSyclone works as
# transformation tool only, so calling PSyclone without api is
# actually valid.
print("API", api, self._version)
if api:
if self._version > (2, 5, 0):
api_param = "--psykal-dsl"
Expand All @@ -163,10 +161,16 @@ def process(self,
# Mapping from new names to old names:
mapping = {"lfric": "dynamo0.3",
"gocean": "gocean1.0"}

# Make mypy happy - we tested above that these variables
# are defined
assert psy_file
assert alg_file
parameters.extend([api_param, mapping.get(api, api),
"-opsy", psy_file, "-oalg", alg_file])
else: # no api
# Make mypy happy - we tested above that transformed_file is
# specified when no api is specified.
assert transformed_file
if self._version > (2, 5, 0):
# New version: no API, parameter, but -o for output name:
parameters.extend(["-o", transformed_file])
Expand Down

0 comments on commit 16d3ff5

Please sign in to comment.