Skip to content

Commit

Permalink
merge in latest changes from RC_v1.5.x and solve merge conflicts in doc/
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaKukulies committed Apr 10, 2024
2 parents 1a000be + 2fe56c0 commit 19babc8
Show file tree
Hide file tree
Showing 89 changed files with 116,670 additions and 2,935 deletions.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Bug Report
about: Report a bug in the tobac library
title: ''
labels: bug
assignees: ''

---

* [ ] Have you searched the issue tracker for the same problem?
* [ ] Have you checked if you're using the latest version? If not, which version are you using?
* [ ] Have you mentioned the steps to reproduce the issue?
* [ ] Have you, if applicable, included error messages?
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Question
about: 'Ask a general question about tobac '
title: ''
labels: question
assignees: ''

---

* [ ] Have you searched the issue tracker for similar questions?
* [ ] Have you read the documentation to ensure your question isn't already answered?
* [ ] Have you searched Stack Overflow or other relevant forums to see if your question has been answered elsewhere?
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Release
about: Prepare a new release for tobac
title: Release v.X.Y.Z
labels: release
assignees: ''

---

Checklist for releasing vX.Y.Z:

* [ ] Re-run notebooks and commit updates to repository
* [ ] Bump version in `__init__.py` in `RC_vX.Y.Z`
* [ ] Add changelog in `RC_vX.Y.Z`
* [ ] Add new contributors to vX.Y.Z
* [ ] Merge `RC_vX.Y.Z` into `main`
* [ ] Delete `RC_vX.Y.Z` branch
* [ ] Create release
* [ ] Push release to conda-forge
* [ ] E-mail tobac mailing list
21 changes: 15 additions & 6 deletions .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: '3.8'
- run: pip install .
- run: pip install black==22.6.0
- run: black tobac --check

miniforge-version: latest
miniforge-variant: mambaforge
channel-priority: strict
channels: conda-forge
show-channel-urls: true
use-only-tar-bz2: true

- name: Install dependencies and check formatting
shell: bash -l {0}
run:
mamba install --quiet --yes --file requirements.txt black &&
black --version &&
black tobac --check --diff
23 changes: 23 additions & 0 deletions .github/workflows/check_json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check Zenodo JSON Formatting
on: [push, pull_request]
jobs:
check-json-formatting:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: check out repository code
uses: actions/checkout@v3
- name: set up conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: checkjson-env
- name: Install check-jsonschema
run: |
pip install check-jsonschema
- name: Check zenodo JSON formatting
run: |
check-jsonschema --schemafile https://zenodraft.github.io/metadata-schema-zenodo/latest/schema.json .zenodo.json
40 changes: 40 additions & 0 deletions .github/workflows/check_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Jupyter Notebooks CI
on: [push, pull_request]
jobs:
Check-Notebooks:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: check out repository code
uses: actions/checkout@v3
- name: set up conda environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-version: latest
miniforge-variant: mambaforge
channel-priority: strict
channels: conda-forge
show-channel-urls: true
use-only-tar-bz2: true
auto-update-conda: true
auto-activate-base: false
activate-environment: notebook-env
- name: Install tobac dependencies
run: |
mamba install -c conda-forge --yes ffmpeg gcc jupyter pytables
mamba install -c conda-forge --yes --file example_requirements.txt
- name: Install tobac
run: |
pip install .
- name: Find all notebook files
run: |
find . -type f -name '*.ipynb' > nbfiles.txt
cat nbfiles.txt
- name: Execute all notebook files
run: |
while IFS= read -r nbpath; do
jupyter nbconvert --inplace --ClearMetadataPreprocessor.enabled=True --clear-output $nbpath
jupyter nbconvert --to notebook --inplace --execute $nbpath
done < nbfiles.txt
1 change: 1 addition & 0 deletions .github/workflows/codecov-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ jobs:
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: unittests
53 changes: 53 additions & 0 deletions .github/workflows/matrix_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Matrix Testing CI
# this is similar to the pyart CI action
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# This job installs dependencies and runs tests across a matrix of python and OS versions.
#Add if: github.repository == 'tobac-project/tobac' to limit runs to tobac repo

jobs:
build:
name: ${{ matrix.os }}-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
if: github.repository == 'tobac-project/tobac'
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [macos, ubuntu, windows]

steps:
- uses: actions/checkout@v2

# Install micromamba and dependencies
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-ci.yml
activate-environment: pyart-dev
cache-downloads: true
channels: conda-forge
channel-priority: strict
python-version: ${{ matrix.python-version }}

- name: Fetch all history for all tags and branches
run: |
git fetch --prune --unshallow
- name: Install tobac
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Run Tests
id: run_tests
shell: bash -l {0}
run: |
python -m pytest -v
86 changes: 86 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Linting
on:
pull_request_target:
branches:
- '*'
permissions:
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-version: latest
miniforge-variant: mambaforge
channel-priority: strict
channels: conda-forge
show-channel-urls: true
use-only-tar-bz2: true

- name: Install tobac and pylint
run: |
mamba install --yes pylint
pip install .
- name: Store the PR branch
run: |
echo "SHA=$(git rev-parse "$GITHUB_SHA")" >> $GITHUB_OUTPUT
id: git

- name: Checkout RC branch
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}

- name: Get pylint score of RC branch
run: |
pylint tobac --disable=C --exit-zero
id: main_score

- name: Checkout PR branch
uses: actions/checkout@v3
with:
ref: "${{ steps.git.outputs.SHA }}"

- name: Get pylint score of PR branch
run: |
# use shell script to save only tail of output
OUTPUT_PART=$(pylint tobac --disable=C --exit-zero | tail -n 2)
# but post entire output in the action details
pylint tobac --disable=C --exit-zero
# define random delimiter for multiline string
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "MESSAGE<<$EOF" >> "$GITHUB_OUTPUT"
echo "$OUTPUT_PART" >> "$GITHUB_OUTPUT"
echo "$EOF" >> "$GITHUB_OUTPUT"
id: pr_score

- name: Find Comment
uses: peter-evans/find-comment@v2
id: comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Linting results by Pylint

- name: Post result to PR
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.comment.outputs.comment-id }}
edit-mode: replace
body: |
Linting results by Pylint:
--------------------------
${{ steps.pr_score.outputs.MESSAGE }}
<sub>The linting score is an indicator that reflects how well your code version follows Pylint’s coding standards and quality metrics with respect to the ${{ github.base_ref }} branch.
A decrease usually indicates your new code does not fully meet style guidelines or has potential errors.<sup>
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ __pycache__
htmlcov
.coverage
build
.idea
.idea
examples/*/Save
examples/*/Plot
examples/climate-processes-tobac_example_data-b3e69ee
.ipynb_checkpoints
.DS_Store
*.egg-info

6 changes: 4 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version: 2
formats: all
build:
os: ubuntu-22.04
tools:
python: "3.9"
python:
version: 3
install:
- requirements: doc/requirements.txt
system_packages: true

0 comments on commit 19babc8

Please sign in to comment.