Skip to content

Commit 0196fb3

Browse files
committed
Fix rebase
1 parent b42618f commit 0196fb3

4 files changed

Lines changed: 15 additions & 13 deletions

File tree

aodn_cloud_optimised/lib/CommonHandler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

aodn_cloud_optimised/lib/DataQuery.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff 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(

aodn_cloud_optimised/lib/GenericZarrHandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import traceback
55
import uuid
66
import warnings
7+
from contextlib import nullcontext
78
from functools import partial
89

910
import numcodecs
@@ -12,6 +13,7 @@
1213
import xarray as xr
1314
import zarr
1415
from dask import array as da
16+
from dask.distributed import Lock
1517
from xarray.structure.merge import MergeError
1618

1719
from aodn_cloud_optimised.lib.CommonHandler import CommonHandler
@@ -23,8 +25,6 @@
2325
split_s3_path,
2426
)
2527
from aodn_cloud_optimised.lib.schema import merge_schema_dict
26-
from contextlib import nullcontext
27-
from dask.distributed import Lock
2828

2929

3030
def check_variable_values_dask(

test_aodn_cloud_optimised/test_generic_zarr_handler.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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

416418
if __name__ == "__main__":

0 commit comments

Comments
 (0)