tctrack 0.2__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. {tctrack-0.2 → tctrack-1.0.0}/.github/workflows/codequality.yaml +5 -5
  2. {tctrack-0.2 → tctrack-1.0.0}/.github/workflows/release.yaml +3 -3
  3. {tctrack-0.2 → tctrack-1.0.0}/.github/workflows/unit-tests.yaml +19 -29
  4. tctrack-1.0.0/.pre-commit-config.yaml +28 -0
  5. {tctrack-0.2 → tctrack-1.0.0}/.readthedocs.yaml +1 -0
  6. tctrack-1.0.0/Dockerfile +14 -0
  7. {tctrack-0.2 → tctrack-1.0.0}/PKG-INFO +32 -20
  8. {tctrack-0.2 → tctrack-1.0.0}/README.md +11 -8
  9. tctrack-1.0.0/data/machine_learning/README.md +35 -0
  10. tctrack-1.0.0/data/machine_learning/era5_dikeledi_2025-01-10.nc +0 -0
  11. {tctrack-0.2 → tctrack-1.0.0}/docs/api/index.rst +3 -0
  12. tctrack-1.0.0/docs/api/machine_learning_api.rst +53 -0
  13. tctrack-1.0.0/docs/api/preprocessing_api.rst +6 -0
  14. {tctrack-0.2 → tctrack-1.0.0}/docs/api/tempest_extremes_api.rst +11 -0
  15. {tctrack-0.2 → tctrack-1.0.0}/docs/api/track_api.rst +2 -0
  16. {tctrack-0.2 → tctrack-1.0.0}/docs/api/tstorms_api.rst +2 -0
  17. tctrack-1.0.0/docs/api/utils_api.rst +5 -0
  18. {tctrack-0.2 → tctrack-1.0.0}/docs/conf.py +3 -0
  19. {tctrack-0.2 → tctrack-1.0.0}/docs/data/output_file.rst +5 -2
  20. {tctrack-0.2 → tctrack-1.0.0}/docs/data/preprocessing_data.rst +107 -5
  21. {tctrack-0.2 → tctrack-1.0.0}/docs/developer/adding_algorithms.rst +10 -8
  22. {tctrack-0.2 → tctrack-1.0.0}/docs/developer/guidelines.rst +7 -4
  23. tctrack-1.0.0/docs/flowcharts/FlowChart_MLTracker.mmd +91 -0
  24. tctrack-1.0.0/docs/flowcharts/FlowChart_TCT.mmd +57 -0
  25. {tctrack-0.2 → tctrack-1.0.0}/docs/getting-started/index.rst +47 -11
  26. tctrack-1.0.0/docs/getting-started/tutorial.rst +42 -0
  27. tctrack-1.0.0/docs/getting-started/tutorial_batching.nblink +3 -0
  28. tctrack-1.0.0/docs/getting-started/tutorial_tempest_extremes.nblink +3 -0
  29. tctrack-1.0.0/docs/getting-started/tutorial_tstorms.nblink +3 -0
  30. {tctrack-0.2 → tctrack-1.0.0}/docs/index.rst +5 -2
  31. tctrack-1.0.0/docs/references.rst +17 -0
  32. {tctrack-0.2 → tctrack-1.0.0}/docs/tracking-algorithms/index.rst +1 -0
  33. tctrack-1.0.0/docs/tracking-algorithms/machine_learning.rst +236 -0
  34. {tctrack-0.2 → tctrack-1.0.0}/docs/tracking-algorithms/tempest_extremes.rst +64 -19
  35. {tctrack-0.2 → tctrack-1.0.0}/docs/tracking-algorithms/track.rst +37 -12
  36. {tctrack-0.2 → tctrack-1.0.0}/docs/tracking-algorithms/tstorms.rst +85 -60
  37. tctrack-1.0.0/environment.yaml +10 -0
  38. {tctrack-0.2 → tctrack-1.0.0}/pyproject.toml +38 -13
  39. tctrack-1.0.0/src/tctrack/__init__.py +21 -0
  40. tctrack-1.0.0/src/tctrack/build_db/README.md +89 -0
  41. tctrack-1.0.0/src/tctrack/build_db/__init__.py +1 -0
  42. tctrack-1.0.0/src/tctrack/build_db/build_db.py +505 -0
  43. tctrack-1.0.0/src/tctrack/build_db/converters/__init__.py +5 -0
  44. tctrack-1.0.0/src/tctrack/build_db/converters/base.py +21 -0
  45. tctrack-1.0.0/src/tctrack/build_db/converters/ibtracs.py +159 -0
  46. tctrack-1.0.0/src/tctrack/build_db/schema.sql +96 -0
  47. tctrack-1.0.0/src/tctrack/build_db/tctrack_convert.py +71 -0
  48. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/core/__init__.py +2 -0
  49. tctrack-1.0.0/src/tctrack/core/ml_tracker.py +120 -0
  50. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/core/tracker.py +289 -34
  51. tctrack-1.0.0/src/tctrack/core/tracker_template.py +168 -0
  52. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/core/trajectory.py +18 -4
  53. tctrack-1.0.0/src/tctrack/machine_learning/__init__.py +15 -0
  54. tctrack-1.0.0/src/tctrack/machine_learning/cyclone_track_ml.py +870 -0
  55. tctrack-1.0.0/src/tctrack/machine_learning/data/normalisation_parameters.nc +0 -0
  56. tctrack-1.0.0/src/tctrack/machine_learning/parameters.py +140 -0
  57. tctrack-1.0.0/src/tctrack/preprocessing.py +839 -0
  58. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/tempest_extremes/__init__.py +10 -2
  59. tctrack-1.0.0/src/tctrack/tempest_extremes/parameters.py +786 -0
  60. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/tempest_extremes/tempest_extremes.py +304 -563
  61. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/track/__init__.py +3 -4
  62. tctrack-1.0.0/src/tctrack/track/parameters.py +95 -0
  63. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/track/track.py +139 -133
  64. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/tstorms/__init__.py +4 -2
  65. tctrack-1.0.0/src/tctrack/tstorms/parameters.py +333 -0
  66. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack/tstorms/tstorms.py +261 -372
  67. tctrack-1.0.0/src/tctrack/utils/__init__.py +10 -0
  68. tctrack-1.0.0/src/tctrack/utils/batching.py +553 -0
  69. tctrack-1.0.0/src/tctrack/utils/metadata.py +104 -0
  70. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack.egg-info/PKG-INFO +32 -20
  71. tctrack-1.0.0/src/tctrack.egg-info/SOURCES.txt +114 -0
  72. tctrack-1.0.0/src/tctrack.egg-info/entry_points.txt +3 -0
  73. tctrack-1.0.0/src/tctrack.egg-info/requires.txt +40 -0
  74. tctrack-1.0.0/src/tctrack.egg-info/scm_file_list.json +110 -0
  75. tctrack-1.0.0/src/tctrack.egg-info/scm_version.json +8 -0
  76. tctrack-1.0.0/tests/conftest.py +6 -0
  77. tctrack-1.0.0/tests/integration/test_integration_ml_pipeline.py +128 -0
  78. tctrack-1.0.0/tests/integration/test_tracker_integration.py +110 -0
  79. tctrack-1.0.0/tests/unit/build_db/converters/test_ibtracs.py +458 -0
  80. tctrack-1.0.0/tests/unit/build_db/test_build_db.py +412 -0
  81. tctrack-1.0.0/tests/unit/build_db/test_tctrack_convert.py +62 -0
  82. tctrack-1.0.0/tests/unit/build_db/test_tracks.nc +0 -0
  83. tctrack-1.0.0/tests/unit/build_db/test_tracks_se.nc +0 -0
  84. {tctrack-0.2/tests/unit/utils → tctrack-1.0.0/tests/unit/core}/test_netcdf.py +6 -2
  85. {tctrack-0.2 → tctrack-1.0.0}/tests/unit/core/test_tracker.py +195 -26
  86. {tctrack-0.2 → tctrack-1.0.0}/tests/unit/core/test_trajectory.py +1 -1
  87. tctrack-1.0.0/tests/unit/machine_learning/test_cyclone_track_ml.py +746 -0
  88. tctrack-1.0.0/tests/unit/preprocessing/test_preprocessing.py +440 -0
  89. {tctrack-0.2 → tctrack-1.0.0}/tests/unit/tempest_extremes/test_tempest_extremes.py +669 -120
  90. {tctrack-0.2 → tctrack-1.0.0}/tests/unit/track/test_track.py +233 -119
  91. {tctrack-0.2 → tctrack-1.0.0}/tests/unit/tstorms/test_tstorms.py +289 -41
  92. tctrack-1.0.0/tests/unit/utils/test_batching.py +706 -0
  93. tctrack-1.0.0/tests/unit/utils/test_metadata.py +145 -0
  94. tctrack-1.0.0/tutorial/README.md +19 -0
  95. tctrack-1.0.0/tutorial/batching.ipynb +433 -0
  96. tctrack-1.0.0/tutorial/fetch_data.py +140 -0
  97. tctrack-1.0.0/tutorial/install_tempest_extremes.sh +28 -0
  98. tctrack-1.0.0/tutorial/install_tstorms.sh +25 -0
  99. tctrack-1.0.0/tutorial/run_ml_tracker.py +19 -0
  100. tctrack-1.0.0/tutorial/tempest_extremes.ipynb +559 -0
  101. tctrack-1.0.0/tutorial/tstorms.ipynb +555 -0
  102. tctrack-0.2/docs/getting-started/tutorial.rst +0 -154
  103. tctrack-0.2/docs/references.rst +0 -11
  104. tctrack-0.2/src/tctrack/__init__.py +0 -5
  105. tctrack-0.2/src/tctrack/utils/__init__.py +0 -7
  106. tctrack-0.2/src/tctrack.egg-info/SOURCES.txt +0 -65
  107. tctrack-0.2/src/tctrack.egg-info/requires.txt +0 -29
  108. tctrack-0.2/tutorial/README.md +0 -15
  109. tctrack-0.2/tutorial/fetch_data.sh +0 -31
  110. tctrack-0.2/tutorial/install_tempest_extremes.sh +0 -22
  111. tctrack-0.2/tutorial/install_tstorms.sh +0 -19
  112. tctrack-0.2/tutorial/plot_tracks.py +0 -82
  113. tctrack-0.2/tutorial/regrid.py +0 -195
  114. tctrack-0.2/tutorial/run_tempest_extremes.py +0 -56
  115. tctrack-0.2/tutorial/run_tstorms.py +0 -45
  116. {tctrack-0.2 → tctrack-1.0.0}/.gitignore +0 -0
  117. {tctrack-0.2 → tctrack-1.0.0}/LICENSE +0 -0
  118. {tctrack-0.2 → tctrack-1.0.0}/docs/Makefile +0 -0
  119. {tctrack-0.2 → tctrack-1.0.0}/docs/api/core_api.rst +0 -0
  120. {tctrack-0.2 → tctrack-1.0.0}/docs/data/index.rst +0 -0
  121. {tctrack-0.2 → tctrack-1.0.0}/docs/developer/index.rst +0 -0
  122. {tctrack-0.2 → tctrack-1.0.0}/docs/images/TCTrack_Logo.svg +0 -0
  123. {tctrack-0.2 → tctrack-1.0.0}/docs/images/data_tracks_plot.png +0 -0
  124. {tctrack-0.2 → tctrack-1.0.0}/docs/images/inigo_inspire.png +0 -0
  125. {tctrack-0.2 → tctrack-1.0.0}/docs/make.bat +0 -0
  126. {tctrack-0.2 → tctrack-1.0.0}/setup.cfg +0 -0
  127. {tctrack-0.2 → tctrack-1.0.0}/setup.py +0 -0
  128. /tctrack-0.2/src/tctrack/utils/utils.py → /tctrack-1.0.0/src/tctrack/core/netcdf.py +0 -0
  129. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack.egg-info/dependency_links.txt +0 -0
  130. {tctrack-0.2 → tctrack-1.0.0}/src/tctrack.egg-info/top_level.txt +0 -0
@@ -32,18 +32,18 @@ jobs:
32
32
  - name: Checkout code
33
33
  with:
34
34
  persist-credentials: false
35
- uses: actions/checkout@v4
35
+ uses: actions/checkout@v7
36
36
 
37
37
  - name: Install Python
38
- uses: actions/setup-python@v5
38
+ uses: actions/setup-python@v7
39
39
  with:
40
- python-version: '3.x'
41
-
40
+ python-version: '3.14'
41
+
42
42
  - name: Install Package and Dependencies
43
43
  run: |
44
- python -m pip install --upgrade pip
45
44
  python -m venv tctrack_venv
46
45
  . tctrack_venv/bin/activate
46
+ pip install --upgrade pip
47
47
  pip install .[lint,doc]
48
48
 
49
49
  - name: ruff format tctrack
@@ -4,7 +4,7 @@ name: release
4
4
  on:
5
5
  push:
6
6
  tags:
7
- - "v*"
7
+ - "v[0-9]*.[0-9]*.[0-9]*"
8
8
 
9
9
  jobs:
10
10
 
@@ -14,12 +14,12 @@ jobs:
14
14
 
15
15
  steps:
16
16
  - name: Checkout repo
17
- uses: actions/checkout@v6
17
+ uses: actions/checkout@v7
18
18
  with:
19
19
  fetch-depth: 0 # REQUIRED for setuptools_scm
20
20
 
21
21
  - name: Install Python
22
- uses: actions/setup-python@v6
22
+ uses: actions/setup-python@v7
23
23
  with:
24
24
  python-version: "3.14"
25
25
 
@@ -30,46 +30,36 @@ jobs:
30
30
  matrix:
31
31
  # Supported Python versions on Linux Ubuntu
32
32
  os: ["ubuntu-latest"]
33
- python-version: ["3.14", "3.13", "3.12", "3.11", "3.10"]
33
+ python-version: ["3.14", "3.13", "3.12", "3.11"]
34
34
  # test latest python version on macOS
35
35
  include:
36
36
  - os: macos-latest
37
37
  python-version: "3.14"
38
38
 
39
39
  steps:
40
- - name: Install system dependencies (Ubuntu)
41
- if: runner.os == 'Linux'
42
- run: sudo apt-get update && sudo apt-get install -y libudunits2-dev
43
-
44
- - name: Install system dependencies (macOS)
45
- if: runner.os == 'macOS'
46
- run: |
47
- brew install udunits
48
- echo "LD_LIBRARY_PATH=/opt/homebrew/lib" >> $GITHUB_ENV
49
- echo "DYLD_LIBRARY_PATH=/opt/homebrew/lib" >> $GITHUB_ENV
50
- echo "UDUNITS2_XML_PATH=/opt/homebrew/share/udunits/udunits2.xml" >> $GITHUB_ENV
51
-
52
- # Checks-out repository under $GITHUB_WORKSPACE, so job can access it
53
40
  - name: Checkout code
54
41
  with:
55
42
  persist-credentials: false
56
- uses: actions/checkout@v4
43
+ uses: actions/checkout@v7
57
44
 
58
- - name: Install Python
59
- uses: actions/setup-python@v5
45
+ - name: Set up micromamba environment
46
+ uses: mamba-org/setup-micromamba@v3
60
47
  with:
61
- python-version: ${{ matrix.python-version }}
62
-
48
+ environment-name: tctrack-env
49
+ create-args: >-
50
+ python=${{ matrix.python-version }}
51
+ udunits2
52
+ esmpy
53
+ pytorch-cpu
54
+ cache-environment: true
55
+
63
56
  - name: Install Package and Dependencies
64
- run: |
65
- python -m pip install --upgrade pip
66
- python -m venv tctrack_venv
67
- . tctrack_venv/bin/activate
68
- pip install .[test]
57
+ shell: micromamba-shell {0}
58
+ run: pip install .[test]
69
59
 
70
60
  - name: Run unit tests
71
- if: always()
72
- run: |
73
- cd ${{ github.workspace }}
74
- . tctrack_venv/bin/activate
75
- pytest tests/unit
61
+ shell: micromamba-shell {0}
62
+ # This prevents networking to avoid a bug due to esmpy initialising MPI
63
+ env:
64
+ UCX_TLS: self,sm
65
+ run: pytest tests/unit
@@ -0,0 +1,28 @@
1
+ default_install_hook_types: [pre-commit]
2
+
3
+ repos:
4
+
5
+ # Ruff linting / formatting
6
+ - repo: https://github.com/astral-sh/ruff-pre-commit
7
+ rev: v0.15.17
8
+ hooks:
9
+ - id: ruff-check
10
+ files: (src|tests)/.*\.py|tutorial/.*\.ipynb
11
+ args: [ --fix ]
12
+ - id: ruff-format
13
+ files: (src|tests)/.*\.py|tutorial/.*\.ipynb
14
+
15
+ # Mypy type checking
16
+ - repo: https://github.com/pre-commit/mirrors-mypy
17
+ rev: v2.1.0
18
+ hooks:
19
+ - id: mypy
20
+ additional_dependencies: ["pytest==7.4.4"]
21
+
22
+ # Docs formatting with blackdoc
23
+ - repo: https://github.com/keewis/blackdoc
24
+ rev: v0.4.2
25
+ hooks:
26
+ - id: blackdoc
27
+ files: docs/
28
+ additional_dependencies: ["black==25.9.0"]
@@ -17,6 +17,7 @@ build:
17
17
  os: ubuntu-22.04
18
18
  apt_packages:
19
19
  - libudunits2-dev
20
+ - pandoc
20
21
  tools:
21
22
  python: "3.13"
22
23
 
@@ -0,0 +1,14 @@
1
+ FROM mambaorg/micromamba:2.10.0
2
+
3
+ COPY --chown=$MAMBA_USER:$MAMBA_USER ./environment.yaml /tmp/environment.yaml
4
+ RUN micromamba install -y -n base -f /tmp/environment.yaml && \
5
+ micromamba clean --all --yes
6
+
7
+ USER root
8
+
9
+ RUN apt-get update
10
+ RUN apt-get -y install git
11
+
12
+ USER $MAMBA_USER
13
+
14
+ ENTRYPOINT ["/usr/local/bin/_entrypoint.sh", "/bin/bash"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tctrack
3
- Version: 0.2
3
+ Version: 1.0.0
4
4
  Summary: A Python package for generating tropical cyclone tracks.
5
5
  Author-email: Jack Atkinson <jwa34@cam.ac.uk>, Sam Avis <sa2329@cam.ac.uk>
6
6
  License-Expression: GPL-3.0-or-later
@@ -12,7 +12,6 @@ Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Natural Language :: English
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Classifier: Programming Language :: Python :: 3.13
@@ -22,30 +21,40 @@ Classifier: Operating System :: Unix
22
21
  Classifier: Topic :: Scientific/Engineering
23
22
  Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
24
23
  Classifier: Intended Audience :: Science/Research
25
- Requires-Python: >=3.10
24
+ Requires-Python: >=3.11
26
25
  Description-Content-Type: text/markdown
27
26
  License-File: LICENSE
28
27
  Requires-Dist: h5py>=3.16.0
29
- Requires-Dist: cf-python>=3.19.0; python_version > "3.10"
30
- Requires-Dist: cf-python<3.19.0; python_version <= "3.10"
28
+ Requires-Dist: cf-python>=3.19.0; platform_system != "Windows"
29
+ Requires-Dist: cf-python<=3.20.1,>=3.19.0; platform_system == "Windows"
31
30
  Requires-Dist: cftime
31
+ Requires-Dist: torch
32
+ Requires-Dist: huggingface_hub
33
+ Requires-Dist: scipy
32
34
  Provides-Extra: test
33
35
  Requires-Dist: pytest; extra == "test"
34
36
  Requires-Dist: pytest-mock; extra == "test"
37
+ Requires-Dist: xarray; extra == "test"
35
38
  Provides-Extra: lint
36
- Requires-Dist: ruff; extra == "lint"
37
- Requires-Dist: blackdoc<=0.4.2; extra == "lint"
38
- Requires-Dist: black<=25.1.0; extra == "lint"
39
- Requires-Dist: mypy; extra == "lint"
39
+ Requires-Dist: ruff==0.15.17; extra == "lint"
40
+ Requires-Dist: blackdoc>=0.4.2; extra == "lint"
41
+ Requires-Dist: black>=25.9.0; extra == "lint"
42
+ Requires-Dist: mypy==2.4.0; extra == "lint"
40
43
  Requires-Dist: pytest; extra == "lint"
44
+ Requires-Dist: xarray; extra == "lint"
41
45
  Provides-Extra: doc
42
46
  Requires-Dist: sphinx<8.2.0; extra == "doc"
43
47
  Requires-Dist: sphinx_rtd_theme; extra == "doc"
44
48
  Requires-Dist: sphinx_autodoc_typehints; extra == "doc"
45
- Requires-Dist: blackdoc<=0.4.2; extra == "doc"
46
- Requires-Dist: black<=25.1.0; extra == "doc"
49
+ Requires-Dist: nbsphinx; extra == "doc"
50
+ Requires-Dist: nbsphinx_link; extra == "doc"
51
+ Provides-Extra: tutorial
52
+ Requires-Dist: jupyter; extra == "tutorial"
53
+ Requires-Dist: matplotlib; extra == "tutorial"
54
+ Requires-Dist: huracanpy; extra == "tutorial"
47
55
  Provides-Extra: dev
48
- Requires-Dist: tctrack[doc,lint,test]; extra == "dev"
56
+ Requires-Dist: tctrack[doc,lint,test,tutorial]; extra == "dev"
57
+ Requires-Dist: pre-commit; extra == "dev"
49
58
  Dynamic: license-file
50
59
 
51
60
  <div align="center">
@@ -58,27 +67,29 @@ Dynamic: license-file
58
67
  ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Cambridge-ICCS/TCTrack/unit-tests.yaml?label=unit-tests)
59
68
  [![Documentation Status](https://readthedocs.org/projects/TCTrack/badge/?version=latest)](https://tctrack.readthedocs.io/en/latest/?badge=latest)
60
69
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
61
- [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
70
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
71
+ [![status](https://joss.theoj.org/papers/5bfc7127397fb0fd3583de541eab4c49/status.svg)](https://joss.theoj.org/papers/5bfc7127397fb0fd3583de541eab4c49)
62
72
 
63
73
 
64
74
  TCTrack is a Python library providing bindings to tracking algorithms for tropical
65
75
  cyclones in an accessible manner to generate high-quality and
66
76
  [FAIR](https://en.wikipedia.org/wiki/FAIR_data) output data.
67
77
 
68
- It can be used for tracking cyclones in simulations and observations, and to compare
69
- the output of different algorithms for a variety of data sources.
78
+ It can be used for tracking cyclones – or, more broadly, for tracking different types of
79
+ features – in simulations and observations, and to compare the output of different
80
+ algorithms for a variety of data sources.
70
81
 
71
82
 
72
83
  ## Installation
73
84
 
74
85
  ### Dependencies
75
- The package requires Python 3 (>=3.10).
86
+ The package requires Python 3 (>=3.11, <3.15).
76
87
 
77
88
  ### Package Installation
78
89
  We recommend using a Conda virtual environment for TCTrack in order to simplify the
79
- installation of dependencies (cf-python, esmpy/ESMF, UDUNITS).
90
+ installation of dependencies (esmpy/ESMF, UDUNITS).
80
91
  ```sh
81
- conda create -n tctrack-env -c conda-forge cf-python cf-plot udunits2 esmpy
92
+ conda create -n tctrack-env -c conda-forge python=3.14 udunits2 esmpy pytorch
82
93
  conda activate tctrack-env
83
94
  ```
84
95
  When finished using TCTrack this can be turned off with `conda deactivate`.
@@ -90,7 +101,7 @@ pip install tctrack
90
101
 
91
102
  See the
92
103
  [documentation](https://tctrack.readthedocs.io/en/latest/getting-started/index.html#installation).
93
- for futher details about installation and dependencies, including how to install the
104
+ for further details about installation and dependencies, including how to install the
94
105
  individual tracking algorithms.
95
106
 
96
107
 
@@ -119,9 +130,10 @@ address an [open issue](https://github.com/Cambridge-ICCS/TCTrack/issues), pleas
119
130
  [fork the repository](https://github.com/Cambridge-ICCS/TCTrack/fork) and open a
120
131
  pull request.
121
132
 
122
- Additional dependencies for deleopment can be installed as follows:
133
+ Additional dependencies for development can be installed as follows:
123
134
  ```sh
124
135
  pip install --editable .[dev]
136
+ pre-commit install
125
137
  ```
126
138
 
127
139
  Full details for contribution and developers can be found in the
@@ -8,27 +8,29 @@
8
8
  ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Cambridge-ICCS/TCTrack/unit-tests.yaml?label=unit-tests)
9
9
  [![Documentation Status](https://readthedocs.org/projects/TCTrack/badge/?version=latest)](https://tctrack.readthedocs.io/en/latest/?badge=latest)
10
10
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
11
- [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
11
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
12
+ [![status](https://joss.theoj.org/papers/5bfc7127397fb0fd3583de541eab4c49/status.svg)](https://joss.theoj.org/papers/5bfc7127397fb0fd3583de541eab4c49)
12
13
 
13
14
 
14
15
  TCTrack is a Python library providing bindings to tracking algorithms for tropical
15
16
  cyclones in an accessible manner to generate high-quality and
16
17
  [FAIR](https://en.wikipedia.org/wiki/FAIR_data) output data.
17
18
 
18
- It can be used for tracking cyclones in simulations and observations, and to compare
19
- the output of different algorithms for a variety of data sources.
19
+ It can be used for tracking cyclones – or, more broadly, for tracking different types of
20
+ features – in simulations and observations, and to compare the output of different
21
+ algorithms for a variety of data sources.
20
22
 
21
23
 
22
24
  ## Installation
23
25
 
24
26
  ### Dependencies
25
- The package requires Python 3 (>=3.10).
27
+ The package requires Python 3 (>=3.11, <3.15).
26
28
 
27
29
  ### Package Installation
28
30
  We recommend using a Conda virtual environment for TCTrack in order to simplify the
29
- installation of dependencies (cf-python, esmpy/ESMF, UDUNITS).
31
+ installation of dependencies (esmpy/ESMF, UDUNITS).
30
32
  ```sh
31
- conda create -n tctrack-env -c conda-forge cf-python cf-plot udunits2 esmpy
33
+ conda create -n tctrack-env -c conda-forge python=3.14 udunits2 esmpy pytorch
32
34
  conda activate tctrack-env
33
35
  ```
34
36
  When finished using TCTrack this can be turned off with `conda deactivate`.
@@ -40,7 +42,7 @@ pip install tctrack
40
42
 
41
43
  See the
42
44
  [documentation](https://tctrack.readthedocs.io/en/latest/getting-started/index.html#installation).
43
- for futher details about installation and dependencies, including how to install the
45
+ for further details about installation and dependencies, including how to install the
44
46
  individual tracking algorithms.
45
47
 
46
48
 
@@ -69,9 +71,10 @@ address an [open issue](https://github.com/Cambridge-ICCS/TCTrack/issues), pleas
69
71
  [fork the repository](https://github.com/Cambridge-ICCS/TCTrack/fork) and open a
70
72
  pull request.
71
73
 
72
- Additional dependencies for deleopment can be installed as follows:
74
+ Additional dependencies for development can be installed as follows:
73
75
  ```sh
74
76
  pip install --editable .[dev]
77
+ pre-commit install
75
78
  ```
76
79
 
77
80
  Full details for contribution and developers can be found in the
@@ -0,0 +1,35 @@
1
+ # Sample data for the machine-learning tracker
2
+
3
+ `era5_dikeledi_2025-01-10.nc` is a small ERA5 subset used by the machine-learning
4
+ tracker's tests and tutorial. It contains the input variables of
5
+ `tctrack.machine_learning.MLTracker` for the period in which Cyclone Dikeledi crossed
6
+ the northern Mozambique Channel.
7
+
8
+ | | |
9
+ |---|---|
10
+ | Time | 2025-01-10 00:00 to 2025-01-12 06:00 UTC, 6-hourly (10 timesteps) |
11
+ | Region | 22.25°S to 2.5°S, 41.0°E to 60.75°E (80 × 80 points, 0.25° spacing) |
12
+ | Pressure levels | 1000, 750 and 500 hPa |
13
+ | Pressure-level variables | relative humidity, air temperature, eastward wind, northward wind, relative vorticity |
14
+ | Surface variables | sea surface temperature (`sst`), 2 m temperature (`t2m`) |
15
+
16
+ Run on this file with the default model, the tracker finds Dikeledi at a threshold of
17
+ 0.25 within about 1 degree of the IBTrACS positions, along with some spurious tracks.
18
+
19
+ ## Source and licence
20
+
21
+ Generated from ERA5 reanalysis data by cropping to the region and period above. No other
22
+ processing was applied.
23
+
24
+ > Hersbach, H., et al. (2023): ERA5 hourly data on pressure levels from 1940 to
25
+ > present. Copernicus Climate Change Service (C3S) Climate Data Store (CDS).
26
+ > DOI: [10.24381/cds.bd0915c6](https://doi.org/10.24381/cds.bd0915c6)
27
+ >
28
+ > Hersbach, H., et al. (2023): ERA5 hourly data on single levels from 1940 to
29
+ > present. Copernicus Climate Change Service (C3S) Climate Data Store (CDS).
30
+ > DOI: [10.24381/cds.adbb2d47](https://doi.org/10.24381/cds.adbb2d47)
31
+
32
+ Contains modified Copernicus Climate Change Service information 2025. Neither the
33
+ European Commission nor ECMWF is responsible for any use that may be made of the
34
+ information it contains. ERA5 is distributed under the
35
+ [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) licence.
@@ -9,3 +9,6 @@ API Documentation
9
9
  TSTORMS <tstorms_api>
10
10
  Tempest Extremes <tempest_extremes_api>
11
11
  TRACK <track_api>
12
+ Machine Learning <machine_learning_api>
13
+ Preprocessing <preprocessing_api>
14
+ Utility functions <utils_api>
@@ -0,0 +1,53 @@
1
+ Machine Learning
2
+ ================
3
+
4
+ The machine learning (ML) tracker detects tropical cyclones using a U-Net
5
+ segmentation model, and then links the detections into trajectories. The model
6
+ weights are downloaded from a HuggingFace Hub repository (or supplied locally)
7
+ rather than wrapping an external executable.
8
+
9
+ The model and its training pipeline are described in the reference `cyclone-track-ml
10
+ <https://github.com/robert-edwin-rouse/cyclone-track-ml>`_ repository.
11
+
12
+ For an overview of the functionalities, installation, and usage see the
13
+ :doc:`Machine Learning section of the documentation <../tracking-algorithms/machine_learning>`.
14
+
15
+ .. py:module:: tctrack.machine_learning
16
+
17
+ .. autoclass:: MLTracker
18
+ :members:
19
+ :undoc-members:
20
+ :show-inheritance:
21
+ :inherited-members:
22
+ :exclude-members: model
23
+
24
+ .. autoclass:: MLParameters
25
+ :members:
26
+ :undoc-members:
27
+ :show-inheritance:
28
+ :inherited-members:
29
+
30
+ .. autoclass:: MLStitchParameters
31
+ :members:
32
+ :undoc-members:
33
+ :show-inheritance:
34
+ :inherited-members:
35
+
36
+ .. autofunction:: parameter_set
37
+
38
+ The classes below are base classes for adding other machine learning tracking
39
+ algorithms to TCTrack. They are not intended to be used directly.
40
+
41
+ .. py:module:: tctrack.core.ml_tracker
42
+ :no-index:
43
+
44
+ .. autoclass:: tctrack.core.ml_tracker.TCMLParameters
45
+ :members:
46
+ :undoc-members:
47
+ :show-inheritance:
48
+
49
+ .. autoclass:: tctrack.core.ml_tracker.TCMLTracker
50
+ :members:
51
+ :undoc-members:
52
+ :show-inheritance:
53
+ :exclude-members: model
@@ -0,0 +1,6 @@
1
+ Preprocessing functions
2
+ =======================
3
+
4
+ .. automodule:: tctrack.preprocessing
5
+ :members:
6
+ :member-order: bysource
@@ -27,11 +27,22 @@ For an overview of the functionalities, installation, and usage see the
27
27
  :undoc-members:
28
28
  :show-inheritance:
29
29
 
30
+ .. autofunction:: parameter_set
31
+
32
+ .. autofunction:: parameter_set_uz
33
+
34
+ .. autofunction:: parameter_set_owz
35
+
30
36
  .. autoclass:: TEContour
31
37
  :members:
32
38
  :undoc-members:
33
39
  :show-inheritance:
34
40
 
41
+ .. autoclass:: TEDetectThreshold
42
+ :members:
43
+ :undoc-members:
44
+ :show-inheritance:
45
+
35
46
  .. autoclass:: TEOutputCommand
36
47
  :members:
37
48
  :undoc-members:
@@ -26,3 +26,5 @@ For an overview of the functionalities, installation, and usage see the
26
26
  :undoc-members:
27
27
  :show-inheritance:
28
28
  :inherited-members:
29
+
30
+ .. autofunction:: parameter_set
@@ -33,3 +33,5 @@ For an overview of the functionalities, installation, and usage see the
33
33
  :undoc-members:
34
34
  :show-inheritance:
35
35
  :inherited-members:
36
+
37
+ .. autofunction:: parameter_set
@@ -0,0 +1,5 @@
1
+ Utility functions
2
+ =================
3
+
4
+ .. automodule:: tctrack.utils
5
+ :members:
@@ -33,6 +33,8 @@ extensions = [
33
33
  "sphinx.ext.autodoc", # pull in documentation from docstrings
34
34
  "sphinx_autodoc_typehints", # use type hints from code/docstrings
35
35
  "sphinx.ext.autosectionlabel", # Auto-generate reference labels for sections
36
+ "nbsphinx", # render the tutorial notebooks
37
+ "nbsphinx_link", # link to notebooks outside the docs directory
36
38
  ]
37
39
 
38
40
  templates_path = ["_templates"]
@@ -48,3 +50,4 @@ html_static_path = ["_static"]
48
50
  autodoc_member_order = "bysource"
49
51
  napoleon_preprocess_types = True
50
52
  autosectionlabel_prefix_document = True
53
+ rst_prolog = ".. |br| raw:: html\n\n <br>" # linebreaks with |br|
@@ -127,13 +127,16 @@ Files always include two
127
127
  - **start_flag**
128
128
 
129
129
  - *Dimensions*: ``(trajectory)``
130
+ - *Attributes* include ``flag_interval``, recording the interval used.
130
131
 
131
132
  - **end_flag**
132
133
 
133
134
  - *Dimensions*: ``(trajectory)``
135
+ - *Attributes* include ``flag_interval``, recording the interval used.
134
136
 
135
- These indicate any tracks that start or end within 1 day of the input dataset bounds
136
- and may therefore extend outside this range.
137
+ These indicate any tracks that start or end within the interval passed to
138
+ ``TCTracker.to_netcdf(..., flag_interval=...)`` of the input dataset bounds and may
139
+ therefore extend outside this range. The default interval is 1 day.
137
140
 
138
141
  Global Attributes
139
142
  ^^^^^^^^^^^^^^^^^