diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a0e748..bdb45bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # tpxo-tide-prediction - Changelog +## v0.2.5 (2024-01-18) + +Fixed issue #8 with `VERSION` file. + +## v0.2.4 (2023-01-31) + +Fixed issues #1 and #2 + ## v0.2.3 (2022-10-17) + Release for Zenodo DOI. No futher code changes. @@ -15,8 +24,8 @@ Minor bugfix. ### Changed - `utils.py` - - `subset_region()`: - - fix indexing when both minimum and maximum longitude are in between two grid nodes of loaded constituent netCDF files + - `subset_region()`: + - fix indexing when both minimum and maximum longitude are in between two grid nodes of loaded constituent netCDF files ## v0.2.1 (2022-06-02) @@ -25,11 +34,11 @@ Minor bugfixes. ### Changed - `predict_tide.py` - - `read_parameter_file()` - - fix error after parsing single time input from command line + - `read_parameter_file()` + - fix error after parsing single time input from command line - `utils.py` - - `subset_region()`: - - selecting only single position + - `subset_region()`: + - selecting only single position ## v0.2.0 (2022-04-24) @@ -44,16 +53,16 @@ Changed interpolation method from _cubic_ to _linear_ (according to [xarray.Data ### Changed - `predict_tide.py` - - changed default interpolation method to *linear* - - raise `MemoryError` if interpolated tide array is too huge to allocate - - use **only** associated timestamp for tide predition if `mode = 'track'` (more efficient!) + - changed default interpolation method to *linear* + - raise `MemoryError` if interpolated tide array is too huge to allocate + - use **only** associated timestamp for tide predition if `mode = 'track'` (more efficient!) - `utils.py` - - `subset_region()`: - - reworked indexing method - - changed default number of nodes to pad subset region from 10 to **3** - - `read_h_netCDFs()`: - - changed subset selection from _labeled_ (`.sel`) to _integer-based_ (`.isel`) - - changed default number of nodes to pad subset region from 10 to **3** + - `subset_region()`: + - reworked indexing method + - changed default number of nodes to pad subset region from 10 to **3** + - `read_h_netCDFs()`: + - changed subset selection from _labeled_ (`.sel`) to _integer-based_ (`.isel`) + - changed default number of nodes to pad subset region from 10 to **3** ## v0.1.1 (2022-02-27) diff --git a/VERSION b/VERSION deleted file mode 100644 index abd4105..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.2.4 diff --git a/setup.py b/setup.py index d79149f..4645ad7 100644 --- a/setup.py +++ b/setup.py @@ -2,28 +2,19 @@ import setuptools def read(fname, mode='r', encoding='utf-8'): - """ Wrapper for open() """ - return open(os.path.join(os.path.dirname(__file__), fname), - mode=mode, - encoding=encoding) + """Wrap open() function.""" + return open(os.path.join(os.path.dirname(__file__), 'tpxo_tide_prediction', fname), mode=mode, encoding=encoding) -def get_version(fname='VERSION'): - """ Retrieve package version from VERSION file """ - try: - with read(fname) as f: - version = f.read() - return version - except FileNotFoundError: - raise RuntimeError('Unable to find version string in file "VERSION"') - -with read('README.md') as f: +with open('README.md') as f: long_description = f.read() -# print(get_version()) +VERSION = {} +with read('_version.py') as fp: + exec(fp.read(), VERSION) setuptools.setup( name='tpxo-tide-prediction', - version=get_version(), + version=VERSION['__version__'], author='Fynn Warnke', author_email='fwrnke@mailbox.org', description='Predict tidal elevation based on TPXO9-atlas model', @@ -55,4 +46,4 @@ def get_version(fname='VERSION'): 'predict_tide=tpxo_tide_prediction.predict_tide:main', ], }, -) \ No newline at end of file +) diff --git a/tpxo_tide_prediction/__init__.py b/tpxo_tide_prediction/__init__.py index e80f999..1a8904d 100644 --- a/tpxo_tide_prediction/__init__.py +++ b/tpxo_tide_prediction/__init__.py @@ -1,8 +1,7 @@ import os # noqa +from ._version import __version__ # noqa from .predict_tide import ( # noqa read_parameter_file, tide_predict, write_tides ) - -__version__ = open(os.path.join(os.path.dirname(__file__), '../VERSION')).read().rstrip('\n') diff --git a/tpxo_tide_prediction/_version.py b/tpxo_tide_prediction/_version.py new file mode 100644 index 0000000..13a85f7 --- /dev/null +++ b/tpxo_tide_prediction/_version.py @@ -0,0 +1 @@ +__version__ = '0.2.5'