Skip to content

Commit

Permalink
Merge branch 'main' into geographic2cell_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Nov 22, 2024
2 parents 743d2d7 + ce81a17 commit 2877a77
Show file tree
Hide file tree
Showing 21 changed files with 275 additions and 128 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false

matrix:
os: ["ubuntu-latest", "macos-latest"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11", "3.12"]

steps:
Expand All @@ -61,13 +61,13 @@ jobs:
- name: Setup micromamba
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: "1.5.10-0"
environment-file: ${{ env.CONDA_ENV_FILE }}
environment-name: xdggs-tests
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: >-
python=${{matrix.python-version}}
conda
- name: Install xdggs
run: |
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/generated/
docs/**/generated/

# PyBuilder
.pybuilder/
Expand Down Expand Up @@ -163,3 +163,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# bibtex
.auctex-auto
*.bib.untidy
29 changes: 27 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: check-toml
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
args: [--cache-location=.prettier_cache/cache]
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
args: [--option, array_auto_collapse=false]
- id: taplo-lint
args: [--no-schema]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
hooks:
- id: validate-pyproject
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
Expand All @@ -27,11 +36,27 @@ repos:
- id: blackdoc
additional_dependencies: ["black==24.10.0"]
- id: blackdoc-autoupdate-black
- repo: https://github.com/citation-file-format/cffconvert
rev: b6045d78aac9e02b039703b030588d54d53262ac
hooks:
- id: validate-cff
- repo: https://github.com/kynan/nbstripout
rev: 0.8.0
hooks:
- id: nbstripout
args: [--extra-keys=metadata.kernelspec metadata.langauge_info.version]
- repo: https://github.com/FlamingTempura/bibtex-tidy
rev: v1.14.0
hooks:
- id: bibtex-tidy
stages: [manual]
args:
- "--modify"
- "--blank-lines"
- "--sort=-year,name"
- "--duplicates"
- "--escape"
- "--trailing-commas"

ci:
autofix_prs: true
Expand Down
45 changes: 45 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
cff-version: 1.2.0
title: xdggs
message: "If you use this software, please cite it as below."
type: software
authors:
- family-names: "Magin"
given-names: "Justus"
orcid: "https://orcid.org/0000-0002-4254-8002"
- family-names: "Bovy"
given-names: "Benoît"
orcid: "https://orcid.org/0009-0001-4011-3574"
- family-names: "Kmoch"
given-names: "Alexander"
orcid: "https://orcid.org/0000-0003-4386-4450"
- family-names: "Abernathey"
given-names: "Ryan"
orcid: "https://orcid.org/0000-0001-5999-4917"
- family-names: "Coca-Castro"
given-names: "Alejandro"
orcid: "https://orcid.org/0000-0002-9264-1539"
- family-names: "Strobl"
given-names: "Peter"
orcid: "https://orcid.org/0000-0003-2733-1822"
- family-names: "Fouilloux"
given-names: "Anne"
orcid: "https://orcid.org/0000-0002-1784-2920"
- family-names: "Loos"
given-names: "Daniel"
orcid: "https://orcid.org/0000-0002-4024-4443"
- family-names: "Chan"
given-names: "Wai Tik"
orcid: "https://orcid.org/0009-0005-3779-139X"
- family-names: "Delouis"
given-names: "Jean-Marc"
orcid: "https://orcid.org/0000-0002-0713-1658"
- family-names: "Odaka"
given-names: "Tina"
orcid: "https://orcid.org/0000-0002-1500-0156"
repository-code: "https://github.com/xarray-contrib/xdggs"
url: "https://xdggs.readthedocs.io"
keywords:
- xarray
- discrete global grid systems
- dggs
license: Apache-2.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ We welcome contributions to `xdggs`! Please follow these steps to get involved:

## Acknowledgments

This project was inspired by the increasing need for scalable geospatial data analysis using DGGS and is built upon the robust ecosystem of Xarray.
This project was initiated using funding from CNES (PANGEO IAOCEA, contract R&T R-S23/DU-0002-025-01) and the European Union (ERC, WaterSmartLand, 101125476, Interreg-BSR, HyTruck, #C031).
3 changes: 2 additions & 1 deletion ci/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
- sphinx-copybutton
- sphinx-design
- sphinx-inline-tabs
- sphinxcontrib-bibtex
- xarray
- healpy
- h5netcdf
- netcdf4
- pooch
Expand All @@ -27,4 +27,5 @@ dependencies:
- pip
- pip:
- h3ronpy
- cdshealpix
- -e ..
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ channels:
- conda-forge
dependencies:
- xarray
- healpy
- h5netcdf
- netcdf4
- pooch
Expand All @@ -18,3 +17,4 @@ dependencies:
- pip
- pip:
- h3ronpy
- cdshealpix
24 changes: 3 additions & 21 deletions ci/install-upstream-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
$conda remove -y --force \
xarray \
pandas \
healpy
cdshealpix
python -m pip uninstall -y h3ronpy

# install from scientific-python wheels
Expand All @@ -36,23 +36,5 @@ python -m pip install \
python -m pip install --no-deps --upgrade \
git+https://github.com/Unidata/cftime \
git+https://github.com/astropy/astropy \
"git+https://github.com/nmandery/h3ronpy#subdirectory=h3ronpy"

# install healpy from github
# need to run `auditwheel` to include the shared libs
python -m pip install auditwheel

# build and repair the wheel
# - manual clone
mkdir deps
git clone --filter=blob:none --quiet https://github.com/healpy/healpy deps/healpy
pushd deps/healpy
git submodule update --init --recursive -q
# - build and repair the wheel
mkdir -p built_wheel repaired_wheel
python -m pip wheel --no-deps . --wheel-dir built_wheel
auditwheel repair --plat linux_x86_64 -w repaired_wheel built_wheel/healpy-*.whl
# - install the repaired wheel
python -m pip install --upgrade --no-deps repaired_wheel/healpy-*.whl
# - clean up
popd; rm -rf deps
"git+https://github.com/nmandery/h3ronpy#subdirectory=h3ronpy" \
git+https://github.com/cds-astro/cds-healpix-python
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"IPython.sphinxext.ipython_console_highlighting",
"sphinx_autosummary_accessors",
"myst_nb",
"sphinxcontrib.bibtex",
]

extlinks = {
Expand Down Expand Up @@ -96,10 +97,15 @@
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"lonboard": ("https://developmentseed.org/lonboard/latest", None),
"healpy": ("https://healpy.readthedocs.io/en/latest", None),
"cdshealpix-python": ("https://cds-astro.github.io/cds-healpix-python", None),
"shapely": ("https://shapely.readthedocs.io/en/stable", None),
}

# -- myst-nb options ---------------------------------------------------------

nb_execution_timeout = -1
nb_execution_cache_path = "_build/myst-nb"

# -- sphinxcontrib-bibtex ----------------------------------------------------

bibtex_bibfiles = ["reference_guide/publications.bib"]
22 changes: 11 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ maxdepth: 3
caption: Tutorials
hidden: true
---
Tutorials <tutorials/index>
tutorials/h3
tutorials/healpix
```

```{toctree}
---
maxdepth: 3
caption: User guide
hidden: true
---
Publications <user_guide/publications>
```
<!-- ```{toctree} -->
<!-- --- -->
<!-- maxdepth: 3 -->
<!-- caption: User guide -->
<!-- hidden: true -->
<!-- --- -->
<!-- ``` -->

```{toctree}
---
maxdepth: 3
caption: Technical information
caption: Reference guide
hidden: true
---
Changelog <changelog>
API Reference <api>
Publications <reference_guide/publications>
```

# Welcome to `xdggs`
Expand Down
33 changes: 33 additions & 0 deletions docs/reference_guide/publications.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@misc{magin_2024_13934967,
author = {Magin, Justus and Bovy, Benoit and Delouis, Jean-Marc and Fouilloux, Anne and Coca-Castro, Alejandro and Abernathey, Ryan and Strobl, Peter and Kmoch, Alexander and Odaka, Tina Erica},
title = "{Advancing Geospatial Data Analysis with XDGGS}",
year = 2024,
month = oct,
doi = {10.5281/zenodo.13934967},
publisher = {Zenodo},
url = {https://doi.org/10.5281/zenodo.13934967},
version = {1.0},
}

@article{isprs-archives-XLVIII-4-W12-2024-75-2024,
author = {Kmoch, A. and Bovy, B. and Magin, J. and Abernathey, R. and Coca-Castro, A. and Strobl, P. and Fouilloux, A. and Loos, D. and Uuemaa, E. and Chan, W. T. and Delouis, J.-M. and Odaka, T.},
title = "{XDGGS: A community-developed Xarray package to support planetary DGGS data cube computations}",
journal = {The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
year = 2024,
volume = {XLVIII-4/W12-2024},
pages = {75--80},
doi = {10.5194/isprs-archives-XLVIII-4-W12-2024-75-2024},
url = {https://isprs-archives.copernicus.org/articles/XLVIII-4-W12-2024/75/2024/},
}

@inproceedings{kmoch2024,
title = {{{XDGGS}}: {{Xarray Extension}} for {{Discrete Global Grid Systems}} ({{DGGS}})},
shorttitle = {{XDGGS}},
author = {Kmoch, Alexander and Bovy, Beno{\^i}t and Magin, Justus and Abernathey, Ryan and Strobl, Peter and {Coca-Castro}, Alejandro and Fouilloux, Anne and Loos, Daniel and Odaka, Tina},
year = {2024},
month = Apr,
booktitle = {{{EGU General Assembly}} 2024},
address = {Vienna, Austria, 14-19 Apr 2024},
doi = {10.5194/egusphere-egu24-15416},
urldate = {2024-11-18},
}
9 changes: 9 additions & 0 deletions docs/reference_guide/publications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Publications mentioning `xdggs`

```{bibliography} publications.bib
---
all: true
list: bullet
style: alpha
---
```
24 changes: 17 additions & 7 deletions docs/tutorials/healpix.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,29 @@
"derived_ds"
]
},
{
"cell_type": "markdown",
"id": "11",
"metadata": {},
"source": [
"```{note}\n",
"We need to use {py:func}`xarray.testing.assert_allclose` to compare cell centers because the cell center coordinates were computed using a [different library](https://github.com/healpy/healpy) with a slightly different implementation, resulting in small floating point differences.\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"id": "12",
"metadata": {},
"outputs": [],
"source": [
"xr.testing.assert_equal(derived_ds, original_ds)"
"xr.testing.assert_allclose(derived_ds, original_ds)"
]
},
{
"cell_type": "markdown",
"id": "12",
"id": "13",
"metadata": {},
"source": [
"### Cell boundary polygons\n",
Expand All @@ -175,7 +185,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "13",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -185,7 +195,7 @@
},
{
"cell_type": "markdown",
"id": "14",
"id": "15",
"metadata": {},
"source": [
"## Plotting\n",
Expand All @@ -200,7 +210,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "15",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -219,7 +229,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2877a77

Please sign in to comment.