Skip to content

Commit

Permalink
Merge pull request #387 from tobac-project/RC_v1.5.x
Browse files Browse the repository at this point in the history
Merge RC v1.5.2 into main
  • Loading branch information
w-k-jones authored Dec 8, 2023
2 parents 09b5a73 + 3484f95 commit bd614ef
Show file tree
Hide file tree
Showing 57 changed files with 88,261 additions and 84,996 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
2 changes: 1 addition & 1 deletion .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
shell: bash -l {0}
run:
mamba install --quiet --yes --file requirements.txt black &&
black tobac --check
black tobac --check --diff
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>
7 changes: 5 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: 2
formats: all
build:
os: ubuntu-22.04
tools:
python: "3.9"
python:
version: 3
install:
- requirements: doc/requirements.txt
- requirements: doc/requirements.txt
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
### Tobac Changelog

_**Version 1.5.2:**_

**Enhancements for Users**

- Let users optionally derive bulk statistics of the data points belonging to each feature. Bulk statistics can be calulcated during feature detection, segmentation or afterwards by applying one of more functions to each feature [#293](https://github.com/tobac-project/tobac/pull/293)
- Wrapped functions now show the correct docstring [#359](https://github.com/tobac-project/tobac/pull/359)

**Bug fixes**

- Fixed an out-of-bounds error that could occur when performing segmentation with PBCs [#350](https://github.com/tobac-project/tobac/pull/350)
- Path to data in example notebooks fixed after changes to zenodo [#357](https://github.com/tobac-project/tobac/pull/357)
- Bulk statistics updated to use multiple fields correctly and perform numpy-style broadcasting [#368](https://github.com/tobac-project/tobac/pull/368)
- PBCs now work when using predictive tracking [#376](https://github.com/tobac-project/tobac/pull/376)
- Fixed error with PBC distance calculation using numba if all of `min_h1`, `max_h1`, `min_h2`, `max_h2` were not specified, even if not calculating PBCs over one of the dimensions [#384](https://github.com/tobac-project/tobac/pull/384)

**Documentation**

- Documentation on use of `time_cell_min` in tracking added [#361](https://github.com/tobac-project/tobac/pull/361)
- Documentation on how thresholding is applied in segmentation update [#365](https://github.com/tobac-project/tobac/pull/365)
- References to tobac papers updated [#365](https://github.com/tobac-project/tobac/pull/365)

**Internal Enhancements**

- Type hints added for feature detection [#337](https://github.com/tobac-project/tobac/pull/337)
- Reorganisation and addition of type hints to interal utils [#241](https://github.com/tobac-project/tobac/pull/241)
- Type hints added for segmentation [#351](https://github.com/tobac-project/tobac/pull/351)

**Repository Enhancements**

- Matrix CI testing added for multiple python versions on Linux, MacOS and Windows [#353](https://github.com/tobac-project/tobac/pull/353)
- Issue templates with checklists added [#358](https://github.com/tobac-project/tobac/pull/358)
- Black reformatting updated to say what is wrong [#362](https://github.com/tobac-project/tobac/pull/362)
- Pylint CI workflow added to assess code quality and compare to base branch [#373](https://github.com/tobac-project/tobac/pull/373)


_**Version 1.5.1:**_

**Bug fixes**
Expand Down Expand Up @@ -73,7 +108,7 @@ _**Version 1.5.0:**_
_**Version 1.4.2:**_


**Bug fix**
**Bug fixes**

- Fixed a bug in the segmentation procedure that assigned the wrong grid cell areas to features in data frame [#246](https://github.com/tobac-project/tobac/pull/246)

Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ trackpy
pre-commit
black
pytest

typing_extensions
10 changes: 10 additions & 0 deletions doc/bulk_statistics/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
##########################
Compute bulk statistics
##########################

.. toctree::
:maxdepth: 2

notebooks/compute_statistics_during_feature_detection_example
notebooks/compute_statistics_during_segmentation_example
notebooks/compute_statistics_postprocessing_example
Loading

0 comments on commit bd614ef

Please sign in to comment.