Skip to content

Commit 3efbd14

Browse files
nkarasiakgithub-actions[bot]
authored andcommitted
style(ruff) : automatic lint/format
1 parent 5453e36 commit 3efbd14

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

earthdaily/earthdatastore/__init__.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def datacube(
639639
if intersects is not None:
640640
intersects = cube_utils.GeometryManager(intersects).to_geopandas()
641641
self.intersects = intersects
642-
642+
643643
if mask_with:
644644
if mask_with not in mask._available_masks:
645645
raise NotImplementedError(
@@ -686,7 +686,6 @@ def datacube(
686686
"No cross calibration coefficient available for the specified collections."
687687
)
688688

689-
690689
xr_datacube = datacube(
691690
items,
692691
intersects=intersects,
@@ -747,32 +746,33 @@ def datacube(
747746

748747
Mask = mask.Mask(xr_datacube, intersects=intersects, bbox=bbox)
749748
xr_datacube = getattr(Mask, mask_with)(**mask_kwargs)
750-
751-
749+
752750
if groupby_date:
753751
xr_datacube = xr_datacube.groupby("time.date", restore_coord_dims=True)
754-
xr_datacube = getattr(xr_datacube, groupby_date)().rename(dict(date="time"))
752+
xr_datacube = getattr(xr_datacube, groupby_date)().rename(
753+
dict(date="time")
754+
)
755755
xr_datacube["time"] = xr_datacube.time.astype("<M8[ns]")
756-
756+
757757
if clear_cover or mask_statistics:
758-
759758
first_var = xr_datacube[list(xr_datacube.data_vars)[0]]
760759
xy = first_var.isel(time=0).size
761-
760+
762761
null_pixels = (first_var.isnull().sum(dim=("x", "y"))).values
763-
n_pixels_as_labels = xy -null_pixels
762+
n_pixels_as_labels = xy - null_pixels
764763
# n_pixels_as_labels = xr_datacube.attrs["usable_pixels"] - n_pixels_as_labels
765-
764+
766765
xr_datacube = xr_datacube.assign_coords(
767766
{"clear_pixels": ("time", n_pixels_as_labels)}
768767
)
769-
768+
770769
xr_datacube = xr_datacube.assign_coords(
771770
{
772771
"clear_percent": (
773772
"time",
774773
np.multiply(
775-
n_pixels_as_labels / xr_datacube.attrs["usable_pixels"],
774+
n_pixels_as_labels
775+
/ xr_datacube.attrs["usable_pixels"],
776776
100,
777777
).astype(np.int8),
778778
)
@@ -781,8 +781,6 @@ def datacube(
781781
if clear_cover:
782782
xr_datacube = mask.filter_clear_cover(xr_datacube, clear_cover)
783783

784-
785-
786784
return xr_datacube
787785

788786
def _update_search_for_assets(self, assets):

0 commit comments

Comments
 (0)