Skip to content

Commit 97884df

Browse files
authored
refactor: change 1 liner default EPSG to 4326 (#379)
* ci: bump version of upload artifact to v4
1 parent 1217432 commit 97884df

File tree

13 files changed

+302
-301
lines changed

13 files changed

+302
-301
lines changed

.github/workflows/python-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
verbose: true
9393
- name: Archive code coverage results
9494
if: steps.secrets.outputs.accessible == 'true'
95-
uses: actions/upload-artifact@v3
95+
uses: actions/upload-artifact@v4
9696
with:
9797
name: code-coverage-report
9898
path: ./coverage.xml

CODE_OF_CONDUCT.rst

Lines changed: 0 additions & 136 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Contributing
115115
############
116116

117117
This project contains work and contributions from the `scientific community <./CONTRIBUTORS.rst>`_.
118-
If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and the project `code of conduct <./CODE_OF_CONDUCT.rst>`_.
118+
If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and `discussions board <https://github.com/tsutterley/pyTMD/discussions>`_.
119119

120120
Credits
121121
#######

doc/source/getting_started/Code-of-Conduct.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyTMD/compute.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def tide_elevations(
220220
CROP: bool = False,
221221
BOUNDS: list | np.ndarray | None = None,
222222
BUFFER: int | float | None = None,
223-
EPSG: str | int = 3031,
223+
EPSG: str | int = 4326,
224224
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
225225
TYPE: str | None = 'drift',
226226
TIME: str = 'UTC',
@@ -261,7 +261,7 @@ def tide_elevations(
261261
Boundaries for cropping tide model data
262262
BUFFER: int, float or NoneType, default None
263263
Buffer distance for cropping tide model data
264-
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
264+
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
265265
Input coordinate system
266266
EPOCH: tuple, default (2000,1,1,0,0,0)
267267
Time period for calculating delta times
@@ -448,7 +448,7 @@ def tide_currents(
448448
CROP: bool = False,
449449
BOUNDS: list | np.ndarray | None = None,
450450
BUFFER: int | float | None = None,
451-
EPSG: str | int = 3031,
451+
EPSG: str | int = 4326,
452452
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
453453
TYPE: str | None = 'drift',
454454
TIME: str = 'UTC',
@@ -487,7 +487,7 @@ def tide_currents(
487487
Boundaries for cropping tide model data
488488
BUFFER: int, float or NoneType, default None
489489
Buffer distance for cropping tide model data
490-
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
490+
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
491491
Input coordinate system
492492
EPOCH: tuple, default (2000,1,1,0,0,0)
493493
Time period for calculating delta times
@@ -667,7 +667,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
667667
MODEL: str | None = None,
668668
GZIP: bool = False,
669669
DEFINITION_FILE: str | pathlib.Path | None = None,
670-
EPSG: str | int = 3031,
670+
EPSG: str | int = 4326,
671671
METHOD: str = 'spline'
672672
):
673673
"""
@@ -687,7 +687,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
687687
Tide model files are gzip compressed
688688
DEFINITION_FILE: str or NoneType, default None
689689
Tide model definition file for use
690-
EPSG: str or int, default: 3031 (Polar Stereographic South, WGS84)
690+
EPSG: str or int, default: 4326 (WGS84 Latitude and Longitude)
691691
Input coordinate system
692692
METHOD: str, default 'spline'
693693
interpolation method
@@ -795,7 +795,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
795795
# PURPOSE: compute long-period equilibrium tidal elevations
796796
def LPET_elevations(
797797
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
798-
EPSG: str | int = 3031,
798+
EPSG: str | int = 4326,
799799
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
800800
TYPE: str | None = 'drift',
801801
TIME: str = 'UTC',
@@ -812,7 +812,7 @@ def LPET_elevations(
812812
y-coordinates in projection EPSG
813813
delta_time: np.ndarray
814814
seconds since EPOCH or datetime array
815-
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
815+
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
816816
Input coordinate system
817817
EPOCH: tuple, default (2000,1,1,0,0,0)
818818
Time period for calculating delta times
@@ -900,7 +900,7 @@ def LPET_elevations(
900900
# following IERS Convention (2010) guidelines
901901
def LPT_displacements(
902902
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
903-
EPSG: str | int = 3031,
903+
EPSG: str | int = 4326,
904904
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
905905
TYPE: str | None = 'drift',
906906
TIME: str = 'UTC',
@@ -921,7 +921,7 @@ def LPT_displacements(
921921
y-coordinates in projection EPSG
922922
delta_time: np.ndarray
923923
seconds since EPOCH or datetime array
924-
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
924+
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
925925
Input coordinate system
926926
EPOCH: tuple, default (2000,1,1,0,0,0)
927927
Time period for calculating delta times
@@ -1100,7 +1100,7 @@ def LPT_displacements(
11001100
# following IERS Convention (2010) guidelines
11011101
def OPT_displacements(
11021102
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
1103-
EPSG: str | int = 3031,
1103+
EPSG: str | int = 4326,
11041104
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
11051105
TYPE: str | None = 'drift',
11061106
TIME: str = 'UTC',
@@ -1122,7 +1122,7 @@ def OPT_displacements(
11221122
y-coordinates in projection EPSG
11231123
delta_time: np.ndarray
11241124
seconds since EPOCH or datetime array
1125-
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
1125+
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
11261126
Input coordinate system
11271127
EPOCH: tuple, default (2000,1,1,0,0,0)
11281128
Time period for calculating delta times
@@ -1328,7 +1328,7 @@ def OPT_displacements(
13281328
# PURPOSE: compute solid earth tidal elevations
13291329
def SET_displacements(
13301330
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
1331-
EPSG: str | int = 3031,
1331+
EPSG: str | int = 4326,
13321332
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
13331333
TYPE: str | None = 'drift',
13341334
TIME: str = 'UTC',
@@ -1349,7 +1349,7 @@ def SET_displacements(
13491349
y-coordinates in projection EPSG
13501350
delta_time: np.ndarray
13511351
seconds since EPOCH or datetime array
1352-
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
1352+
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
13531353
Input coordinate system
13541354
EPOCH: tuple, default (2000,1,1,0,0,0)
13551355
Time period for calculating delta times

pyTMD/predict.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def map(t: float | np.ndarray,
108108
corrections: str = 'OTIS'
109109
):
110110
"""
111-
Predict tides at a single time using harmonic constants :cite:p:`Egbert:2002ge`
111+
Predict tides at a single time using harmonic
112+
constants :cite:p:`Egbert:2002ge`
112113
113114
Parameters
114115
----------
@@ -280,8 +281,9 @@ def infer_minor(
280281
):
281282
"""
282283
Infer the tidal values for minor constituents using their
283-
relation with major constituents :cite:p:`Doodson:1941td` :cite:p:`Schureman:1958ty`
284-
:cite:p:`Foreman:1989dt` :cite:p:`Egbert:2002ge`
284+
relation with major constituents :cite:p:`Doodson:1941td`
285+
:cite:p:`Schureman:1958ty` :cite:p:`Foreman:1989dt`
286+
:cite:p:`Egbert:2002ge`
285287
286288
Parameters
287289
----------
@@ -621,7 +623,8 @@ def _infer_diurnal(
621623
Infer the tidal values for diurnal minor constituents
622624
using their relation with major constituents taking into
623625
account resonance due to free core nutation
624-
:cite:p:`Munk:1966go` :cite:p:`Ray:2017jx` :cite:p:`Wahr:1981if` :cite:p:`Cartwright:1973em`
626+
:cite:p:`Munk:1966go` :cite:p:`Ray:2017jx` :cite:p:`Wahr:1981if`
627+
:cite:p:`Cartwright:1973em`
625628
626629
Parameters
627630
----------
@@ -1259,7 +1262,8 @@ def solid_earth_tide(
12591262
):
12601263
"""
12611264
Compute the solid Earth tides due to the gravitational attraction of
1262-
the moon and sun :cite:p:`Mathews:1991kv` :cite:p:`Mathews:1997js` :cite:p:`Ries:1992ip` :cite:p:`Wahr:1981ea`
1265+
the moon and sun :cite:p:`Mathews:1991kv` :cite:p:`Mathews:1997js`
1266+
:cite:p:`Ries:1992ip` :cite:p:`Wahr:1981ea`
12631267
12641268
Parameters
12651269
----------

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,6 @@ omit = [
101101
[tool.coverage.report]
102102
show_missing = true
103103
precision = 2
104+
105+
[tool.ruff]
106+
line-length = 80

test/test_arguments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ def test_parse_tables():
853853
CTE = pyTMD.arguments._parse_tide_potential_table(table)
854854
for i, line in enumerate(CTE):
855855
# convert Doodson number to Cartwright numbers
856-
tau, s, h, p, n, pp = pyTMD.arguments._from_doodson_number(line['DO'])
856+
DO = line['DO']
857+
tau, s, h, p, n, pp = pyTMD.arguments._from_doodson_number(DO)
857858
assert tau == line['tau'], line
858859
assert s == line['s'], line
859860
assert h == line['h'], line

0 commit comments

Comments
 (0)