We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9eea92f commit 3c43d31Copy full SHA for 3c43d31
niworkflows/utils/misc.py
@@ -91,11 +91,16 @@ def get_template_specs(
91
# Verify resolution is valid
92
if fallback:
93
res = template_spec['resolution']
94
- if res and not isinstance(res, list):
95
- res = [int(res)]
+ if not isinstance(res, list):
+ try:
96
+ res = [int(res)]
97
+ except Exception:
98
+ res = None
99
+ if res is None:
100
+ res = []
101
102
available_resolutions = tf.TF_LAYOUT.get_resolutions(template=in_template)
- if res and not set(res) & set(available_resolutions):
103
+ if not (set(res) & set(available_resolutions)):
104
fallback_res = available_resolutions[0] if available_resolutions else None
105
warnings.warn(
106
f"Template {in_template} does not have resolution: {res}."
0 commit comments