Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change 1 liner default EPSG to 4326 #379

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
verbose: true
- name: Archive code coverage results
if: steps.secrets.outputs.accessible == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ./coverage.xml
136 changes: 0 additions & 136 deletions CODE_OF_CONDUCT.rst

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Contributing
############

This project contains work and contributions from the `scientific community <./CONTRIBUTORS.rst>`_.
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>`_.
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>`_.

Credits
#######
Expand Down
1 change: 0 additions & 1 deletion doc/source/getting_started/Code-of-Conduct.rst

This file was deleted.

28 changes: 14 additions & 14 deletions pyTMD/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def tide_elevations(
CROP: bool = False,
BOUNDS: list | np.ndarray | None = None,
BUFFER: int | float | None = None,
EPSG: str | int = 3031,
EPSG: str | int = 4326,
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
TYPE: str | None = 'drift',
TIME: str = 'UTC',
Expand Down Expand Up @@ -261,7 +261,7 @@ def tide_elevations(
Boundaries for cropping tide model data
BUFFER: int, float or NoneType, default None
Buffer distance for cropping tide model data
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
Input coordinate system
EPOCH: tuple, default (2000,1,1,0,0,0)
Time period for calculating delta times
Expand Down Expand Up @@ -448,7 +448,7 @@ def tide_currents(
CROP: bool = False,
BOUNDS: list | np.ndarray | None = None,
BUFFER: int | float | None = None,
EPSG: str | int = 3031,
EPSG: str | int = 4326,
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
TYPE: str | None = 'drift',
TIME: str = 'UTC',
Expand Down Expand Up @@ -487,7 +487,7 @@ def tide_currents(
Boundaries for cropping tide model data
BUFFER: int, float or NoneType, default None
Buffer distance for cropping tide model data
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
Input coordinate system
EPOCH: tuple, default (2000,1,1,0,0,0)
Time period for calculating delta times
Expand Down Expand Up @@ -667,7 +667,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
MODEL: str | None = None,
GZIP: bool = False,
DEFINITION_FILE: str | pathlib.Path | None = None,
EPSG: str | int = 3031,
EPSG: str | int = 4326,
METHOD: str = 'spline'
):
"""
Expand All @@ -687,7 +687,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
Tide model files are gzip compressed
DEFINITION_FILE: str or NoneType, default None
Tide model definition file for use
EPSG: str or int, default: 3031 (Polar Stereographic South, WGS84)
EPSG: str or int, default: 4326 (WGS84 Latitude and Longitude)
Input coordinate system
METHOD: str, default 'spline'
interpolation method
Expand Down Expand Up @@ -795,7 +795,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
# PURPOSE: compute long-period equilibrium tidal elevations
def LPET_elevations(
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
EPSG: str | int = 3031,
EPSG: str | int = 4326,
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
TYPE: str | None = 'drift',
TIME: str = 'UTC',
Expand All @@ -812,7 +812,7 @@ def LPET_elevations(
y-coordinates in projection EPSG
delta_time: np.ndarray
seconds since EPOCH or datetime array
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
Input coordinate system
EPOCH: tuple, default (2000,1,1,0,0,0)
Time period for calculating delta times
Expand Down Expand Up @@ -900,7 +900,7 @@ def LPET_elevations(
# following IERS Convention (2010) guidelines
def LPT_displacements(
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
EPSG: str | int = 3031,
EPSG: str | int = 4326,
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
TYPE: str | None = 'drift',
TIME: str = 'UTC',
Expand All @@ -921,7 +921,7 @@ def LPT_displacements(
y-coordinates in projection EPSG
delta_time: np.ndarray
seconds since EPOCH or datetime array
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
Input coordinate system
EPOCH: tuple, default (2000,1,1,0,0,0)
Time period for calculating delta times
Expand Down Expand Up @@ -1100,7 +1100,7 @@ def LPT_displacements(
# following IERS Convention (2010) guidelines
def OPT_displacements(
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
EPSG: str | int = 3031,
EPSG: str | int = 4326,
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
TYPE: str | None = 'drift',
TIME: str = 'UTC',
Expand All @@ -1122,7 +1122,7 @@ def OPT_displacements(
y-coordinates in projection EPSG
delta_time: np.ndarray
seconds since EPOCH or datetime array
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
Input coordinate system
EPOCH: tuple, default (2000,1,1,0,0,0)
Time period for calculating delta times
Expand Down Expand Up @@ -1328,7 +1328,7 @@ def OPT_displacements(
# PURPOSE: compute solid earth tidal elevations
def SET_displacements(
x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
EPSG: str | int = 3031,
EPSG: str | int = 4326,
EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
TYPE: str | None = 'drift',
TIME: str = 'UTC',
Expand All @@ -1349,7 +1349,7 @@ def SET_displacements(
y-coordinates in projection EPSG
delta_time: np.ndarray
seconds since EPOCH or datetime array
EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
Input coordinate system
EPOCH: tuple, default (2000,1,1,0,0,0)
Time period for calculating delta times
Expand Down
14 changes: 9 additions & 5 deletions pyTMD/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def map(t: float | np.ndarray,
corrections: str = 'OTIS'
):
"""
Predict tides at a single time using harmonic constants :cite:p:`Egbert:2002ge`
Predict tides at a single time using harmonic
constants :cite:p:`Egbert:2002ge`

Parameters
----------
Expand Down Expand Up @@ -280,8 +281,9 @@ def infer_minor(
):
"""
Infer the tidal values for minor constituents using their
relation with major constituents :cite:p:`Doodson:1941td` :cite:p:`Schureman:1958ty`
:cite:p:`Foreman:1989dt` :cite:p:`Egbert:2002ge`
relation with major constituents :cite:p:`Doodson:1941td`
:cite:p:`Schureman:1958ty` :cite:p:`Foreman:1989dt`
:cite:p:`Egbert:2002ge`

Parameters
----------
Expand Down Expand Up @@ -621,7 +623,8 @@ def _infer_diurnal(
Infer the tidal values for diurnal minor constituents
using their relation with major constituents taking into
account resonance due to free core nutation
:cite:p:`Munk:1966go` :cite:p:`Ray:2017jx` :cite:p:`Wahr:1981if` :cite:p:`Cartwright:1973em`
:cite:p:`Munk:1966go` :cite:p:`Ray:2017jx` :cite:p:`Wahr:1981if`
:cite:p:`Cartwright:1973em`

Parameters
----------
Expand Down Expand Up @@ -1259,7 +1262,8 @@ def solid_earth_tide(
):
"""
Compute the solid Earth tides due to the gravitational attraction of
the moon and sun :cite:p:`Mathews:1991kv` :cite:p:`Mathews:1997js` :cite:p:`Ries:1992ip` :cite:p:`Wahr:1981ea`
the moon and sun :cite:p:`Mathews:1991kv` :cite:p:`Mathews:1997js`
:cite:p:`Ries:1992ip` :cite:p:`Wahr:1981ea`

Parameters
----------
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ omit = [
[tool.coverage.report]
show_missing = true
precision = 2

[tool.ruff]
line-length = 80
3 changes: 2 additions & 1 deletion test/test_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,8 @@ def test_parse_tables():
CTE = pyTMD.arguments._parse_tide_potential_table(table)
for i, line in enumerate(CTE):
# convert Doodson number to Cartwright numbers
tau, s, h, p, n, pp = pyTMD.arguments._from_doodson_number(line['DO'])
DO = line['DO']
tau, s, h, p, n, pp = pyTMD.arguments._from_doodson_number(DO)
assert tau == line['tau'], line
assert s == line['s'], line
assert h == line['h'], line
Expand Down
Loading
Loading