Commit d3cf2aaa authored by BODERE's avatar BODERE
Browse files

Features/documentation

parent a2cea61a
...@@ -33,7 +33,6 @@ nosetests.xml ...@@ -33,7 +33,6 @@ nosetests.xml
.project .project
.pydevproject .pydevproject
*.pyc *.pyc
*.pyo *.pyo
DS_Store DS_Store
...@@ -44,34 +43,7 @@ VERSION.txt ...@@ -44,34 +43,7 @@ VERSION.txt
migrations migrations
*/migrations/*.py */migrations/*.py
src/datamodel/test/data/GW_L2P_ALT_ENVI_GDR_20110101_061209_20110101_070215_098_078.nc /src/
src/datamodel/test/data/polarfront_2008-09-09T050025_2008-10-17T114909_HiWASE_2008_FORE.nc /cerbere/**/*.nc
src/datamodel/test/data/QS_S2B54289.20093261508 /tests/data/
src/datamodel/test/data/WMO51101_20110101T0050_20110131T2350_Lat_24.32N_Lon_162.06W.nc /public/
src/datamodel/test/data/20120109000000-OSISAF-L3C_GHRSST-SSTsubskin-SEVIRI_SST-ssteqc_meteosat09_20120109_000000-v02.0-fv01.0.nc
src/datamodel/test/data/20120323-ATS_NR_2P-UPA-L2P-ATS_NR__2PNPDK20120323_185109_000062203113_00042_52642_2614-v01.nc
src/20130404-NCDC-L4LRblend-GLOB-v01-fv02_0-AVHRR_OI.nc
src/20130516-IFR-L4_GHRSST-SSTfnd-ODYSSEA-GLOB_010-v2.0-fv1.0.nc
src/datamodel/fastregrid.c
src/dmi.nc
src/hrdds1.nc
src/hrdds2.nc
src/test.py
cerbere/20130404-NCDC-L4LRblend-GLOB-v01-fv02_0-AVHRR_OI.nc
cerbere/20130516-IFR-L4_GHRSST-SSTfnd-ODYSSEA-GLOB_010-v2.0-fv1.0.nc
cerbere/datamodel/fastregrid.c
cerbere/datamodel/test/data/20120109000000-OSISAF-L3C_GHRSST-SSTsubskin-SEVIRI_SST-ssteqc_meteosat09_20120109_000000-v02.0-fv01.0.nc
cerbere/datamodel/test/data/20120323-ATS_NR_2P-UPA-L2P-ATS_NR__2PNPDK20120323_185109_000062203113_00042_52642_2614-v01.nc
cerbere/datamodel/test/data/GW_L2P_ALT_ENVI_GDR_20110101_061209_20110101_070215_098_078.nc
cerbere/datamodel/test/data/QS_S2B54289.20093261508
cerbere/datamodel/test/data/WMO51101_20110101T0050_20110131T2350_Lat_24.32N_Lon_162.06W.nc
cerbere/datamodel/test/data/polarfront_2008-09-09T050025_2008-10-17T114909_HiWASE_2008_FORE.nc
cerbere/dmi.nc
cerbere/hrdds1.nc
cerbere/hrdds2.nc
tests/data/20120109000000-OSISAF-L3C_GHRSST-SSTsubskin-SEVIRI_SST-ssteqc_meteosat09_20120109_000000-v02.0-fv01.0.nc
tests/data/20120323-ATS_NR_2P-UPA-L2P-ATS_NR__2PNPDK20120323_185109_000062203113_00042_52642_2614-v01.nc
tests/data/GW_L2P_ALT_ENVI_GDR_20110101_061209_20110101_070215_098_078.nc
tests/data/QS_S2B54289.20093261508
tests/data/WMO51101_20110101T0050_20110131T2350_Lat_24.32N_Lon_162.06W.nc
tests/data/polarfront_2008-09-09T050025_2008-10-17T114909_HiWASE_2008_FORE.nc
# ---------------------------------------------------------------
# Global
# ---------------------------------------------------------------
# default image
image: continuumio/miniconda3:latest
# stages (main steps of pipeline)
stages:
# - Quality
# - Tests
# - Sonarqube
- Documentation
# - Deploy
# ---------------------------------------------------------------
# Jobs templates
# ---------------------------------------------------------------
.code-changes-template: &code-changes
only:
changes:
- ${CI_PROJECT_NAME}/**/*.py
- tests/**/*.py
- .gitlab-ci.yml
- pyproject.toml
.install-deps-conda-template-37: &install-conda-deps-37
before_script:
- conda create -n cerbere python=3.7
- source activate cerbere
- conda install -c conda-forge pygrib
- pip install poetry poetry-dynamic-versioning poetry2conda
- poetry config virtualenvs.in-project false
- poetry install -vv
tags: [cerbere-runner]
.install-deps-conda-template-38: &install-conda-deps-38
before_script:
- conda create -n cerbere python=3.8
- source activate cerbere
- conda install -c conda-forge pygrib
- pip install poetry poetry-dynamic-versioning poetry2conda
- poetry config virtualenvs.in-project false
- poetry install -vv
tags: [cerbere-runner]
.install-deps-conda-template-39: &install-conda-deps-39
before_script:
- conda create -n cerbere python=3.9
- source activate cerbere
- conda install -c conda-forge pygrib
- pip install poetry poetry-dynamic-versioning poetry2conda
- poetry config virtualenvs.in-project false
- poetry install -vv
tags: [cerbere-runner]
.quality-template: &quality
<<: *install-conda-deps-38
<<: *code-changes
stage: Quality
allow_failure: true
except:
- tags
.test-template-37: &test_37
<<: *install-conda-deps-37
<<: *code-changes
stage: Tests
script:
- poetry run pytest tests/
except:
- tags
.test-template-38: &test_38
<<: *install-conda-deps-38
<<: *code-changes
stage: Tests
script:
- poetry run pytest tests/
except:
- tags
# ---------------------------------------------------------------
# Quality jobs
# ---------------------------------------------------------------
#flake8:
# <<: *quality
# script:
# - poetry run flake8 --max-line-length=120 --docstring-convention google ${CI_PROJECT_NAME}
#
#pylint:
# <<: *quality
# script:
# #- poetry run pylint -j8 -E ${CI_PROJECT_NAME} tests
# - "poetry run pylint --exit-zero ${CI_PROJECT_NAME} tests -r n --max-line-length=120 --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' | tee pylint.txt"
# artifacts:
# expire_in: 1 week
# paths:
# - pylint.txt
# ---------------------------------------------------------------
# Test jobs
# ---------------------------------------------------------------
#python3.7:
# <<: *test_37
# image: continuumio/miniconda3
# allow_failure: true
# script:
# - poetry run pytest tests/
#
#python3.8:
# <<: *test_38
# image: continuumio/miniconda3
# allow_failure: true
# script:
# - poetry run pytest tests/
#
#python3.9:
# <<: *install-conda-deps-39
# <<: *code-changes
# stage: Tests
# image: continuumio/miniconda3
# coverage: '/^TOTAL\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+\%)/'
# allow_failure: true
# script:
# - poetry run pytest --cov=${CI_PROJECT_NAME} --cov-branch --cov-report=term tests/
# - poetry run pytest -ra -q --cov=${CI_PROJECT_NAME} --cov-branch --cov-report xml:coverage.xml tests/
# artifacts:
# expire_in: 1 week
# paths:
# - coverage.xml
# except:
# - tags
# ---------------------------------------------------------------
# SonarQube
# ---------------------------------------------------------------
#sonarqube:
# stage: Sonarqube
# tags: [cerbere-runner]
# image:
# name: sonarsource/sonar-scanner-cli:latest
# entrypoint: [""]
# allow_failure: true
# script:
# - sonar-scanner
# -Dsonar.projectKey=${CI_PROJECT_NAME}
# -Dsonar.language=py
# -Dsonar.host.url=http://visi-common-sonar:9000
# -Dsonar.login=e6f816eee72d3d5c03319ec74b468157b9164d12
# -Dsonar.sourceEncoding=UTF-8
# -Dsonar.python.coverage.reportPaths=coverage.xml
# -Dsonar.coverage.exclusions=**__init__**,tests/**
# -Dsonar.python.pylint.reportPath=pylint.txt
# <<: *code-changes
# except:
# - tags
# ---------------------------------------------------------------
# Documentation job
# ---------------------------------------------------------------
pages:
<<: *install-conda-deps-38
image: continuumio/miniconda3 # does not work with python 3.9
stage: Documentation
#allow_failure: true
script:
- poetry run mkdocs build -f docs/mkdocs.yml -v
- mv docs/site public
only:
refs:
- master
changes:
- docs/**/*
- .gitlab-ci.yml
artifacts:
paths:
- public
except:
- tags
## ---------------------------------------------------------------
## Release job
## ---------------------------------------------------------------
#nexus:
# <<: *install-conda-deps-38
# stage: Deploy
# script:
# - poetry build --format wheel
# - poetry config repositories.nexus-public-release https://nexus-test.ifremer.fr/repository/hosted-pypi-public-release/
# - poetry publish -r nexus-public-release -u nexus-ci -p w2bH2NjgFmQnzVk3
# only:
# - tags
...@@ -5,3 +5,70 @@ CERBERE ...@@ -5,3 +5,70 @@ CERBERE
The IFREMER / CERSAT geospatial processing tool. The IFREMER / CERSAT geospatial processing tool.
See online documentation at: http://cerbere.readthedocs.org See online documentation at: http://cerbere.readthedocs.org
---------------
Development
---------------
Create conda env
=================
.. code-block:: shell
conda creaate -n cerbere -c conda-forge python=3.7 pygrib netcdf4 pyproj xarray
Install poetry
=================
.. code-block:: shell
pip install poetry poetry-dynamic-versioning poetry2conda
poetry --version
poetry config repositories.nexus-public-release https://nexus-test.ifremer.fr/repository/hosted-pypi-public-release/
retrieve and install project
=============================
.. code-block:: shell
git clone https://gitlab.ifremer.fr/cerbere/cerbere.git
poetry install -v --no-root
List dependencies
==================
.. code-block:: shell
poetry show --tree
---------------
build
---------------
wheel
==================
.. code-block:: shell
poetry build --format wheel
poetry publish -r nexus-public-release -u nexus-ci -p w2bH2NjgFmQnzVk3
conda
==================
.. code-block:: shell
mkdir -p dist/conda
conda build assets/conda -c conda-forge --output-folder dist/conda
documentation
==================
.. code-block:: shell
poetry run sphinx-build -b html docs public
# -----------------------------------------------------------
# Package metadata
# -----------------------------------------------------------
package:
name: cerbere
version: 0.1.0
about:
home: https://gitlab.ifremer.fr/cerbere/cerbere
license: GPLv3
license_file: LICENSE.md
# -----------------------------------------------------------
# Package build
# -----------------------------------------------------------
# extra conda channels
channel:
- conda-forge
# path to root package
source:
path: ../../
# command to install package (here from wheel)
build:
#script: pip install ./dist/cerbere-*.whl
script: "poetry install --no-dev"
requirements:
# to build package
build:
- python
- pip
- wheel
# to be used at runtime
run:
- python #
- pyyaml # pypi : PyYAML
- netcdf4 # pypi : netCDF4
- scipy # pypi : scipy
- shapely # pypi : shapely
- xarray # pypi : xarray
#test:
# imports:
# - cerbere
This diff is collapsed.
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "cerbere"
version = "0.0.0"
description = "A python API to manipulate spatial and temporal observations, compatible with many existing formats, normalizing and typing the representation of these observations."
license = "AOSI Approved :: GNU General Public License v3 (GPLv3)"
authors = ["Jean-François Piollé (Ifremer) <jean.francois.piolle@ifremer.fr>"]
maintainers = [
"Jean-François Piollé (Ifremer) <jean.francois.piolle@ifremer.fr>",
"David Poulter <david.poulter@pelamis.co.uk>",
"Antoine Grouazel <antoine.grouazel@ifremer.fr>",
"Gilles Guitton <gilles.guitton@oceandatalab.com>",
"Sylvain Herlédan <sylvain.herledan@oceandatalab.com>",
]
readme = "README.rst"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8"
]
keywords = ["ocean", "observation", "data", "analysis"]
exclude = ["tests"]
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
pattern = "^v?(?P<base>\\d+\\.\\d+\\.\\d+)(-?((?P<stage>[a-zA-Z]+)\\.?(?P<revision>\\d+)?))?$"
# [[tool.poetry.source]]
# name = "nexus-isi"
# url = "https://nexus-test.ifremer.fr/repository/pypi-public-release/simple"
[tool.poetry.dependencies]
python = "^3.7"
PyYAML = "^5.3"
netCDF4 = "^1.5"
scipy = '1.5.4'
shapely = "^1.7"
xarray = "^0.16"
[tool.poetry.dev-dependencies]
# static analysis
flake8 = "^3.8"
flake8-docstrings = "^1.5"
pylint = "^2.6"
# unit tests
pytest = "^6"
pytest-cov = "^2"
testfixtures = "^6"
# documentation
sphinx = "!=1.6.6,!=1.6.7,>=1.6.5"
sphinx_autodoc_typehints = "^1.11.0"
sphinx-rtd-theme = "^0.5.0"
[tool.poetry.plugins."cerbere.plugins"]
Dataset = "cerbere.dataset.dataset:Dataset"
NCDataset = "cerbere.dataset.ncdataset:NCDataset"
GHRSSTNCDataset = "cerbere.dataset.ghrsstncdataset:GHRSSTNCDataset"
[tool.poetry.plugins."cerbere.features"]
Grid = "cerbere.feature.grid:Grid"
CylindricalGrid = "cerbere.feature.grid:CylindricalGrid"
Swath = "cerbere.feature.swath:Swath"
Image = "cerbere.feature.image:Image"
Trajectory = "cerbere.feature.trajectory:Trajectory"
GridTimeSeries = "cerbere.feature.gridtimeseries:GridTimeSeries"
CylindricalGridTimeSeries = "cerbere.feature.gridtimeseries:CylindricalGridTimeSerie"
Profile = "cerbere.feature.profile:Profile"
IMDCollection = "cerbere.feature.imdcollection:IMDCollection"
OMDCollection = "cerbere.feature.omdcollection:OMDCollection"
TrajectoryProfile = "cerbere.feature.trajectoryprofile:TrajectoryProfile"
TimeSeriesProfile = "cerbere.feature.timeseriesprofile:TimeSeriesProfile"
UniZTimeSeriesProfile = "cerbere.feature.timeseriesprofile:UniZTimeSeriesProfile"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment