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.
0
1 parent 67249a5 commit b2cdf13Copy full SHA for b2cdf13
deepsensor/data/loader.py
@@ -305,9 +305,13 @@ def sample_da(
305
elif not self.discrete_xarray_sampling:
306
if N == 0:
307
# Catch zero-context edge case before interp fails
308
- return np.array([[], []], dtype=self.dtype), np.array(
309
- [], dtype=self.dtype
310
- )
+ X_c = np.zeros((2, 0), dtype=self.dtype)
+ if isinstance(da, xr.Dataset):
+ dim = len(da.data_vars) # Multiple data variables
311
+ elif isinstance(da, xr.DataArray):
312
+ dim = 1 # Single data variable
313
+ Y_c = np.zeros((dim, 0), dtype=self.dtype)
314
+ return X_c, Y_c
315
x1 = rng.uniform(da.coords["x1"].min(), da.coords["x1"].max(), N)
316
x2 = rng.uniform(da.coords["x2"].min(), da.coords["x2"].max(), N)
317
Y_c = da.interp(
0 commit comments