Skip to content

Commit

Permalink
Merge pull request #76 from rcaneill/doc_to_website
Browse files Browse the repository at this point in the history
Add doc as website
  • Loading branch information
rcaneill committed Feb 5, 2024
2 parents f33a740 + e486654 commit 15bb53d
Show file tree
Hide file tree
Showing 26 changed files with 2,127 additions and 29,739 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
poetry-version: ["1.3.2"]
steps:
- name: Checkout
Expand All @@ -53,24 +53,3 @@ jobs:
poetry install --with test
- name: Run tests with pytest
run: poetry run pytest xnemogcm/test


test_notebooks:
name: test notebook doc
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Run poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.3.2
- name: Install / build
run: poetry install --with dev,test
- name: Run nbconvert
run: poetry run jupyter nbconvert --to notebook --execute src_example/*.ipynb --stdout
63 changes: 0 additions & 63 deletions .github/workflows/ci_run_notebook.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci_upgrade_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
python-version: ["3.9"]
poetry-version: ["1.3.2"]
steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ docs/_build
# Dev
dev/
tmp/
site/
27 changes: 27 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Read the Docs configuration file for MkDocs projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-with-the-official-installer
- curl -sSL https://install.python-poetry.org | python3 -
# Tell poetry to not use a virtual environment
- $HOME/.local/bin/poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- $HOME/.local/bin/poetry export --with docs --format requirements.txt > requirements.txt
- python -m pip install -r requirements.txt
- python -m pip install --no-deps .

mkdocs:
configuration: mkdocs.yml
89 changes: 2 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Interface to open NEMO ocean global circulation model output dataset and create
NEMO 3.6, 4.0, and 4.2.0 are tested and supported. Any version between 3.6 and 4.2.0 should work,
but in case of trouble, [please open an issue](https://github.com/rcaneill/xnemogcm/issues).

This repository is mirrored at https://gitlab.com/open-ocean/xnemogcm.
If you wish to contribute but don't have a github account, send me an email with your questions or comments: `romain [dot] caneill [at] ens-lyon [.] org`

## Usage
Expand All @@ -29,89 +28,5 @@ import xgcm
grid = xgcm.Grid(ds, metrics=get_metrics(ds), periodic=False)
```

See the [example](https://nbviewer.ipython.org/github/rcaneill/xnemogcm/blob/master/example/)
directory for some jupyter notebook examples.
xnemocgm is able to process xarray.Datasets (e.g. they could be retrieved from a remote server),
and can get information of the variables grid points with multiple options
(see [example/open_process_files.ipynb](https://nbviewer.ipython.org/github/rcaneill/xnemogcm/blob/master/example/open_process_files.ipynb).

### Note

`xnemogcm` is capable or recombining the domain_cfg and mesh_mask files output
by multiple processors,
the recombining tool from the NEMO toolbox is thus not needed here, see
the [example/recombing_mesh_mask_domain_cfg.ipynb](https://nbviewer.ipython.org/github/rcaneill/xnemogcm/blob/master/example/recombing_mesh_mask_domain_cfg.ipynb)

## Installation

Installation via pip:
```bash
pip3 install xnemogcm
```

Installation via conda:
```bash
conda install -c conda-forge xnemogcm
```

## Requirements for dev

We use *poetry* to set up a virtual environment containing all
needed packages to run xnemogcm and the tests.
To install all the dependencies, type `poetry install --with test,dev`
after cloning the directory. This will create a new virtual environment.
Typing `poetry shell` in the package directory will activate the virtual environment.

### About test data

Test data are based on the GYRE configuration, and produced by another repository:
[rcaneill/xnemogcm_test_data](https://github.com/rcaneill/xnemogcm_test_data).
Testing is built in a way that it is quite easy to add other nemo version to test.

### About notebooks examples

Sources for the notebooks are located in `src_example`. This is where to add / modify the
examples. A github action is set to automatically build the notebook according to
the latest version of the code, and publish them to `example` when commiting to master branch.


## What's new

### v0.4.2 (2023-08-07)
* Allow additional dimension names occurring when variables on inner grid are diagnosed, e.g. `x_grid_U_inner` or `x_grid_U`.
* Add coordinates into the DataArrays
* Add some standard names and units in domcfg

### v0.4.1 (2023-03-29)
* Allow to open files if time bounds are missing
* Minor bug correction for nemo 3.6
* Add nemo 3.6 and 4.2.0 test data
* Update code to support nemo 3.6 and 4.2.0

### v0.4.0 (2022-12-08)
* Optimize speed
* Add option to decode grid type from attributes
* Shift from pipenv and setupy.py to poetry
* Refactor data test to allow testing of multiple version of NEMO

### v0.3.4 (2021-06-15)
* Adding some example
* Bug fixes
* Add option to compute extra scale factors

### v0.3.2 - v0.3.3 (2021-05-05)
* By default adds the lat/lon/depth variables of domcfg as coordinates

### v0.3.1 (2021-05-04)
* Minor bug fix when merging
* better squeezing of time in domcfg + nemo v3.6 compatibility

### v0.3.0 (2021-04-13)
* Cleaning the backend
* Removing the saving options (that were useless and confusing)
* Minor bug fixes
* Tested with realistic regional configuration

### v0.2.3 (2021-03-15)
* Support for surface only files
* Reshaping the data files for the tests (dev)
[The full documentation is hosted online:
[https://xnemogcm.readthedocs.io/](https://xnemogcm.readthedocs.io/)
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

3 changes: 3 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Reference

::: xnemogcm
54 changes: 0 additions & 54 deletions docs/conf.py

This file was deleted.

13 changes: 13 additions & 0 deletions docs/dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Requirements for dev

We use *poetry* to set up a virtual environment containing all
needed packages to run xnemogcm and the tests.
To install all the dependencies, type `poetry install --with test,dev,docs`
after cloning the directory. This will create a new virtual environment.
Typing `poetry shell` in the package directory will activate the virtual environment.

## About test data

Test data are based on the GYRE configuration, and produced by another repository:
[rcaneill/xnemogcm_test_data](https://github.com/rcaneill/xnemogcm_test_data).
Testing is built in a way that it is quite easy to add other nemo version to test.
Loading

0 comments on commit 15bb53d

Please sign in to comment.