Skip to content

Commit

Permalink
Merge pull request #852 from dopplershift/cleanup-ncss-warnings
Browse files Browse the repository at this point in the history
Cleanup NCSS warnings
  • Loading branch information
dopplershift authored Dec 11, 2024
2 parents f913ddb + 63eb3ab commit 7aa5353
Show file tree
Hide file tree
Showing 4 changed files with 1,218 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/siphon/ncss_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def handle_typed_values(val, type_name, value_type):
"""
if value_type in ['byte', 'short', 'int', 'long']:
try:
val = [int(v) for v in re.split('[ ,]', val) if v]
if val := val.strip('[]'):
val = [int(v) for v in re.split('[ ,]', val) if v]
else:
return [0]
except ValueError:
log.warning('Cannot convert "%s" to int. Keeping type as str.', val)
elif value_type in ['float', 'double']:
Expand Down
Loading

0 comments on commit 7aa5353

Please sign in to comment.