Skip to content

Commit

Permalink
Merge pull request #111 from climate-processes/dev
Browse files Browse the repository at this point in the history
Version 1.3 release candidate
  • Loading branch information
w-k-jones authored Apr 12, 2022
2 parents eeb574c + c3c10aa commit 0d098ac
Show file tree
Hide file tree
Showing 29 changed files with 4,632 additions and 2,474 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: check_formatting
on: [push, pull_request]
jobs:
formatting_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- run: pip install .
- run: pip install black
- run: black tobac --check

6 changes: 1 addition & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Docker Image CI

on:
push:
branches: [ master, dev, v2.0-dev ]
pull_request:
branches: [ master, dev, v2.0-dev ]
on: [push, pull_request]

jobs:

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.pyc
__pycache__
.vscode
htmlcov
.coverage
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### Tobac Changelog

_**Version 1.3:**_

**Enhancements**

- Significant performance improvements for tracking [#89](https://github.com/climate-processes/tobac/pull/89)
- Significant performance improvements for feature detection and segmentation [#90](https://github.com/climate-processes/tobac/pull/90)
- Performance improvement for `calculate_area` [#93](https://github.com/climate-processes/tobac/issues/93)
- Added ability to set a user defined stub cell value instead of `np.nan`. Default value is `-1` and stub cell values are now integers instead of floats by default [#74](https://github.com/climate-processes/tobac/issues/93)
- Added deprecation warnings for parameters `min_num` in feature detection and `d_min` in tracking, and added exceptions when multiple, incompatible parameters are given (e.g. `d_max` and `v_max`) [#107](https://github.com/climate-processes/tobac/pull/107)

**Bug fixes**

- Fixed level parameter in segmentation, as this previously had no effect [#92](https://github.com/climate-processes/tobac/pull/92)
- Remove `is` comparisons for string literals [#99](https://github.com/climate-processes/tobac/pull/99)
- Added missing `raise` for exception in `get_spacings` [#105](https://github.com/climate-processes/tobac/pull/105)
- Remove automatic setting of matplotlib backend to `agg` on import [#100](https://github.com/climate-processes/tobac/pull/100)
- Fix deprecation warnings for changed import paths in dependencies [#110](https://github.com/climate-processes/tobac/pull/110)

**Documentation**

- Added recommended python style [#72](https://github.com/climate-processes/tobac/issues/72)
- Updated author list and email addresses [#109](https://github.com/climate-processes/tobac/pull/109)

**Repository enhancements**

- Black formatting of all python code and formatting check in actions [#78](https://github.com/climate-processes/tobac/pull/78)
- Pre-commit hook for black formatting [#96](https://github.com/climate-processes/tobac/pull/96)
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ Please create a new issue on [GitHub](https://github.com/climate-processes/tobac
* If it is a larger change or an newly added feature or workflow, please place an example of use in the [tobac-tutorials](https://github.com/climate-processes/tobac-tutorials) repository or adapt the existing examples there.
* If necessary add a folder or modify a file.
* The code should be PEP 8 compliant, as this facilitates our collaboration. Please use the latest version of [black](https://black.readthedocs.io/en/stable/) to format your code. When you submit a pull request, all files are checked for formatting.
* The tobac repository is set up with pre-commit hooks to automatically format your code when commiting changes. Please run the command "pre-commit install" in the root directory of tobac to set up pre-commit formatting.

We hope that we can respond within two weeks.
We aim to respond to all new issues/pull requests as soon as possible, however at times this is not possible due to work commitments.

### Numpydoc Example <a name='docstringExample'>
```python
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ pip install tobac/

Contributing
------------
The current development branch is v2.0-dev.
The current development branch for minor updates to tobac v1 is dev.

Preliminary development of the future major update to tobac is v2.0-dev.

For more details on contributing, please see https://github.com/climate-processes/tobac/blob/v2.0-dev/CONTRIBUTING.md

Expand Down
7 changes: 4 additions & 3 deletions conda-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ scipy
scikit-image
pandas
pytables
matplotlib
matplotlib
iris
cf-units
xarray
cf-units
xarray
cartopy
trackpy
pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"parameters_features={}\n",
"parameters_features['position_threshold']='weighted_diff'\n",
"parameters_features['sigma_threshold']=0.5\n",
"parameters_features['min_num']=4\n",
"parameters_features['n_min_threshold']=4\n",
"parameters_features['target']='minimum'\n",
"parameters_features['threshold']=[250,225,200,175,150]"
]
Expand Down Expand Up @@ -409,7 +409,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -423,7 +423,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"parameters_features={}\n",
"parameters_features['position_threshold']='weighted_diff'\n",
"parameters_features['sigma_threshold']=0.5\n",
"parameters_features['min_num']=4\n",
"parameters_features['n_min_threshold']=4\n",
"parameters_features['target']='minimum'\n",
"parameters_features['threshold']=[250,225,200,175,150]"
]
Expand Down Expand Up @@ -538,7 +538,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -552,7 +552,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@
"parameters_features={}\n",
"parameters_features['position_threshold']='weighted_diff'\n",
"parameters_features['sigma_threshold']=0.5\n",
"parameters_features['min_num']=3\n",
"parameters_features['min_distance']=0\n",
"parameters_features['sigma_threshold']=1\n",
"parameters_features['threshold']=[1,2,3,4,5,10,15] #mm/h\n",
Expand Down Expand Up @@ -438,8 +437,7 @@
"parameters_linking['memory']=0\n",
"parameters_linking['time_cell_min']=5*60\n",
"parameters_linking['method_linking']='predict'\n",
"parameters_linking['v_max']=10\n",
"parameters_linking['d_min']=2000\n"
"parameters_linking['v_max']=10\n"
]
},
{
Expand Down Expand Up @@ -589,7 +587,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -603,7 +601,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@
"parameters_features={}\n",
"parameters_features['position_threshold']='weighted_diff'\n",
"parameters_features['sigma_threshold']=0.5\n",
"parameters_features['min_num']=3\n",
"parameters_features['min_distance']=0\n",
"parameters_features['sigma_threshold']=1\n",
"parameters_features['threshold']=[3,5,10] #m/s\n",
Expand Down Expand Up @@ -658,8 +657,7 @@
"parameters_linking['memory']=0\n",
"parameters_linking['time_cell_min']=5*60\n",
"parameters_linking['method_linking']='predict'\n",
"parameters_linking['v_max']=10\n",
"parameters_linking['d_min']=2000\n"
"parameters_linking['v_max']=10\n"
]
},
{
Expand Down Expand Up @@ -763,7 +761,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -777,7 +775,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
36 changes: 26 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
from setuptools import setup

setup(name='tobac',
version='1.2',
description='Tracking and object-based analysis of clouds',
url='http://github.com/climate-processes/tobac',
author='Max Heikenfeld',
author_email='max.heikenfeld@physics.ox.ac.uk',
license='GNU',
packages=['tobac'],
install_requires=[],
zip_safe=False)
setup(
name="tobac",
version="1.3",
description="Tracking and object-based analysis of clouds",
url="http://github.com/climate-processes/tobac",
author=[
"Max Heikenfeld",
"William Jones",
"Fabian Senf",
"Sean Freeman",
"Julia Kukulies",
"Peter Marinescu",
],
author_email=[
"max.heikenfeld@physics.ox.ac.uk",
"william.jones@physics.ox.ac.uk",
"senf@tropos.de",
"sean.freeman@colostate.edu",
"julia.kukulies@gu.se",
"peter.marinescu@colostate.edu",
],
license="BSD-3-Clause License",
packages=["tobac"],
install_requires=[],
zip_safe=False,
)
68 changes: 54 additions & 14 deletions tobac/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,63 @@
#from .tracking import maketrack
from .segmentation import segmentation_3D, segmentation_2D,watershedding_3D,watershedding_2D
from .centerofgravity import calculate_cog,calculate_cog_untracked,calculate_cog_domain
from .plotting import plot_tracks_mask_field,plot_tracks_mask_field_loop,plot_mask_cell_track_follow,plot_mask_cell_track_static,plot_mask_cell_track_static_timeseries
from .plotting import plot_lifetime_histogram,plot_lifetime_histogram_bar,plot_histogram_cellwise,plot_histogram_featurewise
from .plotting import plot_mask_cell_track_3Dstatic,plot_mask_cell_track_2D3Dstatic
from .plotting import plot_mask_cell_individual_static,plot_mask_cell_individual_3Dstatic
# from .tracking import maketrack
from .segmentation import (
segmentation_3D,
segmentation_2D,
watershedding_3D,
watershedding_2D,
)
from .centerofgravity import (
calculate_cog,
calculate_cog_untracked,
calculate_cog_domain,
)
from .plotting import (
plot_tracks_mask_field,
plot_tracks_mask_field_loop,
plot_mask_cell_track_follow,
plot_mask_cell_track_static,
plot_mask_cell_track_static_timeseries,
)
from .plotting import (
plot_lifetime_histogram,
plot_lifetime_histogram_bar,
plot_histogram_cellwise,
plot_histogram_featurewise,
)
from .plotting import plot_mask_cell_track_3Dstatic, plot_mask_cell_track_2D3Dstatic
from .plotting import (
plot_mask_cell_individual_static,
plot_mask_cell_individual_3Dstatic,
)
from .plotting import animation_mask_field
from .plotting import make_map, map_tracks
from .analysis import cell_statistics,cog_cell,lifetime_histogram,histogram_featurewise,histogram_cellwise
from .analysis import calculate_velocity,calculate_distance,calculate_area
from .analysis import (
cell_statistics,
cog_cell,
lifetime_histogram,
histogram_featurewise,
histogram_cellwise,
)
from .analysis import calculate_velocity, calculate_distance, calculate_area
from .analysis import calculate_nearestneighbordistance
from .analysis import velocity_histogram,nearestneighbordistance_histogram,area_histogram
from .analysis import (
velocity_histogram,
nearestneighbordistance_histogram,
area_histogram,
)
from .analysis import calculate_overlap
from .utils import mask_cell,mask_cell_surface,mask_cube_cell,mask_cube_untracked,mask_cube,column_mask_from2D,get_bounding_box
from .utils import mask_features,mask_features_surface,mask_cube_features
from .utils import (
mask_cell,
mask_cell_surface,
mask_cube_cell,
mask_cube_untracked,
mask_cube,
column_mask_from2D,
get_bounding_box,
)
from .utils import mask_features, mask_features_surface, mask_cube_features

from .utils import add_coordinates,get_spacings
from .utils import add_coordinates, get_spacings
from .feature_detection import feature_detection_multithreshold
from .tracking import linking_trackpy
from .wrapper import maketrack
from .wrapper import tracking_wrapper

Loading

0 comments on commit 0d098ac

Please sign in to comment.