Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
016e190
ci: add gitlab-ci.yml
Mar 24, 2025
f91326f
test: add pytest fixture lenapy_paths
Mar 25, 2025
3901ae2
ci: check notebooks
Mar 25, 2025
625b976
test: start adding tests
Mar 26, 2025
783a397
test: add dummy tests
Mar 26, 2025
6c1a143
ci: update pytest
Mar 26, 2025
5b806be
test: add writers test
Mar 26, 2025
358d0df
test: add climato test
Mar 26, 2025
19a8a0a
test: add test dep
Apr 2, 2025
443e625
test: add lngeo tests
Apr 2, 2025
72bbfc4
ci: export proxy for tests
Apr 2, 2025
f6f8820
test: add test_lngeo.test_isosurface
Apr 2, 2025
77af278
test: add test_lnocean
Apr 2, 2025
08eab9b
ci: add github ci
Apr 2, 2025
a3dae9f
ci: add action 'publish-unit-test-result-action'
Apr 3, 2025
66e0884
ci: add doc build job
Apr 3, 2025
2e51ba4
ci: add retention-days to doc artifact
Apr 3, 2025
0c5d184
refact: refactor gravi_writer
Apr 3, 2025
f3ede30
test: add test_harmo
Apr 7, 2025
b9a273f
test: remove some file from coverage measurements
Apr 7, 2025
295480b
test: add test_lenapy_grace
Apr 7, 2025
19ca0b3
docs: remove functions from pylint checks
Apr 14, 2025
92634fc
ci: remove bash -l {0} from formater job
Apr 16, 2025
5963136
test: add pytest parameter '--overwrite_references'
Apr 17, 2025
5e8ff3a
style: add type hints
Apr 23, 2025
f3e6bb0
refact: remove unused argument
Apr 23, 2025
f365981
test: add test_lntime
Apr 23, 2025
fef592a
test: add test_gravity
Apr 23, 2025
d385d8a
test: add test_lnharmo.py
Apr 23, 2025
d83c396
test: add test_lnharmo.py
Apr 23, 2025
e5aa393
test: add test_lntime_gls
Apr 24, 2025
7a31362
refact: refactor sh_to_grid
Apr 15, 2025
de18a61
refact: refactor compute_plm
Apr 15, 2025
79be792
refact: refactor l_factor_conv
Apr 16, 2025
70a49ab
refact: refactor ReadGFC.open_dataset
Apr 16, 2025
115241f
refact: refactor ReadGRACEL2.open_dataset
Apr 16, 2025
021c715
feat: args to ignore some files in cc.
Apr 17, 2025
1bbc171
test: overwrite references if required
Apr 24, 2025
4d1be13
style: docstring to english
Apr 28, 2025
1b0573c
refact: remove useless variable
May 6, 2025
080fa4a
ci: add doc generation
May 6, 2025
a673658
test: assert_allclose instead of assert_equal
May 6, 2025
3a87ab9
ci: missing stage
May 6, 2025
bd0e0e8
Merge branch 'refac_pylint' into 'main'
May 14, 2025
9ef18e1
Improve ICGEM gfc reader
May 23, 2025
b927e30
Gestion des cycles annuels dans lntime.filter
sfourest May 26, 2025
47306fd
Filtrage Stavitzky Golay
sfourest May 27, 2025
b6c4906
Merge branch 'seb_20250521' into 'main'
sfourest May 27, 2025
b851548
doc: refac doc
Apr 29, 2025
b63c634
doc: sphinx complain about docstrings
May 20, 2025
3646cb4
doc: translate Climato notebook to english
May 20, 2025
a3ea8f4
doc: add rtd specific
May 20, 2025
be9a604
doc: small edits
May 28, 2025
0b29d79
doc: missing dep
May 28, 2025
9ce15f0
doc: update maxdepth
May 28, 2025
e5ad467
doc: force navigation_depth to 3
May 28, 2025
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
196 changes: 196 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
name: CI Pipeline

on:
push:
branches:
- main
- develop
pull_request:
branches:
- '**'

jobs:
build-env:
name: Build Conda Environment
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: lenapy_env
environment-file: environment.yml
auto-activate-base: false

- name: Cache Conda environment
uses: actions/cache@v4
with:
path: /usr/share/miniconda/envs/lenapy_env
key: conda-${{ runner.os }}-${{ hashFiles('environment.yml') }}
restore-keys: |
conda-${{ runner.os }}-

formater:
name: Code Formatting Check
runs-on: ubuntu-latest
needs: build-env
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Dependencies
shell: bash -l {0}
run: pip install -e .[formatter]

- name: Run Black & Isort
run: |
black --check --diff lenapy
isort lenapy --check --diff

pytest:
name: Run Pytest
runs-on: ubuntu-latest
needs: build-env
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
activate-environment: lenapy_env

- name: Restore Conda environment
uses: actions/cache@v4
with:
path: /usr/share/miniconda/envs/lenapy_env
key: conda-${{ runner.os }}-${{ hashFiles('environment.yml') }}

- name: Run Pytest with Coverage
shell: bash -l {0}
run: |
pip install -e .[test]
pytest -s tests --cov=lenapy --cov-report=xml:.ci-reports/coverage.xml --cov-report html:cov_html --cov-report=term --junitxml=pytest-results.xml

- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
.ci-reports/
cov_html/
pytest-results.xml
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: pytest-results.xml

test_notebooks:
name: Test Jupyter Notebooks
runs-on: ubuntu-latest
needs: build-env
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
activate-environment: lenapy_env

- name: Restore Conda environment
uses: actions/cache@v4
with:
path: /usr/share/miniconda/envs/lenapy_env
key: conda-${{ runner.os }}-${{ hashFiles('environment.yml') }}

- name: Install Notebook Dependencies
shell: bash -l {0}
run: |
pip install -e .[test]
pip install -e .[notebook]

- name: Run Pytest on Notebooks
shell: bash -l {0}
run: |
pytest --nbmake --nbmake-kernel=python3 doc/tutorials/

pylint_analysis:
name: Pylint Code Analysis
runs-on: ubuntu-latest
needs: build-env
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Dependencies
shell: bash -l {0}
run: pip install -e .[quality]

- name: Run Pylint
shell: bash -l {0}
run: |
pylint --recursive=y --disable=all --fail-under=10 --enable=too-many-statements,too-many-nested-blocks lenapy

mccabe_analysis:
name: McCabe Complexity Analysis
runs-on: ubuntu-latest
needs: build-env
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: lenapy
auto-activate-base: false

- name: Install Quality Tools
shell: bash -l {0}
run: pip install .[quality]

- name: Run McCabe Complexity Check
shell: bash -l {0}
run: ./continuous_integration/scripts/check_mccabe_complexity.sh 25 lenapy lenapy/readers/ocean.py lenapy/plots/plotting.py

build_doc:
name: Build sphinx documentation
runs-on: ubuntu-latest
needs: build-env
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
activate-environment: lenapy_env

- name: Restore Conda environment
uses: actions/cache@v4
with:
path: /usr/share/miniconda/envs/lenapy_env
key: conda-${{ runner.os }}-${{ hashFiles('environment.yml') }}

- name: Install documentation dependencies
shell: bash -l {0}
run: pip install .[doc]
- name: Build doc
shell: bash -l {0}
run: |
conda install pandoc
sphinx-build -b html doc doc/build

- name: Upload doc as artefact
uses: actions/upload-artifact@v4
with:
name: doc-build
path: |
doc/build
retention-days: 7
133 changes: 133 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH

stages:
- init
- quality
- documentation

# Default configuration for all jobs
default:
tags:
- Usine_Logicielle
timeout: 30 minutes

variables:
DEBUG:
value: 'false'
description: "Afficher des logs supplémentaires"

TAG_IMAGE_CONDA: "publicremotes-docker/continuumio/miniconda3:23.5.2-0"
TAG_IMAGE_SONAR: "publicremotes-docker/sonarsource/sonar-scanner-cli:4.5"
CI: "true"
JFROG_CLI_HOME_DIR: ".jfrog/"
JFROG_CLI_TEMP_DIR: ".jfrog_tmp"
JFROG_VERSION: "v2/2.14.0"
JFROG_OS: "jfrog-cli-linux-amd64"
JFROG_CLI_BUILD_NAME: "${CI_PROJECT_PATH}_${CI_COMMIT_REF_SLUG}_gitlab-ci"
JFROG_CLI_BUILD_NUMBER: "${CI_PIPELINE_ID}"

ARTIFACTORY_BUILD_URL: "https://${artifactory_host}/artifactory/webapp/#/builds/${JFROG_CLI_BUILD_NAME}/${JFROG_CLI_BUILD_NUMBER}"
CI_TEMPLATE_REGISTRY_HOST: "${ARTIFACTORY_HOST}/publicremotes-docker"
PIP_INDEX_URL: "https://${ARTIFACTORY_USER}:${ARTIFACTORY_TOKEN}@${ARTIFACTORY_HOST}/artifactory/api/pypi/pypi/simple"
PIP_CERT: "${CNES_CERTIFICATE}"
PIP_CACHE_DIR: ".pip-cache/"
CONDA_ENVS_DIRS: ".conda/envs"
CONDA_SSL_VERIFY: "${CNES_CERTIFICATE}"
PIP_SSL_VERIFY: "${CNES_CERTIFICATE}"
REQUESTS_CA_BUNDLE: "${CNES_CERTIFICATE}"

build-env:
stage: init
image: ${ARTIFACTORY_HOST}/${TAG_IMAGE_CONDA}
before_script:
- export no_proxy=$NO_PROXY
- export http_proxy=$HTTP_PROXY
- export https_proxy=$HTTP_PROXY
- mkdir -p ${CONDA_ENVS_DIRS}
- pip install conda-lock
script:
- conda-lock install --name lenapy_env conda-lock.yml
timeout: 15 minutes
artifacts:
untracked: true
expire_in: 1 day

formater:
stage: quality
image: ${ARTIFACTORY_HOST}/${TAG_IMAGE_CONDA}
before_script:
- source activate lenapy_env
- pip install .[formatter]
script:
- python -m black --check --diff lenapy
- python -m isort lenapy --check --diff

pytest:
stage: quality
image: ${ARTIFACTORY_HOST}/${TAG_IMAGE_CONDA}
before_script:
- export no_proxy=$NO_PROXY
- export http_proxy=$HTTP_PROXY
- export https_proxy=$HTTP_PROXY
script:
- source activate lenapy_env
- pip install -e .[test]
- pytest -s tests --cov=lenapy --cov-report=xml:.ci-reports/coverage.xml --cov-report html:cov_html --cov-report=term --junitxml=.ci-reports/junit-report.xml
artifacts:
when: always
paths:
- ./.ci-reports/
- ./cov_html/
expire_in: 1 day

test_notebooks:
stage: quality
image: ${ARTIFACTORY_HOST}/${TAG_IMAGE_CONDA}
script:
- source activate lenapy_env
- pip install -e .[test]
- pip install -e .[notebook]
- pytest --nbmake --nbmake-kernel=python3 doc/tutorials/

pylint_analysis:
stage: quality
image: ${ARTIFACTORY_HOST}/${TAG_IMAGE_CONDA}
script:
- source activate lenapy_env
- pip install .[quality]
- pylint --recursive=y --disable=all --fail-under=10 --enable=too-many-statements,too-many-nested-blocks lenapy | tee pylint_report.txt
artifacts:
when: always
paths:
- pylint_report.txt
expire_in: 1 day

mccabe_analysis:
stage: quality
image: ${ARTIFACTORY_HOST}/${TAG_IMAGE_CONDA}
script:
- source activate lenapy_env
- pip install .[quality]
- ./continuous_integration/scripts/check_mccabe_complexity.sh 25 lenapy lenapy/readers/ocean.py lenapy/plots/plotting.py

build_doc:
stage: documentation
image: ${ARTIFACTORY_HOST}/${TAG_IMAGE_CONDA}
before_script:
- source activate lenapy_env
- pip install .[doc]
script:
- conda install pandoc
- sphinx-build -b html doc doc/build
artifacts:
when: always
paths:
- doc/build
expire_in: 7 day
8 changes: 4 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ sphinx:
# 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:
- requirements: doc/requirements.txt

conda:
environment: doc/environment.yml
python:
install:
- method: pip
path: .
File renamed without changes.
Loading
Loading