From fd8f2f0d9d3ee8558be268b7d3fbf1e0b5b4dd26 Mon Sep 17 00:00:00 2001 From: Gui Castelao Date: Thu, 18 Apr 2024 09:57:16 -0600 Subject: [PATCH 1/2] style: Fixing some extra blank lines Missed those issues on PR #200. Somehow those didn't show up in the last check before commit it. --- sup3r/preprocessing/data_handling/base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sup3r/preprocessing/data_handling/base.py b/sup3r/preprocessing/data_handling/base.py index 0b4f61b971..fce41141d6 100644 --- a/sup3r/preprocessing/data_handling/base.py +++ b/sup3r/preprocessing/data_handling/base.py @@ -1327,8 +1327,11 @@ def lin_bc(self, bc_files, threshold=0.1): self.data[..., idf] += adder completed.append(feature) - - def qdm_bc(self, bc_files, reference_feature, relative=True, threshold=0.1): + def qdm_bc(self, + bc_files, + reference_feature, + relative=True, + threshold=0.1): """Bias Correction using Quantile Delta Mapping Bias correct this DataHandler's data with Quantile Delta Mapping. The @@ -1378,9 +1381,6 @@ def qdm_bc(self, bc_files, reference_feature, relative=True, threshold=0.1): completed.append(feature) - - - # pylint: disable=W0223 class DataHandlerDC(DataHandler): """Data-centric data handler""" From 3c3586967a32780c45bbd3f5b0f1f5376f4e826f Mon Sep 17 00:00:00 2001 From: Gui Castelao Date: Thu, 18 Apr 2024 10:02:30 -0600 Subject: [PATCH 2/2] feat: Missing opportunity at local_qdm_bc() to define threshold Before it would necessarily only use the default. --- sup3r/bias/bias_transforms.py | 4 +++- sup3r/preprocessing/data_handling/base.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sup3r/bias/bias_transforms.py b/sup3r/bias/bias_transforms.py index e7ee128c18..09c31d3d6f 100644 --- a/sup3r/bias/bias_transforms.py +++ b/sup3r/bias/bias_transforms.py @@ -403,6 +403,7 @@ def local_qdm_bc(data: np.array, base_dset: str, feature_name: str, bias_fp, + threshold=0.1, relative=True, no_trend=False): """Bias correction using QDM @@ -482,7 +483,8 @@ def local_qdm_bc(data: np.array, base, bias, bias_fut, cfg = get_spatial_bc_quantiles(lat_lon, base_dset, feature_name, - bias_fp) + bias_fp, + threshold) if no_trend: mf = None diff --git a/sup3r/preprocessing/data_handling/base.py b/sup3r/preprocessing/data_handling/base.py index fce41141d6..82d7961a39 100644 --- a/sup3r/preprocessing/data_handling/base.py +++ b/sup3r/preprocessing/data_handling/base.py @@ -1376,8 +1376,9 @@ def qdm_bc(self, self.lat_lon, reference_feature, feature, - fp, - relative) + bias_fp=fp, + threshold=threshold, + relative=relative) completed.append(feature)