@@ -32,7 +32,6 @@ def __init__(
3232 sel_dict : Optional [dict ] = None ,
3333 sel_dict_type : Optional [str ] = "isel" ,
3434 ):
35-
3635 self .fields = self ._validate_fields (xr_ds , fields )
3736 self .units : dict = self ._find_units (xr_ds )
3837 self .full_shape = xr_ds .data_vars [self .fields [0 ]].shape
@@ -60,7 +59,6 @@ def __init__(
6059 self .yt_coord_names = _convert_to_yt_internal_coords (self .selected_coords )
6160
6261 def _find_units (self , xr_ds ) -> dict :
63-
6462 units = {}
6563 for field in self .fields :
6664 unit = getattr (xr_ds [field ], "units" , "" )
@@ -70,7 +68,6 @@ def _find_units(self, xr_ds) -> dict:
7068 return units
7169
7270 def _find_starting_index (self , coordname , coord_da , coord_select ) -> int :
73-
7471 si = 0
7572 selector = coord_select [coordname ]
7673 if self .sel_dict_type == "isel" :
@@ -116,7 +113,6 @@ def _find_starting_index(self, coordname, coord_da, coord_select) -> int:
116113 return si
117114
118115 def _process_selection (self , xr_ds ):
119-
120116 # the full list of coordinates (in order)
121117 full_coords = list (xr_ds .data_vars [self .fields [0 ]].dims )
122118 time = 0.0
@@ -162,7 +158,6 @@ def _process_selection(self, xr_ds):
162158 is_time_dim = _check_for_time (c , coord_vals )
163159
164160 if coord_vals .size > 1 :
165-
166161 # not positive-monotonic? reverse it for cell width calculations
167162 # changes to indexing are accounted for when extracting data.
168163 if reverse_axis [- 1 ]:
@@ -220,7 +215,6 @@ def _process_selection(self, xr_ds):
220215 }
221216
222217 def _validate_fields (self , xr_ds , fields : List [str ]) -> List [str ]:
223-
224218 if fields is None :
225219 raise ValueError ("Please provide a list of fields" )
226220
@@ -232,7 +226,6 @@ def _validate_fields(self, xr_ds, fields: List[str]) -> List[str]:
232226 msg = "Provided fields must have the same "
233227
234228 for f in fields [1 :]:
235-
236229 if xr_ds .data_vars [f ].shape != shape :
237230 rmsg = msg + f"shape : { f } does not match { fields [0 ]} "
238231 raise RuntimeError (rmsg )
@@ -400,7 +393,6 @@ def _add_3rd_axis_name(yt_geometry: str, axis_order: list) -> list:
400393
401394
402395def _size_of_array_like (v ):
403-
404396 if isinstance (v , (np .ndarray , xr .DataArray )):
405397 return v .size
406398
0 commit comments