From b65fea8627583a08954abe2a06ba6c8589ac521e Mon Sep 17 00:00:00 2001 From: sanderh Date: Wed, 30 Aug 2023 10:50:36 +0200 Subject: [PATCH 1/2] :recycle: loop over constituents, then open boundaries --- adcircpy/fort15.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adcircpy/fort15.py b/adcircpy/fort15.py index 8e696105..42343ac8 100644 --- a/adcircpy/fort15.py +++ b/adcircpy/fort15.py @@ -606,10 +606,10 @@ def get_tidal_forcing(self) -> str: # f'{len(self.mesh.open_boundaries)}', ] ) - for index, row in self.mesh.boundaries.ocean.gdf.iterrows(): for constituent in self.mesh.forcings.tides.get_active_constituents(): f.append(fort15_line(constituent)) - vertices = self.mesh.get_xy(crs='EPSG:4326').iloc[row.indexes, :].values + for index, row in self.mesh.boundaries.ocean.gdf.iterrows(): + vertices = self.mesh.get_xy(crs='EPSG:4326').loc[row.indexes, :].values amp, phase = self.mesh.forcings.tides.tidal_dataset(constituent, vertices) f.extend( fort15_line(f'{amp[i]:.8e} {phase[i]:.8e}') From 3b0c6b20887f87e25574550a329c472d6f0205d2 Mon Sep 17 00:00:00 2001 From: sanderh Date: Wed, 30 Aug 2023 16:02:00 +0200 Subject: [PATCH 2/2] :recycle: process reviewer comments --- adcircpy/fort15.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adcircpy/fort15.py b/adcircpy/fort15.py index 42343ac8..21f6ec3d 100644 --- a/adcircpy/fort15.py +++ b/adcircpy/fort15.py @@ -606,10 +606,10 @@ def get_tidal_forcing(self) -> str: # f'{len(self.mesh.open_boundaries)}', ] ) - for constituent in self.mesh.forcings.tides.get_active_constituents(): - f.append(fort15_line(constituent)) + for constituent in self.mesh.forcings.tides.get_active_constituents(): + f.append(fort15_line(constituent)) for index, row in self.mesh.boundaries.ocean.gdf.iterrows(): - vertices = self.mesh.get_xy(crs='EPSG:4326').loc[row.indexes, :].values + vertices = self.mesh.get_xy(crs='EPSG:4326').iloc[row.indexes, :].values amp, phase = self.mesh.forcings.tides.tidal_dataset(constituent, vertices) f.extend( fort15_line(f'{amp[i]:.8e} {phase[i]:.8e}')