Skip to content

Commit

Permalink
fix some imports
Browse files Browse the repository at this point in the history
  • Loading branch information
vadmbertr committed Oct 25, 2023
1 parent dd55c8f commit 71248cf
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.ipynb_checkpoints

# build stuff
build
dist
*.egg-info
junit
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ u_cyclo, v_cyclo = cyclogeostrophy(u_geos=u_geos, v_geos=v_geos,
By default, the `cyclogeostrophy` function relies on our variational method.
Its `method` argument provides the ability to use an iterative method instead, either the one described by [Penven *et al.*](https://doi.org/10.1016/j.dsr2.2013.10.015), or the one by [Ioannou *et al.*](https://doi.org/10.1029/2019JC015031).
Additional arguments also give a finer control over the three approaches hyperparameters. \
See [**jaxparrow** documentation](docs/_build/index.html) for more details.
See [**jaxparrow** documentation](https://meom-group.github.io/jaxparrow/) for more details.

[Notebooks](notebooks/README.md) are available as step-by-step examples.

Expand Down
6 changes: 3 additions & 3 deletions jaxparrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from cyclogeostrophy import cyclogeostrophy
from geostrophy import geostrophy
from .cyclogeostrophy import cyclogeostrophy
from .geostrophy import geostrophy

__all__ = ["cyclogeostrophy", "geostrophy"]
__version__ = "0.0.1"
__version__ = "0.0.2"
2 changes: 1 addition & 1 deletion jaxparrow/cyclogeostrophy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from scipy import signal
from tqdm import tqdm

from tools import tools
from .tools import tools

#: Default maximum number of iterations for the iterative approach
N_IT_IT = 100
Expand Down
24 changes: 12 additions & 12 deletions jaxparrow/geostrophy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from tools import tools as geo
from .tools import tools

__all__ = ["geostrophy"]

Expand Down Expand Up @@ -33,24 +33,24 @@ def geostrophy(ssh: Union[np.ndarray, np.ma.MaskedArray],
:rtype: Tuple[np.ndarray, np.ndarray]
"""
# Computing the gradient of the ssh
grad_ssh_x, grad_ssh_y = geo.compute_gradient(ssh, dx_ssh, dy_ssh)
grad_ssh_x, grad_ssh_y = tools.compute_gradient(ssh, dx_ssh, dy_ssh)

# Interpolation of the data (moving the grad into the u and v position)
grad_ssh_y = geo.interpolate(grad_ssh_y, axis=0)
grad_ssh_y = geo.interpolate(grad_ssh_y, axis=1)
grad_ssh_y = tools.interpolate(grad_ssh_y, axis=0)
grad_ssh_y = tools.interpolate(grad_ssh_y, axis=1)

grad_ssh_x = geo.interpolate(grad_ssh_x, axis=1)
grad_ssh_x = geo.interpolate(grad_ssh_x, axis=0)
grad_ssh_x = tools.interpolate(grad_ssh_x, axis=1)
grad_ssh_x = tools.interpolate(grad_ssh_x, axis=0)

# Interpolating the coriolis
cu = geo.interpolate(coriolis_factor_u, axis=0)
cu = geo.interpolate(cu, axis=1)
cu = tools.interpolate(coriolis_factor_u, axis=0)
cu = tools.interpolate(cu, axis=1)

cv = geo.interpolate(coriolis_factor_v, axis=1)
cv = geo.interpolate(cv, axis=0)
cv = tools.interpolate(coriolis_factor_v, axis=1)
cv = tools.interpolate(cv, axis=0)

# Computing the geostrophic velocities
u_geos = - geo.GRAVITY * grad_ssh_y / cu
v_geos = geo.GRAVITY * grad_ssh_x / cv
u_geos = - tools.GRAVITY * grad_ssh_y / cu
v_geos = tools.GRAVITY * grad_ssh_x / cv

return u_geos, v_geos
4 changes: 2 additions & 2 deletions jaxparrow/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tools.tools import compute_coriolis_factor, compute_spatial_step
from tools import tools
from .tools import compute_coriolis_factor, compute_spatial_step
from . import tools

__all__ = ["compute_coriolis_factor", "compute_spatial_step", "tools"]

0 comments on commit 71248cf

Please sign in to comment.