generated from carbonplan/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into split-levels
- Loading branch information
Showing
21 changed files
with
342 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: 'monthly' | ||
interval: "monthly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: codspeed-benchmarks | ||
|
||
on: | ||
# Run on pushes to the main branch | ||
push: | ||
branches: | ||
- "main" | ||
# Run on pull requests | ||
pull_request: | ||
# `workflow_dispatch` allows CodSpeed to trigger backtest | ||
# performance analysis in order to generate initial data. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
benchmarks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Conda environment from environment.yml | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
# environment-file is not assumed anymore | ||
environment-file: ci/environment.yml | ||
create-args: >- | ||
python=3.10 | ||
# now called cache-environment | ||
cache-environment: true | ||
|
||
- name: Install package | ||
run: | | ||
python -m pip install . --no-deps | ||
- name: Conda list information | ||
run: | | ||
conda env list | ||
conda list | ||
- name: Run benchmarks | ||
uses: CodSpeedHQ/action@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: github.repository == 'carbonplan/ndpyramid' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v5 | ||
name: Install Python | ||
with: | ||
python-version: 3.9 | ||
|
@@ -39,7 +39,7 @@ jobs: | |
else | ||
echo "✅ Looks good" | ||
fi | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: releases | ||
path: dist | ||
|
@@ -48,11 +48,11 @@ jobs: | |
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v5 | ||
name: Install Python | ||
with: | ||
python-version: 3.9 | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: releases | ||
path: dist | ||
|
@@ -73,12 +73,12 @@ jobs: | |
if: github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: releases | ||
path: dist | ||
- name: Publish package to PyPI | ||
uses: pypa/[email protected].8 | ||
uses: pypa/[email protected].11 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the version of Python and other tools you might need | ||
build: | ||
os: ubuntu-20.04 | ||
tools: | ||
python: "mambaforge-4.10" | ||
|
||
# Build documentation in the doc/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally declare the Python requirements required to build your docs | ||
conda: | ||
environment: ci/doc.yml | ||
python: | ||
install: | ||
- method: pip | ||
path: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
<p align='left'> | ||
<a href='https://carbonplan.org/#gh-light-mode-only'> | ||
<img | ||
src='https://carbonplan-assets.s3.amazonaws.com/monogram/dark-small.png' | ||
height='48px' | ||
/> | ||
</a> | ||
<a href='https://carbonplan.org/#gh-dark-mode-only'> | ||
<img | ||
src='https://carbonplan-assets.s3.amazonaws.com/monogram/light-small.png' | ||
height='48px' | ||
/> | ||
</a> | ||
<p align="left" > | ||
<a href='https://carbonplan.org'> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://carbonplan-assets.s3.amazonaws.com/monogram/light-small.png"> | ||
<img alt="CarbonPlan monogram." height="48" src="https://carbonplan-assets.s3.amazonaws.com/monogram/dark-small.png"> | ||
</picture> | ||
</a> | ||
</p> | ||
|
||
# ndpyramid | ||
|
||
A small utility for generating ND array pyramids using Xarray and Zarr. | ||
|
||
[![CI](https://github.com/carbonplan/ndpyramid/actions/workflows/main.yaml/badge.svg)](https://github.com/carbonplan/ndpyramid/actions/workflows/main.yaml) | ||
![MIT License](https://badgen.net/badge/license/MIT/blue) | ||
![PyPI](https://img.shields.io/pypi/v/ndpyramid) | ||
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/ndpyramid.svg)](https://anaconda.org/conda-forge/ndpyramid) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) | ||
|
||
# installation | ||
|
||
|
@@ -74,8 +70,8 @@ See the docstrings for more details about input parameters and options. | |
|
||
## license | ||
|
||
All the code in this repository is [MIT](https://choosealicense.com/licenses/mit/) licensed, but we request that you please provide attribution if reusing any of our digital content (graphics, logo, articles, etc.). | ||
All the code in this repository is [MIT](https://choosealicense.com/licenses/mit/)-licensed, but we request that you please provide attribution if reusing any of our digital content (graphics, logo, articles, etc.). | ||
|
||
## about us | ||
|
||
CarbonPlan is a non-profit organization working on the science and data of carbon removal. We aim to improve the transparency and scientific integrity of carbon removal and climate solutions through open data and tools. Find out more at [carbonplan.org](https://carbonplan.org/) or get in touch by [opening an issue](https://github.com/carbonplan/ndpyramid/issues/new) or [sending us an email](mailto:[email protected]). | ||
CarbonPlan is a nonprofit organization that uses data and science for climate action. We aim to improve the transparency and scientific integrity of climate solutions with open data and tools. Find out more at [carbonplan.org](https://carbonplan.org/) or get in touch by [opening an issue](https://github.com/carbonplan/ndpyramid/issues/new) or [sending us an email](mailto:[email protected]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: ndpyramid-docs | ||
channels: | ||
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- python=3.9 | ||
- pre-commit | ||
- pip | ||
- sphinx>=5.0 | ||
- sphinx-book-theme >= 0.3.0 | ||
- numpydoc | ||
- myst-parser | ||
- pip: | ||
- -e .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api | ||
=== | ||
|
||
.. currentmodule:: ndpyramid | ||
|
||
|
||
Top level API | ||
~~~~~~~~~~~~~ | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
pyramid_coarsen | ||
pyramid_reproject | ||
pyramid_regrid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
|
||
import sys | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
# sys.path.insert(os.path.abspath('..')) | ||
|
||
print('python exec:', sys.executable) | ||
print('sys.path:', sys.path) | ||
|
||
|
||
project = 'ndpyramid' | ||
copyright = '2023, carbonplan' | ||
author = 'carbonplan' | ||
release = 'v0.1.0' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = ['myst_parser', | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.autosummary',] | ||
|
||
autosummary_generate = True | ||
|
||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
# Sphinx project configuration | ||
source_suffix = ['.rst', '.md'] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
|
||
html_title = 'ndpyarmid' | ||
html_theme_options = { | ||
'logo': { | ||
'image_light': '_static/monogram-dark-cropped.png', | ||
'image_dark': '_static/monogram-light-cropped.png', | ||
} | ||
} | ||
html_theme = 'sphinx_book_theme' | ||
html_title = '' | ||
repository = 'carbonplan/ndpyarmid' | ||
repository_url = 'https://github.com/carbonplan/ndpyramid' | ||
|
||
html_static_path = ['_static'] |
Oops, something went wrong.