Skip to content

Commit

Permalink
Rework python-cmethods: replace the CMethods class by the new `adju…
Browse files Browse the repository at this point in the history
…st` function (#48)
  • Loading branch information
btschwertfeger authored Jan 23, 2024
1 parent 9878005 commit 222e929
Show file tree
Hide file tree
Showing 202 changed files with 4,713 additions and 3,121 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
examples/input_data/*.nc filter=lfs diff=lfs merge=lfs -text
tests/fixture/temperature_simh.zarr filter=lfs diff=lfs merge=lfs -text
tests/fixture/temperature_simp.zarr filter=lfs diff=lfs merge=lfs -text
tests/fixture/precipitation_obsh.zarr filter=lfs diff=lfs merge=lfs -text
tests/fixture/precipitation_obsp.zarr filter=lfs diff=lfs merge=lfs -text
tests/fixture/precipitation_simh.zarr filter=lfs diff=lfs merge=lfs -text
tests/fixture/precipitation_simp.zarr filter=lfs diff=lfs merge=lfs -text
tests/fixture/temperature_obsh.zarr filter=lfs diff=lfs merge=lfs -text
tests/fixture/temperature_obsp.zarr filter=lfs diff=lfs merge=lfs -text
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ coverage:
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: true # if false: post the comment even if coverage dont change
require_changes: true # if false: post the comment even if coverage don't change
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt
python -m pip install -r doc/requirements.txt
- name: Build the documentation
run: cd docs && make html
run: cd doc && make html
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
run: python -m pip install ".[dev]"

- name: Run unit tests
run: pytest tests
run: pytest -vv tests
59 changes: 43 additions & 16 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
push:
branches:
- "**"
schedule:
- cron: "20 4 * * 0"
release:
types: [created]

concurrency:
group: CICD-${{ github.ref }}
Expand All @@ -20,24 +24,24 @@ jobs:
## Checks the code logic, style and more
##
Pre-Commit:
uses: ./.github/workflows/_pre_commit.yml
uses: ./.github/workflows/_pre_commit.yaml

## Discover vulnerabilities
##
CodeQL:
uses: ./.github/workflows/_codeql.yml
uses: ./.github/workflows/_codeql.yaml

## Builds the package on multiple OS for multiple
## Python versions
##
Build:
needs: [Pre-Commit]
uses: ./.github/workflows/_build.yml
uses: ./.github/workflows/_build.yaml
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -46,7 +50,7 @@ jobs:
##
Build-Doc:
needs: [Pre-Commit]
uses: ./.github/workflows/_build_doc.yml
uses: ./.github/workflows/_build_doc.yaml
with:
os: ubuntu-latest
python-version: "3.11"
Expand All @@ -55,34 +59,57 @@ jobs:
##
Test:
needs: [Build]
uses: ./.github/workflows/_test.yml
uses: ./.github/workflows/_test.yaml
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

## Generates and uploads the coverage statistics to codecov
##
CodeCov:
if: |
success() &&
github.actor == 'btschwertfeger' &&
github.event_name == 'push'
needs: [Test]
uses: ./.github/workflows/_codecov.yaml
with:
os: ubuntu-latest
python-version: "3.11"
secrets: inherit

## Uploads the package to test.pypi.org on master if triggered by
## a regular commit/push.
##
UploadTestPyPI:
if: success() && github.ref == 'refs/heads/master'
if: |
success() &&
github.actor == 'btschwertfeger' &&
github.ref == 'refs/heads/master' &&
github.event_name == 'push'
needs: [Test]
name: Upload current development version to Test PyPI
uses: ./.github/workflows/_pypi_publish.yml
uses: ./.github/workflows/_pypi_publish.yaml
with:
REPOSITORY_URL: https://test.pypi.org/legacy/
secrets:
API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}

## Generates and uploads the coverage statistics to codecov
## Upload the python-kraken-sdk to Production PyPI
##
CodeCov:
needs: [Test]
uses: ./.github/workflows/_codecov.yml
UploadPyPI:
if: |
success() &&
github.actor == 'btschwertfeger' &&
github.event_name == 'release'
needs: [UploadTestPyPI]
name: Upload the current release to PyPI
uses: ./.github/workflows/_pypi_publish.yaml
with:
os: ubuntu-latest
python-version: "3.11"
secrets: inherit
REPOSITORY_URL: https://upload.pypi.org/legacy/
secrets:
API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
File renamed without changes.
79 changes: 0 additions & 79 deletions .github/workflows/release.yml

This file was deleted.

65 changes: 7 additions & 58 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ __pycache__/
*$py.class
# C extensions
*.so
*.zip

# Distribution / packaging
.Python
Expand All @@ -28,12 +27,6 @@ share/python-wheels/
MANIFEST
_version.py

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand All @@ -49,59 +42,18 @@ nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/
doc/_build/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
Expand All @@ -110,13 +62,7 @@ venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject
.vscode/

# mkdocs documentation
/site
Expand All @@ -125,7 +71,6 @@ venv.bak/
.mypy_cache/
.dmypy.json
dmypy.json
del*.py

# Pyre type checker
.pyre/
Expand All @@ -135,7 +80,11 @@ del*.py
*.csv
*.log
*.zip
.vscode/
*.nc
!examples/input_data/*.nc
!tests/fixture/
dev
del*.py

*.egg-info/
conda.stuff/
Loading

0 comments on commit 222e929

Please sign in to comment.