We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option:
The text was updated successfully, but these errors were encountered:
Need to discuss whether this is really necessary: do we need locationwise arguments also for glm based debiasing?
# Helpers @staticmethod def _unpack_locationwise_args_and_get_locationwise_info(locationwise_args, i, j): return { key: value[ :, i, j, ] for key, value in locationwise_args.items() } @staticmethod def map_over_locations(func, output_size, obs, cm_hist, cm_future, locationwise_args=None, **kwargs): output = np.empty(output_size, dtype=cm_future.dtype) if locationwise_args is None: for i, j in tqdm(np.ndindex(obs.shape[1:]), total=np.prod(obs.shape[1:])): output[:, i, j] = func(obs[:, i, j], cm_hist[:, i, j], cm_future[:, i, j], **kwargs) else: for i, j in tqdm(np.ndindex(obs.shape[1:]), total=np.prod(obs.shape[1:])): output[:, i, j] = func( obs[:, i, j], cm_hist[:, i, j], cm_future[:, i, j], Debiaser._unpack_locationwise_args_and_get_locationwise_info(locationwise_args, i, j), **kwargs, ) return output # Apply functions: def apply_location(self, obs, cm_hist, cm_future, locationwise_args, **kwargs): raise NotImplementedError( "apply_location is an abstract method which needs to be overriden in derived classes." ) def apply(self, obs, cm_hist, cm_future, locationwise_args=None, **kwargs): print("----- Running debiasing -----") Debiaser.check_inputs(obs, cm_hist, cm_future) output = Debiaser.map_over_locations( self.apply_location, output_size=cm_future.shape, obs=obs, cm_hist=cm_hist, cm_future=cm_future, locationwise_args=locationwise_args, **kwargs, ) return output
Sorry, something went wrong.
No branches or pull requests
Option:
The text was updated successfully, but these errors were encountered: