Skip to content

Commit 9e10ba3

Browse files
committed
flexibility if only one timestep
1 parent 76589b7 commit 9e10ba3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pygeoapi/provider/xarray_.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,12 @@ def gen_covjson(self, metadata, data, fields):
345345

346346
if self.time_field is not None:
347347
cj['domain']['axes']['t'] = {
348-
'values': [str(v) for v in data[self.time_field].values]
348+
'values': [str(v) for v in (
349+
[data[self.time_field].values]
350+
if np.isscalar(data[self.time_field].values)
351+
else data[self.time_field].values
352+
)
353+
]
349354
}
350355
cj['domain']['referencing'].append({
351356
'coordinates': ['t'],

0 commit comments

Comments
 (0)