improve io checks
This commit is contained in:
@@ -416,6 +416,9 @@ class RunSelector:
|
||||
|
||||
nums.sort()
|
||||
|
||||
if len(nums) == 0:
|
||||
return []
|
||||
|
||||
# -- Select either the first or last output from the list, or all the valid ones --
|
||||
if in_nums == "first":
|
||||
i = 0
|
||||
@@ -424,7 +427,7 @@ class RunSelector:
|
||||
if i < len(nums):
|
||||
nums = [nums[i]]
|
||||
else:
|
||||
nums = []
|
||||
return []
|
||||
elif in_nums == "last":
|
||||
i = len(nums) - 1
|
||||
while i >= 0 and not try_load_info(nums[i]):
|
||||
@@ -432,7 +435,7 @@ class RunSelector:
|
||||
if i >= 0:
|
||||
nums = [nums[i]]
|
||||
else:
|
||||
nums = []
|
||||
return []
|
||||
|
||||
# Be sure we have a namelist
|
||||
if self.fallback_nml and run not in self.namelist:
|
||||
@@ -466,13 +469,13 @@ class RunSelector:
|
||||
if imin is not None:
|
||||
nums = nums[imin:]
|
||||
else:
|
||||
nums = []
|
||||
return []
|
||||
if time_max is not None and len(nums) > 0:
|
||||
imax = search(nums, time_max, "left")
|
||||
if imax is not None:
|
||||
nums = nums[: imax + 1]
|
||||
else:
|
||||
nums = []
|
||||
return []
|
||||
|
||||
if time is not None and len(nums) > 0:
|
||||
filtered_nums = []
|
||||
|
||||
Reference in New Issue
Block a user