Repository: climate Updated Branches: refs/heads/master 1aa5a98e2 -> 16380c165
CLIMATE-704 - Sensitivity of spatial boundary check in dataset_processor - ocw.dataset_processor._are_bounds_contained_by_dataset has been updated to make it less sensitive to very small differences in spatial boundary limits Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/3443b2af Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/3443b2af Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/3443b2af Branch: refs/heads/master Commit: 3443b2af57dd30b25e73cbe098c9723e0a4b09c2 Parents: 1aa5a98 Author: huikyole <[email protected]> Authored: Wed Nov 11 10:56:33 2015 -0800 Committer: huikyole <[email protected]> Committed: Wed Nov 11 10:56:33 2015 -0800 ---------------------------------------------------------------------- ocw/dataset_processor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/3443b2af/ocw/dataset_processor.py ---------------------------------------------------------------------- diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py index 90e644e..ea08680 100755 --- a/ocw/dataset_processor.py +++ b/ocw/dataset_processor.py @@ -1093,19 +1093,19 @@ def _are_bounds_contained_by_dataset(bounds, dataset): errors = [] # TODO: THIS IS TERRIBLY inefficent and we need to use a geometry lib instead in the future - if not lat_min <= bounds.lat_min <= lat_max: + if not np.round(lat_min,3) <= np.round(bounds.lat_min,3) <= np.round(lat_max,3): error = "bounds.lat_min: %s is not between lat_min: %s and lat_max: %s" % (bounds.lat_min, lat_min, lat_max) errors.append(error) - if not lat_min <= bounds.lat_max <= lat_max: + if not np.round(lat_min,3) <= np.round(bounds.lat_max,3) <= np.round(lat_max,3): error = "bounds.lat_max: %s is not between lat_min: %s and lat_max: %s" % (bounds.lat_max, lat_min, lat_max) errors.append(error) - if not lon_min <= bounds.lon_min <= lon_max: + if not np.round(lon_min,3) <= np.round(bounds.lon_min,3) <= np.round(lon_max,3): error = "bounds.lon_min: %s is not between lon_min: %s and lon_max: %s" % (bounds.lon_min, lon_min, lon_max) errors.append(error) - if not lon_min <= bounds.lon_max <= lon_max: + if not np.round(lon_min,3) <= np.round(bounds.lon_max,3) <= np.round(lon_max,3): error = "bounds.lon_max: %s is not between lon_min: %s and lon_max: %s" % (bounds.lon_max, lon_min, lon_max) errors.append(error)
