File tree Expand file tree Collapse file tree
test_aodn_cloud_optimised Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,7 +327,9 @@ def create_cluster(self):
327327 client ,
328328 cluster ,
329329 self .cluster_mode ,
330- ) = self .cluster_manager .create_cluster () # self.cluster_mode is overwritten if necessary
330+ ) = (
331+ self .cluster_manager .create_cluster ()
332+ ) # self.cluster_mode is overwritten if necessary
331333
332334 return client , cluster
333335
Original file line number Diff line number Diff line change @@ -2546,9 +2546,9 @@ def plot_gridded_variable(
25462546 start_date_parsed = pd .to_datetime (date_start )
25472547 end_date_parsed = pd .to_datetime (date_end ) if date_end else None
25482548
2549- assert actual_time_name in ds . dims , (
2550- f"Dataset does not have a ' { actual_time_name } ' dimension"
2551- )
2549+ assert (
2550+ actual_time_name in ds . dims
2551+ ), f"Dataset does not have a ' { actual_time_name } ' dimension"
25522552
25532553 # Find the nearest date in the dataset to start_date_parsed
25542554 try :
@@ -2614,9 +2614,7 @@ def plot_gridded_variable(
26142614 # First pass: gather all data to find global vmin and vmax for consistent color scaling
26152615 for date_obj in dates_to_plot :
26162616 try :
2617- data = ds [
2618- var_name
2619- ].sel (
2617+ data = ds [var_name ].sel (
26202618 {
26212619 actual_time_name : date_obj , # Use exact match for already selected dates
26222620 actual_lon_name : slice (
Original file line number Diff line number Diff line change 44import traceback
55import uuid
66import warnings
7+ from contextlib import nullcontext
78from functools import partial
89
910import numcodecs
1213import xarray as xr
1314import zarr
1415from dask import array as da
16+ from dask .distributed import Lock
1517from xarray .structure .merge import MergeError
1618
1719from aodn_cloud_optimised .lib .CommonHandler import CommonHandler
2325 split_s3_path ,
2426)
2527from aodn_cloud_optimised .lib .schema import merge_schema_dict
26- from contextlib import nullcontext
27- from dask .distributed import Lock
2828
2929
3030def check_variable_values_dask (
Original file line number Diff line number Diff line change @@ -388,7 +388,9 @@ def test_zarr_nc_acorn_nwa_handler(self):
388388 ucur_selected = ds ["UCUR" ].isel ({time_dim : matching_idx }).compute ().values
389389
390390 # Assert they are all NaN
391- assert not np .isnan (ucur_selected ).all (), (
391+ assert not np .isnan (
392+ ucur_selected
393+ ).all (), (
392394 f"UCUR for { filenames_acorn_nwa [1 ]} are already fully NaN. Not possible"
393395 )
394396
@@ -408,9 +410,9 @@ def test_zarr_nc_acorn_nwa_handler(self):
408410 ucur_selected = ds ["UCUR" ].isel ({time_dim : matching_idx }).compute ().values
409411
410412 # Assert they are all NaN
411- assert np .isnan (ucur_selected ). all (), (
412- f"UCUR for { filenames_acorn_nwa [ 1 ] } not fully NaN"
413- )
413+ assert np .isnan (
414+ ucur_selected
415+ ). all (), f"UCUR for { filenames_acorn_nwa [ 1 ] } not fully NaN"
414416
415417
416418if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments