Skip to content

Commit

Permalink
Merge pull request #7 from esa-cci/main
Browse files Browse the repository at this point in the history
Merging ESA-CCI Main into Fork
  • Loading branch information
gamedaygeorge authored Oct 15, 2024
2 parents 16055b8 + 856b1ac commit caa01a8
Show file tree
Hide file tree
Showing 33 changed files with 60,702 additions and 145 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: publish to PyPI

on:
release:
types: [published]

jobs:
deploy:
name: Publish to PyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
run: |
pip install twine
python -m twine upload --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} dist/*
22 changes: 22 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## Changes in 1.1

* Support numpy >= 2.0 and pydap >= 3.4
* Automatically publish packages on pypi at release
* Improved support of vector data cubes
* Support HR LC data
* Added user functions for regions:
* `get_land_mask`: Gets a land mask for a dataset.
* `get_regions_mask`: Gets a regions mask for a dataset.
* `make_regions_dataset`: Rasterize country and continent polygons into a
grid provided by a template dataset.
* `mask_dataset_by_land`: Masks out non-land-pixels of a dataset.
* `mask_dataset_by_regions`: Masks out pixels of a dataset which are not in
one of the specified regions.
* Added notebooks:
* `ESA CCI Toolbox Vector Data Cube Access`: Explaining the handling of
vector data cubes
* `Using the ESA CCI Toolbox with the xcube Viewer`: Explaining how to access
the xcube viewer from within a Jupyter Notebook
* Extended documentation by a section on how to configure an xcube server to
serve data from the ESA CCI Toolbox

## Changes in 1.0.2

* Updated list of dataset states
Expand Down
72 changes: 43 additions & 29 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,68 @@
version: '{build}'

image:
- Ubuntu2204
- macOS
- Ubuntu2004

configuration: Release

platform:
- x64

environment:
# For the unit-tests, disable Numba JIT, otherwise Coverage wont reach the actual Python code
NUMBA_DISABLE_JIT: 1
# Do not build feature branch with open Pull Requests.
# Note that a feature branch build may still occur on the first push to
# the branch -- see
# https://help.appveyor.com/discussions/questions/18437-skip_branch_with_pr-setting-doesnt-work
skip_branch_with_pr: true

for:
-
matrix:
only:
- image: macos
- image: macOS
install:
- curl -L https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-x86_64.sh > miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- curl -Ls https://micro.mamba.pm/api/micromamba/osx-64/latest | tar -xvj bin/micromamba
- mv bin/micromamba ./micromamba
-
matrix:
only:
- image: Ubuntu2004
- image: Ubuntu2204
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
- mv bin/micromamba ./micromamba

build_script:
- export PATH="$HOME/miniconda/bin:$PATH"
# Diagnostics
- echo $PLATFORM
- echo $APPVEYOR_BUILD_WORKER_IMAGE
- echo $APPVEYOR_BUILD_FOLDER
- uname -a
- pwd
- ls

# Set up micromamba
- ./micromamba shell init -s bash --root-prefix ~/micromamba
- source ~/.bashrc
- source ~/.profile
- hash -r
- conda config --set always_yes yes --set changeps1 no
# - conda update -q conda # makes travis build fail
# Useful for debugging any issues with conda
- conda info -a
- conda init bash
- export CONDA_BASE=$(conda info --base)
- source $CONDA_BASE/etc/profile.d/conda.sh

# Install mamba as a dramatically faster conda replacement. Specifying a
# fixed version makes the installation of mamba itself much faster, and
# avoids potential breakage due to changes in mamba behaviour.
- conda install -c conda-forge mamba

- mamba env create
- conda activate ect
- mkdir -p ~/micromamba/pkgs/
- export MAMBA_ROOT_PREFIX=~/micromamba
- export MAMBA_EXE=$(pwd)/micromamba
- . $MAMBA_ROOT_PREFIX/etc/profile.d/mamba.sh

# Create environment from build folder environment.yml and install xcube
- micromamba create --name ect --file $APPVEYOR_BUILD_FOLDER/environment.yml
- micromamba activate ect
- cd $APPVEYOR_BUILD_FOLDER
- pip install --no-deps .
- conda list

# Run the test suite.
- pytest -v --cov=esa-climate-toolbox test
# Make sure pytest is installed
- micromamba install --yes --name ect --channel conda-forge pytest attrs

# Print some diagnostics (useful for debugging)
- git status
- micromamba list
- python -c "from esa_climate_toolbox import __version__; print(f'ESA CCI Toolbox version {__version__}')"

# Run the test suite
- pytest -v --cov=esa_climate_toolbox
5 changes: 4 additions & 1 deletion docs/source/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@ In addition to operations provided by the ESA CII Toolbox, the Python packages
`xarray`_, `pandas`_, and `geopandas`_ provide a rich and powerful low-level
data processing interface for the datasets opened through the Toolbox.

You can find detailed listings of the provided functionality in
Also, there are further functions which are not operations but which have been found
to be useful for working with cci data.

You can find detailed listings of the provided functionalities in
:doc:`api_reference`.
19 changes: 19 additions & 0 deletions docs/source/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ Reading and Writing Data
.. autofunction:: esa_climate_toolbox.core.write_data


Functions
=========

.. _regions:

Region
------

.. autofunction:: esa_climate_toolbox.functions.regions.get_land_mask

.. autofunction:: esa_climate_toolbox.functions.regions.get_regions_mask

.. autofunction:: esa_climate_toolbox.functions.regions.make_regions_dataset

.. autofunction:: esa_climate_toolbox.functions.regions.mask_dataset_by_land

.. autofunction:: esa_climate_toolbox.functions.regions.mask_dataset_by_regions


Operations
==========

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# -- Project information

project = 'ESA CCI Toolbox'
copyright = '2023, Brockmann Consult GmbH'
copyright = '2024, Brockmann Consult GmbH'
author = 'Brockmann Consult GmbH'

release = __version__
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,5 @@ For support with the CCI Toolbox, please visit our `Helpdesk`_.
about
installation_guide
quick_start
viewer
api_reference
Loading

0 comments on commit caa01a8

Please sign in to comment.