Skip to content

Commit

Permalink
Fix F-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
manishvenu committed Sep 26, 2024
1 parent d16fc4c commit 127c7ec
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions regional_mom6/regional_mom6.py
Original file line number Diff line number Diff line change
Expand Up @@ -2462,9 +2462,9 @@ def rectangular_brushcut(self):
# fill in NaNs
segment_out = (
segment_out.ffill(self.z)
.interpolate_na(f"{self.coords.attrs["parallel"]}_{self.segment_name}")
.ffill(f"{self.coords.attrs["parallel"]}_{self.segment_name}")
.bfill(f"{self.coords.attrs["parallel"]}_{self.segment_name}")
.interpolate_na(f"{self.coords.attrs['parallel']}_{self.segment_name}")
.ffill(f"{self.coords.attrs['parallel']}_{self.segment_name}")
.bfill(f"{self.coords.attrs['parallel']}_{self.segment_name}")
)

time = np.arange(
Expand Down Expand Up @@ -2528,7 +2528,7 @@ def rectangular_brushcut(self):

## Re-add the secondary dimension (even though it represents one value..)
segment_out[v] = segment_out[v].expand_dims(
f"{self.coords.attrs["perpendicular"]}_{self.segment_name}",
f"{self.coords.attrs['perpendicular']}_{self.segment_name}",
axis=self.coords.attrs["axis_to_expand"],
)

Expand Down Expand Up @@ -2574,15 +2574,15 @@ def rectangular_brushcut(self):
segment_out[f"eta_{self.segment_name}"] = segment_out[
f"eta_{self.segment_name}"
].expand_dims(
f"{self.coords.attrs["perpendicular"]}_{self.segment_name}",
f"{self.coords.attrs['perpendicular']}_{self.segment_name}",
axis=self.coords.attrs["axis_to_expand"] - 1,
)

# Overwrite the actual lat/lon values in the dimensions, replace with incrementing integers
segment_out[f"{self.coords.attrs["parallel"]}_{self.segment_name}"] = np.arange(
segment_out[f"{self.coords.attrs["parallel"]}_{self.segment_name}"].size
segment_out[f"{self.coords.attrs['parallel']}_{self.segment_name}"] = np.arange(
segment_out[f"{self.coords.attrs['parallel']}_{self.segment_name}"].size
)
segment_out[f"{self.coords.attrs["perpendicular"]}_{self.segment_name}"] = [0]
segment_out[f"{self.coords.attrs['perpendicular']}_{self.segment_name}"] = [0]
if self.orientation == "north":
self.hgrid_seg = self.hgrid.isel(nyp=[-1])
self.perpendicular = "ny"
Expand Down

0 comments on commit 127c7ec

Please sign in to comment.