Skip to content

Commit

Permalink
refactor: implicit import of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutterley committed Jan 11, 2024
1 parent 964a887 commit c1b7c7e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
8 changes: 4 additions & 4 deletions doc/source/api_reference/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Calling Sequence
.. code-block:: python
import pyTMD.arguments
pu,pf,G = pyTMD.arguments(MJD, constituents,
pu,pf,G = pyTMD.arguments.arguments(MJD, constituents,
deltat=DELTAT, corrections=CORRECTIONS)
`Source code`__

.. __: https://github.com/tsutterley/pyTMD/blob/main/pyTMD/arguments.py

.. autofunction:: pyTMD.arguments
.. autofunction:: pyTMD.arguments.arguments

.. autofunction:: pyTMD.minor_arguments
.. autofunction:: pyTMD.arguments.minor_arguments

.. autofunction:: pyTMD.doodson_number
.. autofunction:: pyTMD.arguments.doodson_number

.. autofunction:: pyTMD.arguments._arguments_table

Expand Down
6 changes: 1 addition & 5 deletions pyTMD/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Documentation is available at https://pytmd.readthedocs.io
"""
import pyTMD.arguments
import pyTMD.astro
import pyTMD.eop
import pyTMD.interpolate
Expand All @@ -22,11 +23,6 @@
import pyTMD.utilities
import pyTMD.version
from pyTMD import io
from pyTMD.arguments import (
arguments,
minor_arguments,
doodson_number
)
from pyTMD.check_points import check_points
from pyTMD.compute_tide_corrections import (
compute_corrections,
Expand Down
25 changes: 17 additions & 8 deletions pyTMD/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
from __future__ import annotations

import numpy as np
import pyTMD.arguments
import pyTMD.astro
from pyTMD.arguments import arguments, minor_arguments
from pyTMD.constants import constants

# PURPOSE: Predict tides at single times
Expand Down Expand Up @@ -90,8 +90,11 @@ def map(t: float | np.ndarray,
npts, nc = np.shape(hc)
# load the nodal corrections
# convert time to Modified Julian Days (MJD)
pu, pf, G = arguments(t + 48622.0, constituents,
deltat=deltat, corrections=corrections)
pu, pf, G = pyTMD.arguments.arguments(t + 48622.0,
constituents,
deltat=deltat,
corrections=corrections
)
# allocate for output tidal elevation
ht = np.ma.zeros((npts))
ht.mask = np.zeros((npts), dtype=bool)
Expand Down Expand Up @@ -152,8 +155,11 @@ def drift(t: float | np.ndarray,
nt = len(t)
# load the nodal corrections
# convert time to Modified Julian Days (MJD)
pu, pf, G = arguments(t + 48622.0, constituents,
deltat=deltat, corrections=corrections)
pu, pf, G = pyTMD.arguments.arguments(t + 48622.0,
constituents,
deltat=deltat,
corrections=corrections
)
# allocate for output time series
ht = np.ma.zeros((nt))
ht.mask = np.zeros((nt), dtype=bool)
Expand Down Expand Up @@ -214,8 +220,11 @@ def time_series(t: float | np.ndarray,
nt = len(t)
# load the nodal corrections
# convert time to Modified Julian Days (MJD)
pu, pf, G = arguments(t + 48622.0, constituents,
deltat=deltat, corrections=corrections)
pu, pf, G = pyTMD.arguments.arguments(t + 48622.0,
constituents,
deltat=deltat,
corrections=corrections
)
# allocate for output time series
ht = np.ma.zeros((nt))
ht.mask = np.zeros((nt), dtype=bool)
Expand Down Expand Up @@ -354,7 +363,7 @@ def infer_minor(

# load the nodal corrections for minor constituents
# convert time to Modified Julian Days (MJD)
pu, pf, G = minor_arguments(t + 48622.0,
pu, pf, G = pyTMD.arguments.minor_arguments(t + 48622.0,
deltat=kwargs['deltat'],
corrections=kwargs['corrections']
)
Expand Down

0 comments on commit c1b7c7e

Please sign in to comment.