Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*

36 changes: 14 additions & 22 deletions .github/workflows/python-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,31 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.11]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
- name: Set up mamba ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: environment.yml
init-shell: bash
environment-name: pointCollection
cache-environment: true
post-cleanup: 'all'
create-args: >-
python=${{ matrix.python-version }}
flake8
pytest
pytest-cov
cython
- name: Set up pixi environment
uses: prefix-dev/setup-pixi@v0.9.1
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
pixi run lint
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pixi run lint "--exit-zero --max-complexity=10 --max-line-length=127"
- name: Install pointCollection
run: |
# install the package in editable mode
pip install --no-deps --editable .
- name: Test with pytest
run: |
pip install --no-deps .
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pytest --verbose --capture=no
pixi run coverage
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.os }}
path: coverage.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ eggs/
lib/
lib64/
parts/
.pixi/
sdist/
var/
wheels/
Expand Down
8,110 changes: 8,110 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pointCollection/scripts/fix_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import glob
import re

main():
def main():

file_re=re.compile('file_\d+')

Expand Down
48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,51 @@ python_files = [
testpaths = [
"test"
]

[tool.pixi.workspace]
name = "pointCollection"
authors = ["pointCollection contributors"]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]

[tool.pixi.pypi-dependencies]
pointCollection = { path = ".", editable = true }

[tool.pixi.environments]
default = { solve-group = "default" }
dev = { features = ["dev"], solve-group = "default" }

[tool.pixi.tasks.jupyter]
cmd = "jupyter-notebook"
cwd = "notebooks"
description = "Start Jupyter Notebooks in the notebooks directory"

[tool.pixi.tasks.export-env]
args = [ { "arg" = "flags", "default" = "" } ]
cmd = "pixi workspace export conda-environment {{ flags }} > environment.yml"
description = "Export workspace to a conda environment file"

[tool.pixi.feature.dev.tasks.coverage]
cmd = "pytest --cov=pointCollection --junitxml=pytest.xml --cov-report=xml test"
description = "Run the pytest suite and create coverage reports"

[tool.pixi.feature.dev.tasks.lint]
args = [ { "arg" = "flags", "default" = "--select=E9,F63,F7,F82 --show-source" }, { "arg" = "directory", "default" = "." } ]
cmd = "flake8 {{ directory }} --count {{ flags }} --statistics --extend-exclude 'build/,*.ipynb_checkpoints/,.pixi/'"
description = "Run flake8 to check for compilation errors"

[tool.pixi.dependencies]
gdal = "*"
h5py = "*"
matplotlib-base = "*"
netCDF4 = "*"
notebook = "*"
numpy = "*"
pyproj = "*"
scipy = ">=1.10.1"
shapely = "*"

[tool.pixi.feature.dev.dependencies]
flake8 = "*"
pytest = ">=4.6"
pytest-cov = "*"