From d5f733b37b37f32d425c711414cc37c85c8d9603 Mon Sep 17 00:00:00 2001 From: Sarith Mahanama Date: Tue, 2 Jul 2024 13:05:44 -0400 Subject: [PATCH 1/2] Dask warning in Python 3.10 was addressed --- lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py b/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py index d35e17a53..8d5673e8e 100644 --- a/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py +++ b/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py @@ -39,6 +39,7 @@ import cartopy.io.img_tiles as cimgt import shapely.geometry as sgeom import requests +import dask import PIL import numpy as np mpl.use('pdf') @@ -544,9 +545,10 @@ def preproc(ds_): def crop (limits, lat, lon, xrin): ''' crops a data set''' - xr_lon = (lon >= limits[2]) & (lon <= limits[3]) - xr_lat = (lat >= limits[0]) & (lat <= limits[1]) - crop_xcm = xrin.where(xr_lon & xr_lat, drop=True) + with dask.config.set(**{'array.slicing.split_large_chunks': True}): + xr_lon = (lon >= limits[2]) & (lon <= limits[3]) + xr_lat = (lat >= limits[0]) & (lat <= limits[1]) + crop_xcm = xrin.where(xr_lon & xr_lat, drop=True) return crop_xcm def getclosest_ij(lats,lons,latpt,lonpt): From 9bf02012f0cff5827abca64eeafac742677002a0 Mon Sep 17 00:00:00 2001 From: Sarith Mahanama Date: Tue, 2 Jul 2024 13:33:54 -0400 Subject: [PATCH 2/2] fixed another issue --- lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py b/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py index 8d5673e8e..12ed6db9d 100644 --- a/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py +++ b/lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py @@ -548,6 +548,8 @@ def crop (limits, lat, lon, xrin): with dask.config.set(**{'array.slicing.split_large_chunks': True}): xr_lon = (lon >= limits[2]) & (lon <= limits[3]) xr_lat = (lat >= limits[0]) & (lat <= limits[1]) + xr_lon = xr_lon.compute() + xr_lat = xr_lat.compute() crop_xcm = xrin.where(xr_lon & xr_lat, drop=True) return crop_xcm