Skip to content

Commit

Permalink
Merge pull request #122 from gaelforget/seaduck
Browse files Browse the repository at this point in the history
Seaduck
  • Loading branch information
gaelforget authored Jun 19, 2024
2 parents 6c02567 + d55c04f commit 97ee337
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/seaduck.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

using ClimateModels, PyCall, Conda

"""
demo_seaduck()
Example copied from [seaduck documentation](https://macekuailv.github.io/seaduck/one_min_guide.html)
```
using ClimateModels, PyCall, Conda
include("examples/seaduck.jl")
demo_seaduck()
"""
demo_seaduck() = begin
ClimateModels.conda(:seaduck)
sd=ClimateModels.pyimport(:seaduck)

ds = sd.utils.get_dataset("ecco")

longitude = -11.0
latitude = 71.0
depth = -5.0
time = sd.utils.convert_time("1992-02")

time = sd.utils.convert_time("1992-02")
s = sd.OceInterp(ds, "SALT", longitude, latitude, depth, time)
end

28 changes: 28 additions & 0 deletions examples/seaduck/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Documentation : https://macekuailv.github.io/seaduck/intro.html

## add packages

```
pip install seaduck
pip install pooch
pip install zarr
pip install matplotlib
pip install cartopy
git clone https://github.com/MaceKuailv/seaduck
```

## then run

```
./docs/one_min_guide.ipynb
./docs/idealize_test/ver_stream.ipynb
./docs/idealize_test/tilted_stream.ipynb
./docs/idealize_test/hor_stream.ipynb
./docs/notebook/global_ECCO.ipynb
./docs/notebook/AVISO.ipynb
./docs/notebook/topology_tutorial.ipynb
```


10 changes: 10 additions & 0 deletions ext/ClimateModelsCondaExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ function ClimateModels.conda(flag=:fair)
if flag==:fair
Conda.pip_interop(true)
Conda.pip("install", "fair==1.6.4")
elseif flag==:seaduck
Conda.pip("install","numpy")
Conda.pip("install","xarray")
Conda.pip("install","dask")
Conda.pip_interop(true)
Conda.pip("install","seaduck")
Conda.pip("install","pooch")
Conda.pip("install","zarr")
# Conda.pip("install","matplotlib")
# Conda.pip("install","cartopy")
end
end

Expand Down
2 changes: 2 additions & 0 deletions ext/ClimateModelsPyCallExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function ClimateModels.pyimport(flag=:fair)
forward=pyimport("fair.forward")
RCPs=pyimport("fair.RCPs")
fair,forward,RCPs
elseif flag==:seaduck
sd=pyimport("seaduck")
else
@warn "unknown flag value "
end
Expand Down

0 comments on commit 97ee337

Please sign in to comment.