Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.3 release candidate #111

Merged
merged 76 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
f9699f9
Added the ability to set a custom stub cell value
freemansw1 Feb 18, 2022
77693f9
added yml file for formatting check in workflow
Feb 25, 2022
4317920
reformatted all existing files using black
Feb 25, 2022
743891a
add formatting check on pushs
Feb 25, 2022
5cf1c8f
corrected yml file; all files in tobac/ are now checked for black for…
Feb 25, 2022
b064d7a
undo formatting of non-python files
Feb 26, 2022
49a160b
Switched names around as suggested, added metadata
freemansw1 Mar 7, 2022
245d7da
Updated docker-image action to run on all branches
freemansw1 Mar 7, 2022
645a2ce
Updating CI to run on all branches
freemansw1 Mar 7, 2022
4b94317
Merge branch 'dev'
Mar 7, 2022
cd76706
Addition of new testing utilities and tests for feature detection
freemansw1 Mar 10, 2022
e9c9e08
Added testing tests
freemansw1 Mar 10, 2022
da48878
Fixed a couple bugs with testing testing
freemansw1 Mar 10, 2022
1185a6a
Added tests for tracking
freemansw1 Mar 10, 2022
07fabbb
formatting on dev
Mar 11, 2022
bf2c95b
Updated testing
freemansw1 Mar 13, 2022
852e467
Ran black on new files
freemansw1 Mar 13, 2022
a1d9132
Merge pull request #78 from JuliaKukulies/master
fsenf Mar 14, 2022
fbf09c4
Merge branch 'climate-processes:main' into new_tests
freemansw1 Mar 14, 2022
466f283
Black formatting on testing.py
freemansw1 Mar 14, 2022
331e198
Merge branch 'new_tests' of https://github.com/freemansw1/tobac into …
freemansw1 Mar 14, 2022
c4ed4aa
Merge branch 'climate-processes:main' into non-tracked-cell-update
freemansw1 Mar 14, 2022
a7edce9
Reformatting from Black
freemansw1 Mar 14, 2022
59726ee
Revert "Reformatting from Black"
freemansw1 Mar 14, 2022
bdf65b6
Black formatting to tracking.py
freemansw1 Mar 14, 2022
7e7735b
Merge branch 'dev' into non-tracked-cell-update
freemansw1 Mar 14, 2022
6b6b376
Merge branch 'dev' of github.com:climate-processes/tobac into dev
Mar 14, 2022
871a0ad
added CONTRIBUTING.md to dev
Mar 14, 2022
141214d
Merge pull request #81 from freemansw1/new_tests
freemansw1 Mar 15, 2022
e65e153
Merge pull request #88 from climate-processes/main
freemansw1 Mar 17, 2022
27b04ba
Added tracking speedups
freemansw1 Mar 18, 2022
88bd651
Black reformatting
freemansw1 Mar 18, 2022
14e1fd1
Updated feature detection to speed it up
freemansw1 Mar 18, 2022
60a6b3b
Fixed levels not actually limiting segmentation; added segmentation t…
freemansw1 Mar 19, 2022
13b8ba0
collapsed particle to cell remap into a lambda function
freemansw1 Mar 21, 2022
1eac07e
Changed spelling of "indeces" to indices
freemansw1 Mar 21, 2022
1e526ae
Updated utils for better style
freemansw1 Mar 21, 2022
8b8f981
Removed debug print statement
freemansw1 Mar 21, 2022
38fa3c5
Merge pull request #89 from freemansw1/speedup_tracking_2D
freemansw1 Mar 21, 2022
cef3cdf
Merge pull request #92 from freemansw1/fix_level_segmentation
freemansw1 Mar 22, 2022
fabfa20
Update branches in contributing section of readme
w-k-jones Mar 25, 2022
7fe6ade
Set up pre-commit for black formatting, and add pre-commit to require…
w-k-jones Mar 25, 2022
1fb6b42
Merge pull request #90 from freemansw1/speedup_feature_detection
w-k-jones Mar 25, 2022
9b06b1c
Added gitignore, removed is checks
freemansw1 Mar 27, 2022
df418cc
Merge pull request #99 from freemansw1/fix_is_checks
freemansw1 Mar 27, 2022
5973e55
Removed setting of 'agg' to matplotlib plotting
freemansw1 Mar 27, 2022
372daa4
Add pre-commit installation instructions
w-k-jones Mar 28, 2022
44e863d
Merge branch 'dev' into non-tracked-cell-update
freemansw1 Mar 28, 2022
cce7e2f
Speedup to analysis.calculate_area
w-k-jones Mar 28, 2022
0a94be7
Fix formatting
w-k-jones Mar 28, 2022
01218dc
Add ability to calculate areas from 2D lat/lon coords
w-k-jones Mar 28, 2022
4f204e2
Merge pull request #74 from freemansw1/non-tracked-cell-update
freemansw1 Mar 28, 2022
814d7f6
Merge pull request #96 from w-k-jones/dev
freemansw1 Mar 29, 2022
bcec448
added missing 'raise' in get_spacings to actually raise ValueError
Apr 6, 2022
b029a35
Merge pull request #105 from JuliaKukulies/dev
freemansw1 Apr 7, 2022
135654c
Added warnings to import agg where figures are rendered
freemansw1 Apr 7, 2022
317a38c
Black formatting
freemansw1 Apr 7, 2022
a0474fa
Add deprecation warnings for d_min and min_num parameters, add except…
w-k-jones Apr 7, 2022
4d95209
Update example notebooks to avoid deprecated and duplicate parameters…
w-k-jones Apr 7, 2022
fdc3b6d
Reformatting
w-k-jones Apr 7, 2022
ee34faf
Update tests to stop using depreciated and duplicate parameters
w-k-jones Apr 7, 2022
c0e8746
Merge pull request #107 from w-k-jones/parameter_warnings
w-k-jones Apr 7, 2022
01a5c9b
Removed depreciation warnings that we can remove.
freemansw1 Apr 7, 2022
1f9f0a5
Fixes last depreciation warning
freemansw1 Apr 7, 2022
3fa4b76
Update version number
w-k-jones Apr 7, 2022
f545cec
Merge pull request #110 from freemansw1/fix_depreciation_warnings
freemansw1 Apr 7, 2022
df0e5ff
Merge pull request #100 from freemansw1/remove_agg_plotting
freemansw1 Apr 7, 2022
d22aa65
Merge pull request #102 from w-k-jones/calculate_area_speedup
w-k-jones Apr 7, 2022
23df332
Update author list and emails in setup.py
w-k-jones Apr 7, 2022
32d8909
Merge pull request #109 from climate-processes/update_version_number_1.3
w-k-jones Apr 7, 2022
1e63fc9
Update licence in setup.py
w-k-jones Apr 7, 2022
8b98e82
Add changelog file
w-k-jones Apr 8, 2022
6a089bd
Merge pull request #112 from w-k-jones/add_changelog
w-k-jones Apr 8, 2022
f33159e
Test adding urls to markdown file
w-k-jones Apr 8, 2022
9a2c253
Update changelog with links to PRs/issues resolved
w-k-jones Apr 8, 2022
c3c10aa
Merge pull request #114 from w-k-jones/add_changelog
JuliaKukulies Apr 8, 2022
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
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 @@ -54,7 +54,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