tctrack 0.2__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 (67) hide show
  1. tctrack-0.2/.github/workflows/codequality.yaml +100 -0
  2. tctrack-0.2/.github/workflows/release.yaml +58 -0
  3. tctrack-0.2/.github/workflows/unit-tests.yaml +75 -0
  4. tctrack-0.2/.gitignore +182 -0
  5. tctrack-0.2/.readthedocs.yaml +30 -0
  6. tctrack-0.2/LICENSE +674 -0
  7. tctrack-0.2/PKG-INFO +155 -0
  8. tctrack-0.2/README.md +105 -0
  9. tctrack-0.2/docs/Makefile +20 -0
  10. tctrack-0.2/docs/api/core_api.rst +30 -0
  11. tctrack-0.2/docs/api/index.rst +11 -0
  12. tctrack-0.2/docs/api/tempest_extremes_api.rst +43 -0
  13. tctrack-0.2/docs/api/track_api.rst +28 -0
  14. tctrack-0.2/docs/api/tstorms_api.rst +35 -0
  15. tctrack-0.2/docs/conf.py +50 -0
  16. tctrack-0.2/docs/data/index.rst +12 -0
  17. tctrack-0.2/docs/data/output_file.rst +364 -0
  18. tctrack-0.2/docs/data/preprocessing_data.rst +240 -0
  19. tctrack-0.2/docs/developer/adding_algorithms.rst +148 -0
  20. tctrack-0.2/docs/developer/guidelines.rst +268 -0
  21. tctrack-0.2/docs/developer/index.rst +16 -0
  22. tctrack-0.2/docs/getting-started/index.rst +122 -0
  23. tctrack-0.2/docs/getting-started/tutorial.rst +154 -0
  24. tctrack-0.2/docs/images/TCTrack_Logo.svg +90 -0
  25. tctrack-0.2/docs/images/data_tracks_plot.png +0 -0
  26. tctrack-0.2/docs/images/inigo_inspire.png +0 -0
  27. tctrack-0.2/docs/index.rst +53 -0
  28. tctrack-0.2/docs/make.bat +35 -0
  29. tctrack-0.2/docs/references.rst +11 -0
  30. tctrack-0.2/docs/tracking-algorithms/index.rst +18 -0
  31. tctrack-0.2/docs/tracking-algorithms/tempest_extremes.rst +230 -0
  32. tctrack-0.2/docs/tracking-algorithms/track.rst +174 -0
  33. tctrack-0.2/docs/tracking-algorithms/tstorms.rst +266 -0
  34. tctrack-0.2/pyproject.toml +107 -0
  35. tctrack-0.2/setup.cfg +4 -0
  36. tctrack-0.2/setup.py +6 -0
  37. tctrack-0.2/src/tctrack/__init__.py +5 -0
  38. tctrack-0.2/src/tctrack/core/__init__.py +19 -0
  39. tctrack-0.2/src/tctrack/core/tracker.py +530 -0
  40. tctrack-0.2/src/tctrack/core/trajectory.py +228 -0
  41. tctrack-0.2/src/tctrack/tempest_extremes/__init__.py +19 -0
  42. tctrack-0.2/src/tctrack/tempest_extremes/tempest_extremes.py +1144 -0
  43. tctrack-0.2/src/tctrack/track/__init__.py +11 -0
  44. tctrack-0.2/src/tctrack/track/track.py +778 -0
  45. tctrack-0.2/src/tctrack/tstorms/__init__.py +15 -0
  46. tctrack-0.2/src/tctrack/tstorms/tstorms.py +1075 -0
  47. tctrack-0.2/src/tctrack/utils/__init__.py +7 -0
  48. tctrack-0.2/src/tctrack/utils/utils.py +29 -0
  49. tctrack-0.2/src/tctrack.egg-info/PKG-INFO +155 -0
  50. tctrack-0.2/src/tctrack.egg-info/SOURCES.txt +65 -0
  51. tctrack-0.2/src/tctrack.egg-info/dependency_links.txt +1 -0
  52. tctrack-0.2/src/tctrack.egg-info/requires.txt +29 -0
  53. tctrack-0.2/src/tctrack.egg-info/top_level.txt +1 -0
  54. tctrack-0.2/tests/unit/core/test_tracker.py +444 -0
  55. tctrack-0.2/tests/unit/core/test_trajectory.py +167 -0
  56. tctrack-0.2/tests/unit/tempest_extremes/test_tempest_extremes.py +1230 -0
  57. tctrack-0.2/tests/unit/track/test_track.py +451 -0
  58. tctrack-0.2/tests/unit/tstorms/test_tstorms.py +1210 -0
  59. tctrack-0.2/tests/unit/utils/test_netcdf.py +41 -0
  60. tctrack-0.2/tutorial/README.md +15 -0
  61. tctrack-0.2/tutorial/fetch_data.sh +31 -0
  62. tctrack-0.2/tutorial/install_tempest_extremes.sh +22 -0
  63. tctrack-0.2/tutorial/install_tstorms.sh +19 -0
  64. tctrack-0.2/tutorial/plot_tracks.py +82 -0
  65. tctrack-0.2/tutorial/regrid.py +195 -0
  66. tctrack-0.2/tutorial/run_tempest_extremes.py +56 -0
  67. tctrack-0.2/tutorial/run_tstorms.py +45 -0
@@ -0,0 +1,100 @@
1
+ # Workflow to run code-quality checks on the source
2
+ name: code-quality
3
+
4
+ # When will this workflow run?
5
+ on:
6
+ # run on every push to main, i.e. PR merges
7
+ push:
8
+ branches: [ "main" ]
9
+
10
+ # Triggers the workflow on pushes to open pull requests with code changes
11
+ pull_request:
12
+ paths:
13
+ - '**.py'
14
+ - 'docs/**'
15
+ - '.github/workflows/codequality.yaml'
16
+
17
+ # Allows you to run this workflow manually from the Actions tab
18
+ workflow_dispatch:
19
+
20
+ # No permissions required to run this code
21
+ permissions: {}
22
+
23
+ jobs:
24
+ code-quality:
25
+ name: Run code quality checks
26
+ runs-on: ubuntu-latest
27
+ strategy:
28
+ fail-fast: false
29
+
30
+ steps:
31
+ # Checks-out repository under $GITHUB_WORKSPACE, so job can access it
32
+ - name: Checkout code
33
+ with:
34
+ persist-credentials: false
35
+ uses: actions/checkout@v4
36
+
37
+ - name: Install Python
38
+ uses: actions/setup-python@v5
39
+ with:
40
+ python-version: '3.x'
41
+
42
+ - name: Install Package and Dependencies
43
+ run: |
44
+ python -m pip install --upgrade pip
45
+ python -m venv tctrack_venv
46
+ . tctrack_venv/bin/activate
47
+ pip install .[lint,doc]
48
+
49
+ - name: ruff format tctrack
50
+ if: always()
51
+ run: |
52
+ cd ${{ github.workspace }}
53
+ . tctrack_venv/bin/activate
54
+ ruff format --diff src/
55
+
56
+ - name: ruff check tctrack
57
+ if: always()
58
+ run: |
59
+ cd ${{ github.workspace }}
60
+ . tctrack_venv/bin/activate
61
+ ruff check --diff src/
62
+
63
+ - name: mypy tctrack
64
+ if: always()
65
+ # Run mypy over the src code for the package
66
+ run: |
67
+ cd ${{ github.workspace }}
68
+ . tctrack_venv/bin/activate
69
+ mypy src/
70
+
71
+ - name: Check docs formatting with blackdoc
72
+ if: always()
73
+ # Run blackdoc over the docs
74
+ run: |
75
+ cd ${{ github.workspace }}
76
+ . tctrack_venv/bin/activate
77
+ blackdoc --diff docs/
78
+
79
+ - name: ruff format tests
80
+ if: always()
81
+ run: |
82
+ cd ${{ github.workspace }}
83
+ . tctrack_venv/bin/activate
84
+ ruff format --diff tests/
85
+
86
+ - name: ruff check tests
87
+ if: always()
88
+ run: |
89
+ cd ${{ github.workspace }}
90
+ . tctrack_venv/bin/activate
91
+ ruff check --diff tests/
92
+
93
+ - name: mypy tests
94
+ if: always()
95
+ # Run mypy over the tests, but include src for tctrack stubs
96
+ run: |
97
+ cd ${{ github.workspace }}
98
+ . tctrack_venv/bin/activate
99
+ mypy src tests
100
+
@@ -0,0 +1,58 @@
1
+ # Workflow to publish versioned commits to PyPI
2
+ name: release
3
+
4
+ on:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+
9
+ jobs:
10
+
11
+ build:
12
+ name: Build release
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: Checkout repo
17
+ uses: actions/checkout@v6
18
+ with:
19
+ fetch-depth: 0 # REQUIRED for setuptools_scm
20
+
21
+ - name: Install Python
22
+ uses: actions/setup-python@v6
23
+ with:
24
+ python-version: "3.14"
25
+
26
+ - name: Install build tool
27
+ run: python -m pip install --upgrade build
28
+
29
+ - name: Build package
30
+ run: python -m build
31
+
32
+ - name: Upload distributions
33
+ uses: actions/upload-artifact@v7
34
+ with:
35
+ name: dist
36
+ path: dist/
37
+
38
+ pypi-publish:
39
+ name: Upload release to PyPI
40
+ runs-on: ubuntu-latest
41
+ needs: build
42
+
43
+ environment:
44
+ name: pypi
45
+ url: https://pypi.org/p/tctrack
46
+
47
+ permissions:
48
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
49
+
50
+ steps:
51
+ - name: Download distributions
52
+ uses: actions/download-artifact@v8
53
+ with:
54
+ name: dist
55
+ path: dist/
56
+
57
+ - name: Publish package distributions to PyPI
58
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,75 @@
1
+ # Workflow to run unit tests on the source
2
+ name: Unit Testing
3
+
4
+ # When will this workflow run?
5
+ on:
6
+ # run on every push to main, i.e. PR merges
7
+ push:
8
+ branches: [ "main" ]
9
+
10
+ # Triggers the workflow on pushes to open pull requests with code changes
11
+ pull_request:
12
+ paths:
13
+ - '**.py'
14
+ - '.github/workflows/unit-tests.yaml'
15
+
16
+ # Allows you to run this workflow manually from the Actions tab
17
+ workflow_dispatch:
18
+
19
+ # No permissions required to run this code
20
+ permissions: {}
21
+
22
+ jobs:
23
+ unit-test:
24
+ name: Build & test (${{ matrix.python-version }} | ${{ matrix.os }})
25
+ runs-on: ${{ matrix.os }}
26
+
27
+ strategy:
28
+ # continue testing other configurations even if a matrix job fails
29
+ fail-fast: false
30
+ matrix:
31
+ # Supported Python versions on Linux Ubuntu
32
+ os: ["ubuntu-latest"]
33
+ python-version: ["3.14", "3.13", "3.12", "3.11", "3.10"]
34
+ # test latest python version on macOS
35
+ include:
36
+ - os: macos-latest
37
+ python-version: "3.14"
38
+
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
+ - name: Checkout code
54
+ with:
55
+ persist-credentials: false
56
+ uses: actions/checkout@v4
57
+
58
+ - name: Install Python
59
+ uses: actions/setup-python@v5
60
+ with:
61
+ python-version: ${{ matrix.python-version }}
62
+
63
+ - 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]
69
+
70
+ - name: Run unit tests
71
+ if: always()
72
+ run: |
73
+ cd ${{ github.workspace }}
74
+ . tctrack_venv/bin/activate
75
+ pytest tests/unit
tctrack-0.2/.gitignore ADDED
@@ -0,0 +1,182 @@
1
+ # Spurious system files
2
+ **/.DS_Store
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ share/python-wheels/
27
+ *.egg-info/
28
+ .installed.cfg
29
+ *.egg
30
+ MANIFEST
31
+
32
+ # PyInstaller
33
+ # Usually these files are written by a python script from a template
34
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
35
+ *.manifest
36
+ *.spec
37
+
38
+ # Installer logs
39
+ pip-log.txt
40
+ pip-delete-this-directory.txt
41
+
42
+ # Unit test / coverage reports
43
+ htmlcov/
44
+ .tox/
45
+ .nox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ *.py,cover
53
+ .hypothesis/
54
+ .pytest_cache/
55
+ cover/
56
+
57
+ # Translations
58
+ *.mo
59
+ *.pot
60
+
61
+ # Django stuff:
62
+ *.log
63
+ local_settings.py
64
+ db.sqlite3
65
+ db.sqlite3-journal
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+
77
+ # PyBuilder
78
+ .pybuilder/
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # pyenv
89
+ # For a library or package, you might want to ignore these files since the code is
90
+ # intended to run in multiple environments; otherwise, check them in:
91
+ # .python-version
92
+
93
+ # pipenv
94
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
96
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
97
+ # install all needed dependencies.
98
+ #Pipfile.lock
99
+
100
+ # UV
101
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
102
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
103
+ # commonly ignored for libraries.
104
+ #uv.lock
105
+
106
+ # poetry
107
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111
+ #poetry.lock
112
+
113
+ # pdm
114
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
115
+ #pdm.lock
116
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
117
+ # in version control.
118
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
119
+ .pdm.toml
120
+ .pdm-python
121
+ .pdm-build/
122
+
123
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
124
+ __pypackages__/
125
+
126
+ # Celery stuff
127
+ celerybeat-schedule
128
+ celerybeat.pid
129
+
130
+ # SageMath parsed files
131
+ *.sage.py
132
+
133
+ # Environments
134
+ .env
135
+ .venv
136
+ env/
137
+ venv/
138
+ ENV/
139
+ env.bak/
140
+ venv.bak/
141
+
142
+ # Spyder project settings
143
+ .spyderproject
144
+ .spyproject
145
+
146
+ # Rope project settings
147
+ .ropeproject
148
+
149
+ # mkdocs documentation
150
+ /site
151
+
152
+ # mypy
153
+ .mypy_cache/
154
+ .dmypy.json
155
+ dmypy.json
156
+
157
+ # Pyre type checker
158
+ .pyre/
159
+
160
+ # pytype static type analyzer
161
+ .pytype/
162
+
163
+ # Cython debug symbols
164
+ cython_debug/
165
+
166
+ # PyCharm
167
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
168
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
169
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
170
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
171
+ #.idea/
172
+
173
+ # Ruff stuff:
174
+ .ruff_cache/
175
+
176
+ # PyPI configuration file
177
+ .pypirc
178
+
179
+ # Tutorial execution
180
+ tutorial/*/
181
+ tutorial/*.nc
182
+ tutorial/*.png
@@ -0,0 +1,30 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ python:
9
+ install:
10
+ - method: pip
11
+ path: .
12
+ extra_requirements:
13
+ - doc
14
+
15
+ # Set the OS, Python version and other tools you might need
16
+ build:
17
+ os: ubuntu-22.04
18
+ apt_packages:
19
+ - libudunits2-dev
20
+ tools:
21
+ python: "3.13"
22
+
23
+ # Build documentation in the "docs/" directory with Sphinx
24
+ sphinx:
25
+ configuration: docs/conf.py
26
+
27
+ # Optionally build your docs in additional formats such as PDF and ePub
28
+ # formats:
29
+ # - pdf
30
+ # - epub