Skip to content

Commit

Permalink
use appdirs to store TPXO dataset file
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Mar 5, 2021
1 parent cee6d90 commit 79b0d83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions adcircpy/forcing/tides/tpxo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
from os import PathLike
from pathlib import Path
import sys

import appdirs
from netCDF4 import Dataset
import numpy as np
from scipy.interpolate import griddata
Expand All @@ -13,7 +13,7 @@
class TPXO(TidalDataset):
CONSTITUENTS = ['M2', 'S2', 'N2', 'K2', 'K1', 'O1', 'P1', 'Q1', 'Mm', 'Mf',
'M4', 'MN4', 'MS4', '2N2', 'S1']
DEFAULT_PATH = Path(sys.executable).parent.parent / 'lib' / 'h_tpxo9.v1.nc'
DEFAULT_PATH = Path(appdirs.user_data_dir('tpxo')) / 'h_tpxo9.v1.nc'

def __init__(self, tpxo_dataset_filename: PathLike = None):
if tpxo_dataset_filename is None:
Expand All @@ -40,7 +40,6 @@ def __init__(self, tpxo_dataset_filename: PathLike = None):
f'"{self.DEFAULT_PATH}"'
)


def get_amplitude(
self,
constituent: str,
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
python_requires='>=3.6',
setup_requires=['dunamai', 'requests', 'setuptools>=41.2'],
install_requires=[
'appdirs',
'bs4',
'eventlet',
'fiona',
Expand Down

0 comments on commit 79b0d83

Please sign in to comment.