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

Continuous Integration tests up and running #116

Merged
merged 87 commits into from
Jun 9, 2023
Merged
Changes from 2 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
c36269a
CI updated for GithubActions
JordiBolibar Apr 6, 2023
a30189a
Update Project.toml
JordiBolibar Apr 6, 2023
f63894a
CI updated with yml file
JordiBolibar Apr 12, 2023
b985250
Merge branch 'main' of https://github.com/JordiBolibar/ODINN.jl
JordiBolibar Apr 12, 2023
1015562
yml file path updated
JordiBolibar Apr 12, 2023
1233255
yaml file extension fixed
JordiBolibar Apr 12, 2023
3a148ee
PYTHON variable set to which python
JordiBolibar Apr 12, 2023
d408e49
PYTHON env fixed
JordiBolibar Apr 12, 2023
c3c11e3
PYTHON env fixed
JordiBolibar Apr 12, 2023
3487369
PYTHON env fixed
JordiBolibar Apr 12, 2023
6de2e81
PYTHON env fixed
JordiBolibar Apr 12, 2023
2008276
PYTHON env fixed
JordiBolibar Apr 12, 2023
c371c9e
PYTHON env fixed
JordiBolibar Apr 12, 2023
7ba30f5
PYTHON env fixed
JordiBolibar Apr 12, 2023
30d29b9
PYTHON env fixed
JordiBolibar Apr 12, 2023
0b2fcb2
PYTHON env fixed
JordiBolibar Apr 12, 2023
f5ed301
PYTHON env fixed
JordiBolibar Apr 12, 2023
0ec693d
PYTHON env fixed
JordiBolibar Apr 12, 2023
ea3adfd
PYTHON env fixed
JordiBolibar Apr 12, 2023
b3ccf63
PYTHON env fixed
JordiBolibar Apr 12, 2023
8af1d79
PYTHON env fixed
JordiBolibar Apr 12, 2023
15b670d
PYTHON env fixed
JordiBolibar Apr 12, 2023
0ca6c51
PYTHON env fixed
JordiBolibar Apr 12, 2023
b4ce880
CI updated
JordiBolibar Apr 25, 2023
e0e95b4
CI updated
JordiBolibar Apr 25, 2023
913a5ca
CI updated
JordiBolibar Apr 25, 2023
e80f27d
CI updated
JordiBolibar Apr 25, 2023
4e9ea39
CI updated
JordiBolibar May 3, 2023
1717a37
CI updated
JordiBolibar May 3, 2023
51b628d
CI updated
JordiBolibar May 3, 2023
654b909
CI updated
JordiBolibar May 3, 2023
48c77d4
CI updated
JordiBolibar May 3, 2023
e2e4d94
CI updated
JordiBolibar May 3, 2023
e3c06a6
CI updated
JordiBolibar May 3, 2023
8423d9a
CI updated
JordiBolibar May 3, 2023
ee12968
CI updated
JordiBolibar May 3, 2023
deed023
CI updated
JordiBolibar May 3, 2023
778678e
CI updated
JordiBolibar May 3, 2023
9d195b6
CI updated
JordiBolibar May 4, 2023
2bd0d0b
CI updated
JordiBolibar May 4, 2023
a905f47
CI updated
JordiBolibar May 4, 2023
2de7247
CI updated
JordiBolibar May 4, 2023
67523ee
[WIP] Investigating strange behaviour of SIA solver
JordiBolibar May 11, 2023
82ff799
solve problem with boundary condition for SIA PDE (no UDE)
facusapienza21 May 30, 2023
f661f55
restore old version of action
facusapienza21 May 30, 2023
1562e8b
[WIP] Mass balance fixed.
JordiBolibar May 30, 2023
a62043f
Merge conflict fixed
JordiBolibar May 30, 2023
d403066
Merge branch 'ODINN-SciML:boundary-condition' into boundary-condition
JordiBolibar May 30, 2023
f0995e1
Iceflow with fixed boundary conditions and MB
JordiBolibar May 31, 2023
2a33088
New CI and Python environment from Facu
JordiBolibar Jun 1, 2023
6c33712
Merge conflict fixed
JordiBolibar Jun 1, 2023
b96d67b
Merge conflict fixed
JordiBolibar Jun 1, 2023
4837dd1
Updated test reference files
JordiBolibar Jun 1, 2023
6a5a75f
Forcing intitialization of gdirs from scratch for CI
JordiBolibar Jun 1, 2023
5143425
CI and environment updated
JordiBolibar Jun 1, 2023
fff755e
CI and environment updated
JordiBolibar Jun 1, 2023
dbe65d3
Python env and tests fixed
JordiBolibar Jun 5, 2023
6722876
Update environment.yml
JordiBolibar Jun 5, 2023
19c1cba
Update environment.yml
JordiBolibar Jun 6, 2023
9bce53a
Update environment.yml
JordiBolibar Jun 6, 2023
a8e5b65
Update environment.yml
JordiBolibar Jun 6, 2023
25c3129
Update environment.yml
JordiBolibar Jun 6, 2023
a474422
Update CI.yml
JordiBolibar Jun 6, 2023
56887c9
Update CI.yml
JordiBolibar Jun 6, 2023
26cb4bd
Test update and environment.yml
JordiBolibar Jun 7, 2023
53c67c8
Merge conflict fixed
JordiBolibar Jun 7, 2023
a10d472
Update CI.yml
JordiBolibar Jun 7, 2023
f25e4cd
Update CI.yml with CA certificate setup
JordiBolibar Jun 7, 2023
abe537b
CA certificate
JordiBolibar Jun 7, 2023
b0643d9
Update CA variable assignment
JordiBolibar Jun 7, 2023
6684f73
Update CI.yml
JordiBolibar Jun 8, 2023
c91501b
Update CI.yml
JordiBolibar Jun 8, 2023
5479e76
Update CI.yml
JordiBolibar Jun 8, 2023
08d30d0
Update CI.yml
JordiBolibar Jun 8, 2023
bd07935
Update CI.yml
JordiBolibar Jun 9, 2023
b9d5191
SSL certificate added to tests
JordiBolibar Jun 9, 2023
b073552
Ref files for test updated
JordiBolibar Jun 9, 2023
ebf5765
Docs action removed + tests with less glaciers
JordiBolibar Jun 9, 2023
82d84f4
Using 2 workers for tests
JordiBolibar Jun 9, 2023
98c3dd5
Using 2 workers for tests (now for OGGM)
JordiBolibar Jun 9, 2023
73e1c7e
Update README with micromamba installation and other details
JordiBolibar Jun 9, 2023
0c10dfd
Fall back multiprocessing in CI for PDE solving
JordiBolibar Jun 9, 2023
8fecf4e
Merge branch 'main' of https://github.com/JordiBolibar/ODINN.jl
JordiBolibar Jun 9, 2023
eff9fe4
Multiprocessing for OGGM fixed
JordiBolibar Jun 9, 2023
329890e
Avoid downloading Millan22 velocities in CI
JordiBolibar Jun 9, 2023
4ded237
Correctly bypassing download of Millan22 velocities
JordiBolibar Jun 9, 2023
602bf85
Including missing catch on get_initial_status()
JordiBolibar Jun 9, 2023
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
25 changes: 7 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# ODINN

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JordiBolibar.github.io/ODINN.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JordiBolibar.github.io/ODINN.jl/dev/)
[![Build Status](https://github.com/JordiBolibar/ODINN.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JordiBolibar/ODINN.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/JordiBolibar/ODINN.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JordiBolibar/ODINN.jl)

Expand All @@ -22,21 +20,22 @@ Global glacier model using Universal Differential Equations to model and discove
In order to install `ODINN` in a given environment, just do in the REPL:
```julia
julia> ] # enter Pkg mode
(@v1.8) pkg> activate MyEnvironment # or activate whatever path for the Julia environment
(@v1.9) pkg> activate MyEnvironment # or activate whatever path for the Julia environment
(MyEnvironment) pkg> add ODINN
```

## ODINN initialization: integration with OGGM and multiprocessing

In order to call OGGM in Python from Julia, a Python installation is needed, which then can be used in Julia using [PyCall](https://github.com/JuliaPy/PyCall.jl). We recommend splitting the Julia (i.e. ODINN) and Python (i.e. OGGM) files in separate folders, which we chose to name `Julia` and `Python`, both placed at root level. As indicated in the [OGGM documentation](https://docs.oggm.org/en/stable/installing-oggm.html), when installing OGGM it is best to create a new dedicated conda environment for it (e.g. `oggm_env`). In the same environment, install also the [OGGM Mass-Balance sandbox](https://github.com/OGGM/massbalance-sandbox) following the instructions in the repository.

The path to this conda environment needs to be specified in the `ENV["PYTHON"]` variable in Julia, for PyCall to find it. This configuration is very easy to implement, it just requires activating the conda environment before the first time you run ODINN in your machine. In the terminal (not in a Julia session), run:
ODINN depends on some Python packages, mainly OGGM and xarray. In order to install the necessary Python dependencies in an easy manner, we are providing a Python environment (`oggm_env`) in `environment.yml`. In order to install it and activate it, we recommend using micromamba:

```
conda activate oggm_env # replace `oggm_env` with whatever conda environment where you have installed OGGM and the MBSandbox
micromamba create -f environment.yml
micromamba activate oggm_env
```

Then, you need to configure PyCall to use the Python path for that conda environment:
In order to call OGGM in Python from Julia, we use [PyCall.jl](https://github.com/JuliaPy/PyCall.jl). PyCall hooks on the Python installation and allows using Python in a totally seamless way from Julia.

The path to this conda environment needs to be specified in the `ENV["PYTHON"]` variable in Julia, for PyCall to find it. This configuration is very easy to implement, it just requires providing the Python path to PyCall and building it:

```julia
julia # start Julia session
Expand All @@ -62,16 +61,6 @@ From this point, it is possible to use ODINN with multiprocessing and to run Pyt

ODINN works as a back-end of OGGM, utilizing all its tools to retrieve RGI data, topographical data, climate data and other datasets from the OGGM shop. We use these data to specify the initial state of the simulations, and to retrieve the climate data to force the model. Everything related to the mass balance and ice flow dynamics models is written 100% in Julia. This allows us to run tests with this toy model for any glacier on Earth. In order to choose a glacier, you just need to specify the RGI ID, which you can find [here](https://www.glims.org/maps/glims).

## Running the toy model

A demostration with a toy model is showcased in [`src/scripts/toy_model.jl`](https://github.com/ODINN-SciML/ODINN.jl/blob/main/scripts/toy_model.jl). The `Project.toml` includes all the required dependencies. If you are running this code from zero, you may need to install the libraries using `Pkg.instantiate()`. In case you want to include this package to the project manifest, you can also use `Pkg.resolve()` before instantiating the project. You can replace the preamble in `src/scripts/toy_model.jl` to

```julia
import Pkg
Pkg.activate(dirname(Base.current_project()))
Pkg.instantiate()
Pkg.precompile()
```
## Upcoming changes

A stable API is still being designed, which will be available in the next release. If you plan to start using the model, please contact us, although we recommend to wait until next release for a smoother experience.