Skip to content

Commit

Permalink
erge branch 'issue-#26'
Browse files Browse the repository at this point in the history
  • Loading branch information
vadmbertr committed Nov 7, 2023
2 parents f64d444 + c7f25e7 commit 40cb600
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
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 import compute_coriolis_factor, compute_derivative, compute_spatial_step
from .tools import compute_coriolis_factor, compute_spatial_step
from . import tools

__all__ = ["compute_coriolis_factor", "compute_derivative", "compute_spatial_step", "tools"]
__all__ = ["compute_coriolis_factor", "compute_spatial_step", "tools"]
2 changes: 1 addition & 1 deletion jaxparrow/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
GRAVITY = 9.81
P0 = np.pi / 180

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


# =============================================================================
Expand Down
13 changes: 7 additions & 6 deletions notebooks/alboran_sea.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"id": "5c55152f",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-06T15:27:31.340126Z",
"start_time": "2023-11-06T15:27:29.665130Z"
"end_time": "2023-11-07T05:12:05.132292Z",
"start_time": "2023-11-07T05:12:03.296372Z"
}
},
"outputs": [],
Expand All @@ -20,7 +20,7 @@
"import numpy.ma as ma\n",
"import xarray as xr\n",
"\n",
"from jaxparrow.tools import compute_coriolis_factor, compute_derivative, compute_spatial_step\n",
"from jaxparrow.tools import compute_coriolis_factor, compute_spatial_step\n",
"from jaxparrow import cyclogeostrophy, geostrophy\n",
"\n",
"%reload_ext autoreload\n",
Expand All @@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"outputs": [],
"source": [
"# utility functions\n",
Expand All @@ -40,6 +40,7 @@
" return true - estimate\n",
"\n",
"\n",
"from jaxparrow.tools.tools import compute_derivative\n",
"def compute_norm_vorticity(u: np.ndarray, v: np.ndarray, dy_u: np.ndarray, dx_v: np.ndarray, \n",
" mask: np.ndarray, f: np.ndarray) -> np.ma.masked_array:\n",
" du_dy = compute_derivative(u, dy_u, axis=0)\n",
Expand All @@ -49,8 +50,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-06T15:27:31.360491Z",
"start_time": "2023-11-06T15:27:31.343321Z"
"end_time": "2023-11-07T05:12:36.638398Z",
"start_time": "2023-11-07T05:12:36.315662Z"
}
},
"id": "2c973169ddf279c2"
Expand Down
3 changes: 2 additions & 1 deletion notebooks/alboran_sea/alboran_sea.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import numpy as np
import numpy.ma as ma
import xarray as xr

from jaxparrow.tools import compute_coriolis_factor, compute_derivative, compute_spatial_step
from jaxparrow.tools import compute_coriolis_factor, compute_spatial_step
from jaxparrow import cyclogeostrophy, geostrophy
```

Expand All @@ -22,6 +22,7 @@ def dist(true: np.ndarray, estimate: np.ndarray) -> np.ndarray:
return true - estimate


from jaxparrow.tools.tools import compute_derivative
def compute_norm_vorticity(u: np.ndarray, v: np.ndarray, dy_u: np.ndarray, dx_v: np.ndarray,
mask: np.ndarray, f: np.ndarray) -> np.ma.masked_array:
du_dy = compute_derivative(u, dy_u, axis=0)
Expand Down

0 comments on commit 40cb600

Please sign in to comment.