You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the PointwiseDownscaler BCSD temperature and precip models are failing because the BCSD temp and precip objects lose their _check_n_features attribute when applied to a dataarray/dataset with the PointwiseDownscaler wrapper function. The supporting stack trace:
<timed exec> in <module>
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/xarray/core/dataarray.py in load(self, **kwargs)
806 dask.array.compute
807 """
--> 808 ds = self._to_temp_dataset().load(**kwargs)
809 new = self._from_temp_dataset(ds)
810 self._variable = new._variable
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/xarray/core/dataset.py in load(self, **kwargs)
652
653 # evaluate all the dask arrays simultaneously
--> 654 evaluated_data = da.compute(*lazy_data.values(), **kwargs)
655
656 for k, data in zip(lazy_data, evaluated_data):
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/dask/base.py in compute(*args, **kwargs)
434 keys = [x.__dask_keys__() for x in collections]
435 postcomputes = [x.__dask_postcompute__() for x in collections]
--> 436 results = schedule(dsk, keys, **kwargs)
437 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
438
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/distributed/client.py in get(self, dsk, keys, restrictions, loose_restrictions, resources, sync, asynchronous, direct, retries, priority, fifo_timeout, actors, **kwargs)
2570 should_rejoin = False
2571 try:
-> 2572 results = self.gather(packed, asynchronous=asynchronous, direct=direct)
2573 finally:
2574 for f in futures.values():
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/distributed/client.py in gather(self, futures, errors, direct, asynchronous)
1870 direct=direct,
1871 local_worker=local_worker,
-> 1872 asynchronous=asynchronous,
1873 )
1874
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/distributed/client.py in sync(self, func, asynchronous, callback_timeout, *args, **kwargs)
765 else:
766 return sync(
--> 767 self.loop, func, *args, callback_timeout=callback_timeout, **kwargs
768 )
769
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/distributed/utils.py in sync(loop, func, callback_timeout, *args, **kwargs)
332 if error[0]:
333 typ, exc, tb = error[0]
--> 334 raise exc.with_traceback(tb)
335 else:
336 return result[0]
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/distributed/utils.py in f()
316 if callback_timeout is not None:
317 future = gen.with_timeout(timedelta(seconds=callback_timeout), future)
--> 318 result[0] = yield future
319 except Exception as exc:
320 error[0] = sys.exc_info()
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/tornado/gen.py in run(self)
760
761 try:
--> 762 value = future.result()
763 except Exception:
764 exc_info = sys.exc_info()
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/distributed/client.py in _gather(self, futures, errors, direct, local_worker)
1726 exc = CancelledError(key)
1727 else:
-> 1728 raise exception.with_traceback(traceback)
1729 raise exc
1730 if errors == "skip":
/opt/conda/envs/downscale_latest_latest/lib/python3.7/site-packages/xarray/core/parallel.py in _wrapper()
282 ]
283
--> 284 result = func(*converted_args, **kwargs)
285
286 # check all dims are present
/opt/conda/lib/python3.7/site-packages/skdownscale/pointwise_models/core.py in _fit_wrapper()
/opt/conda/lib/python3.7/site-packages/skdownscale/pointwise_models/bcsd.py in fit()
/opt/conda/lib/python3.7/site-packages/skdownscale/pointwise_models/base.py in _validate_data()
AttributeError: 'BcsdTemperature' object has no attribute '_check_n_features'
This is also evident when comparing the attributes using the dir() function between BCSD objects versus the same objects wrapped by PointwiseDownscaler. For example:
It appears that this is coming directly from how we're passing the BCSD object around in the _fit_wrapper function, e.g. here: https://github.com/jhamman/scikit-downscale/blob/master/skdownscale/pointwise_models/core.py#L68. This should be pretty straightforward to fix, looks like copy.deepcopy just isn't getting methods but thought it was worth a design considerations conversation before a PR fix.
Currently the
PointwiseDownscaler
BCSD temperature and precip models are failing because the BCSD temp and precip objects lose their_check_n_features
attribute when applied to a dataarray/dataset with thePointwiseDownscaler
wrapper function. The supporting stack trace:This is also evident when comparing the attributes using the
dir()
function between BCSD objects versus the same objects wrapped byPointwiseDownscaler
. For example:versus
It appears that this is coming directly from how we're passing the BCSD object around in the
_fit_wrapper
function, e.g. here: https://github.com/jhamman/scikit-downscale/blob/master/skdownscale/pointwise_models/core.py#L68. This should be pretty straightforward to fix, looks likecopy.deepcopy
just isn't getting methods but thought it was worth a design considerations conversation before a PR fix.cc @jhamman
The text was updated successfully, but these errors were encountered: