Skip to content

Commit

Permalink
abstract call method
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Mar 5, 2021
1 parent 0505fb3 commit cee6d90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
9 changes: 8 additions & 1 deletion adcircpy/forcing/tides/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ def __call__(
constituent: str,
vertices: np.ndarray
) -> (np.ndarray, np.ndarray):
raise NotImplementedError
"""
get tidal ampltidue and phase
:param constituent: tidal constituent
:param vertices: XY locations at which to sample (Mx2)
:return: amplitude and phase arrays at given locations
"""
return self.get_amplitude(constituent, vertices), \
self.get_phase(constituent, vertices)

@abstractmethod
def get_amplitude(
Expand Down
7 changes: 0 additions & 7 deletions adcircpy/forcing/tides/hamtide.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ def __init__(self, hamtide_dataset_directory: PathLike = None):

self.datasets = datasets

def __call__(
self,
constituent: str,
vertices: np.ndarray
) -> (np.ndarray, np.ndarray):
return self.get_amplitude(constituent, vertices), \
self.get_phase(constituent, vertices)

def get_amplitude(
self,
Expand Down
7 changes: 0 additions & 7 deletions adcircpy/forcing/tides/tpxo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ def __init__(self, tpxo_dataset_filename: PathLike = None):
f'"{self.DEFAULT_PATH}"'
)

def __call__(self, constituent: str, vertices) -> (np.ndarray, np.ndarray):
"""
"method" can be 'spline' or any string accepted by griddata()'s method
kwarg.
"""
return self.get_amplitude(constituent, vertices), \
self.get_phase(constituent, vertices)

def get_amplitude(
self,
Expand Down

0 comments on commit cee6d90

Please sign in to comment.