We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7ce728 commit 2f7b77aCopy full SHA for 2f7b77a
clouddrift/analysis.py
@@ -1,5 +1,5 @@
1
import numpy as np
2
-from typing import Optional, Tuple, Union
+from typing import Optional, Tuple, Union, Iterable
3
import xarray as xr
4
import pandas as pd
5
from concurrent import futures
@@ -90,7 +90,8 @@ def apply_ragged(
90
with futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
91
res = executor.map(lambda x: func(*x, **kwargs), iter)
92
# concatenate the outputs
93
- res = list(res)
+ res = [item if isinstance(item, Iterable) else [item] for item in res]
94
+
95
if isinstance(res[0], tuple): # more than 1 parameter
96
outputs = []
97
for i in range(len(res[0])):
0 commit comments