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

chore: update dependencies #188

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
3359b27
chore: updating the attributes for the variables, coordinates and dat…
uriii3 Jul 16, 2024
978e24a
chore: refactor to stop using the cache (#95)
renaudjester Jul 16, 2024
3d2cd98
chore: change name logger to fit with the name of the library (#97)
renaudjester Jul 22, 2024
0e97227
fix: if not permission modifie last updated date on file continue (#98)
renaudjester Jul 22, 2024
8283b18
deleting the missing heads
uriii3 Jul 31, 2024
163bfcc
fix: add some explanation on the readme for the file list option (#105)
renaudjester Jul 31, 2024
beaabdf
chore: refactor to stop using the cache (#95)
renaudjester Jul 16, 2024
7d13a07
Reading 'positive' attribute back to the depth dimension (#103)
uriii3 Jul 31, 2024
939a585
Deleting valid_min and valid_max attributes (#104)
uriii3 Aug 5, 2024
ace251f
Adding a warning also for the depth dimension (#72)
uriii3 Aug 19, 2024
d1359b1
Use only timezones for datetime parser (#108)
renaudjester Aug 19, 2024
84d2dd3
Tests on prerelease and semver check (#119)
renaudjester Aug 23, 2024
e3f1b7f
chore: add html documentation page to the toolbox with sphinx (#118)
renaudjester Aug 29, 2024
b65547a
fix: use pendulum to parse dates (#123)
renaudjester Sep 3, 2024
6ce21f7
bounding Box method (#66)
uriii3 Sep 5, 2024
a9c6ea9
Approximation downloaded data (#126)
renaudjester Sep 9, 2024
3796d3d
chore: add more return metadata and dry run (#129)
renaudjester Sep 12, 2024
6a5c269
doc: improve style of the doc (#130)
renaudjester Sep 13, 2024
0e5a113
Adapt type of valid minmax (#132)
uriii3 Sep 17, 2024
66d8b46
Describe contains coordinate not on the variable (#131)
renaudjester Sep 17, 2024
6a3904e
refactor: use threading for concurrent requests (#133)
renaudjester Sep 17, 2024
f19a763
Add read the docs conf (#134)
renaudjester Sep 17, 2024
272f3df
fix: not converting properly timestamp (#135)
renaudjester Sep 17, 2024
b743225
Cf checker (#127)
uriii3 Sep 17, 2024
48fe4af
fix: decimal not handled with modulus (#136)
renaudjester Sep 18, 2024
0367964
fix: handle admp valid start index for retention period (#138)
renaudjester Sep 18, 2024
5b9f8aa
fix: subset should subset when retention period (#143)
renaudjester Sep 19, 2024
6698b90
chore: proposal to update the terminal output for the login (#140)
uriii3 Sep 19, 2024
abf013e
Change name vertical dimension argument (#144)
renaudjester Sep 23, 2024
8f29948
chore: clean the readme to the minimum and put the information in the…
renaudjester Sep 23, 2024
57de83d
feat: add timeout to requests and can choose the retry number (#146)
renaudjester Sep 25, 2024
bf2f9b3
chore: clean repo and delete deprecated (#147)
renaudjester Sep 25, 2024
4c633fe
chore: coordinate selection method (#137)
uriii3 Sep 25, 2024
839a9a3
new-feature: create binaries with GitHub Actions (#142)
uriii3 Sep 25, 2024
7fb5daa
fix: correcting binaries docs (#149)
uriii3 Sep 26, 2024
0de0391
upgrade the binaries GitHub Action (#150)
uriii3 Sep 27, 2024
c322edc
Use s3 product dataset mapping (#151)
renaudjester Sep 30, 2024
e736038
chore: delete deprecated functions (#152)
renaudjester Sep 30, 2024
a68ba2c
fix: update create template (#153)
uriii3 Oct 2, 2024
bc843bc
chore: update the output when listing files (#154)
uriii3 Oct 7, 2024
ffde0db
fix: no service option for get command (#157)
renaudjester Oct 8, 2024
2909179
fix: correct typos and improve doc (#156)
renaudjester Oct 9, 2024
0ff65bb
fix: no mention of STAC or CMEMS (#165)
renaudjester Oct 11, 2024
4599d9f
fix: datasetid not mandatory in py inter for consistency (#164)
renaudjester Oct 11, 2024
355cc1b
chore: add validity check for logging (#161)
renaudjester Oct 11, 2024
1c6b73a
chore: compression level as only option (#162)
uriii3 Oct 11, 2024
3560441
fix: describe bug (#166)
uriii3 Oct 16, 2024
53f19fc
doc: format command help correctly with keeping doc examples (#169)
renaudjester Oct 16, 2024
92c2c3f
chore: add installation page (#174)
uriii3 Oct 18, 2024
61dbe0a
chore: centralising the documentation (#155)
uriii3 Oct 18, 2024
b79884a
fix: small changes docs (#175)
uriii3 Oct 18, 2024
ed51cdf
chore: add QuickOverview section (#171)
uriii3 Oct 22, 2024
fb87e62
chore: checking examples (#180)
uriii3 Oct 22, 2024
cab3f1e
feat: support the new authentification system (#184)
renaudjester Oct 24, 2024
d558a45
chore: update to numpy 2.0.0
renaudjester Oct 25, 2024
bd61ad8
chore: poetry lock update
renaudjester Oct 25, 2024
d46cfea
fix: need numpydoc in the tests
renaudjester Oct 25, 2024
6227278
chore: use h5netcdf instead of netcdf4
renaudjester Oct 25, 2024
f454692
chore: try to push new updated lockfile
renaudjester Oct 25, 2024
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
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ ignore =

# Unused imports - pb with import_and_args.py
# F401
per-file-ignores =
# __init__ files
dataset_product_mapping.py: E501
56 changes: 56 additions & 0 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create Binaries

on:
push:
branches:
- main
- 'pre-releases/**'

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, macos-13]
runs-on: ${{ matrix.os }}
timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
micromamba-binary-path: ${{ runner.temp }}/bin/micromamba
environment-file: conda_environment_binary.yaml
environment-name: copernicusmarine-binary
condarc-file: .condarc
cache-environment: true
post-cleanup: 'all'

- name: Build with PyInstaller
shell: micromamba-shell {0}
run: |
make run-using-pyinstaller-${{ matrix.os }}

- name: Set VERSION environment variable
id: set-version
shell: micromamba-shell {0}
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_OUTPUT

- name: Upload binaries to macos or ubuntu
shell: micromamba-shell {0}
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
ARCH="macos-arm64"
elif [ "${{ matrix.os }}" == "macos-13" ]; then
ARCH="macos-x86_64"
elif [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
ARCH="linux"
fi
gh release upload v${{steps.set-version.outputs.VERSION}} dist/copernicusmarine_${ARCH}.cli#copernicusmarine-binary-${ARCH}-for-v${{steps.set-version.outputs.VERSION}}
45 changes: 45 additions & 0 deletions .github/workflows/binary-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create Binaries

on:
push:
branches:
- main
- 'pre-releases/**'

jobs:
build:
runs-on: windows-latest
timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
micromamba-binary-path: ${{ runner.temp }}\Scripts\micromamba.exe
environment-file: conda_environment_binary.yaml
environment-name: copernicusmarine-binary
condarc-file: .condarc
cache-environment: true
post-cleanup: 'all'

- name: Build with PyInstaller
shell: bash -el {0}
run: |
make run-using-pyinstaller-windows-latest

- name: Set VERSION environment variable
id: set-version
shell: bash -el {0}
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_OUTPUT

- name: Upload binaries to windows
shell: bash -el {0}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload v${{steps.set-version.outputs.VERSION}} dist/copernicusmarine.exe#copernicusmarine-binary-windows-for-v${{steps.set-version.outputs.VERSION}}
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: Run tests

on:
pull_request:
branches: [ "main", "copernicusmarine-toolbox-v2" ]
branches:
- "main"
- "copernicusmarine-toolbox-v2"
- "pre-releases/**"

jobs:
tests:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ copernicusmarine/**/__pycache__/
**/.DS_Store
__debug.py
dist/

# Sphinx documentation html build
doc/_build/

# Jupyter notebook checkpoints
**/.ipynb_checkpoints/
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ repos:
args: [--pytest-test-first]
exclude: ^tests/resources/
- id: pretty-format-json
exclude: ^doc/usage/quickoverview.ipynb
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
Expand Down
38 changes: 38 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "mambaforge-22.9"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: doc/conf.py

conda:
environment: conda_environment_sphinx.yaml
# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- method: pip
path: .

#TODO: add environment variables if we want to build the notebook when building the documentation
# https://docs.readthedocs.io/en/stable/environment-variables.html
37 changes: 37 additions & 0 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,40 @@ First, here is the link to the conda-forge feedstock repository: [https://github
All the conda-forge informations about this repository are available [here in the README](https://github.com/orgs/conda-forge/teams/copernicusmarine). To update it (new version, new maintainer...), please follow the indicated procedure.

Please also take a look at [this conda-forge documentation](https://conda-forge.org/docs/maintainer/updating_pkgs/#example-workflow-for-updating-a-package) for more information about the update procedure.

## Documentation

We use sphinx and read the docs to respectively build and distribute the documentation of the toolbox.

### Sphinx

We use:

- autodoc: to create the documentation from the docstrings of the Python interface or the comments in the models
- numpydoc: to convert numpydoc documentation to restructuresText
- sphinx-click: to generate the documentation from the click CLI
- furo: as a base template

The configuration of sphinx can be found in the `doc/conf.py` file and the versions are in the `conda_environment_sphinx.yaml` file. The `_build` folder is gitignored.

To build the documentation do:

```bash
cd doc/
make html
```

### ReadTheDocs

Please see the admin page of the toolbox: [here](https://readthedocs.org/projects/copernicusmarine/).

To access admin rights, you need to be added to the readthedocs project (after creating an account). For the moment Mathis and Simon are the admin of this page.

Example: [toolbox documentation](https://copernicusmarine.readthedocs.io)

Readthedocs have a webhook on the copernicusmarine repo and is triggered when: a commit is pushed, a tag is created and other events.

We defined some automatisation processes that listen to these events and trigger some actions.

- If a tag of a release is pushed (eg v1.3.3) then the doc is built and the v1.3.3 will be available and the default documentation ie any user going to the root of the documentation [https://copernicusmarine.readthedocs.io](https://copernicusmarine.readthedocs.io) will be directed to the newest version: `copernicusmarine.readthedocs.io/en/v1.3.3`.
- If a tag of a pre-release is pushed (eg v2.0.0a1) then the doc is built and the v2.0.0a1 is available but won't be the default one.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ run-tests-dependencie-versions:
${ACTIVATE_ENVIRONMENT}
tox run

run-using-pyinstaller-windows-latest:
pip install -e .
python -m PyInstaller --copy-metadata copernicusmarine --icon=toolbox_icon.png --copy-metadata xarray --name copernicusmarine.exe --add-data "C:\Users\runneradmin\micromamba\envs\copernicusmarine-binary\Lib\site-packages\distributed\distributed.yaml;.\distributed" copernicusmarine/command_line_interface/copernicus_marine.py --onefile

run-using-pyinstaller-macos-latest:
pip install -e .
python -m PyInstaller --collect-all tzdata --copy-metadata copernicusmarine --name copernicusmarine_macos-arm64.cli --icon=toolbox_icon.png copernicusmarine/command_line_interface/copernicus_marine.py --onefile --target-architecture=arm64

run-using-pyinstaller-macos-13:
pip install -e .
python -m PyInstaller --collect-all tzdata --copy-metadata copernicusmarine --name copernicusmarine_macos-x86_64.cli --icon=toolbox_icon.png copernicusmarine/command_line_interface/copernicus_marine.py --onefile --target-architecture=x86_64

run-using-pyinstaller-ubuntu-latest:
pip install -e .
python3 -m PyInstaller --collect-all tzdata --copy-metadata copernicusmarine --icon=toolbox_icon.png --name copernicusmarine_linux.cli --add-data="/home/runner/micromamba/envs/copernicusmarine-binary/lib/python3.12/site-packages/distributed/distributed.yaml:./distributed" copernicusmarine/command_line_interface/copernicus_marine.py --onefile --path /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages --copy-metadata xarray
chmod +rwx /home/runner/work/copernicus-marine-toolbox/copernicus-marine-toolbox/dist/copernicusmarine_linux.cli

release: SELECTED_ENVIRONMENT_NAME = ${ENVIRONMENT_NAME}
release:
${ACTIVATE_ENVIRONMENT}
Expand Down Expand Up @@ -90,3 +107,14 @@ build-and-publish-dockerhub-image:
docker build --ulimit nofile=65536:65536 --tag copernicusmarine/copernicusmarine:$${VERSION} --tag copernicusmarine/copernicusmarine:latest -f Dockerfile.dockerhub --build-arg VERSION="$${VERSION}" .
docker push copernicusmarine/copernicusmarine:$${VERSION}
docker push copernicusmarine/copernicusmarine:latest

build-and-prepare-for-binary:
python -m pip install --upgrade pip
pip install pyinstaller
pip install -e .
pip install poetry
pip install distributed
echo "VERSION=$$(poetry version --short)" >> ${GITHUB_OUTPUT}

update-snapshots-tests:
pytest --snapshot-update tests/test_command_line_interface.py::TestCommandLineInterface::test_describe_including_datasets
Loading
Loading