eo-tides 0.7.4.dev7__tar.gz → 0.7.5__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.
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/workflows/paper.yml +1 -15
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/workflows/update-changelog.yml +1 -2
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.pre-commit-config.yaml +4 -8
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/PKG-INFO +6 -5
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/README.md +4 -3
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/changelog.md +31 -5
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/credits.md +1 -1
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/index.md +2 -2
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/notebooks/Case_study_intertidal.ipynb +3 -3
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/notebooks/Model_tides.ipynb +8 -9
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/notebooks/Satellite_data.ipynb +5 -5
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/notebooks/Tide_statistics.ipynb +5 -5
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/notebooks/Validating_tides.ipynb +2 -1
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/eo_tides/eo.py +2 -3
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/eo_tides/model.py +3 -12
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/eo_tides/stats.py +2 -5
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/eo_tides/utils.py +6 -8
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/eo_tides/validation.py +3 -5
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/mkdocs.yml +1 -0
- eo_tides-0.7.4.dev7/paper/paper.pdf → eo_tides-0.7.5/paper/10.21105.joss.07786.pdf +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/benchmarking.ipynb +4 -2
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/pyproject.toml +32 -8
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/conftest.py +2 -4
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/test_eo.py +2 -2
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/test_model.py +6 -6
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/test_utils.py +2 -4
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/uv.lock +594 -458
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.editorconfig +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/actions/setup-python-env/action.yml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/dependabot.yml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/release.yml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/workflows/check-links.yml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/workflows/publish.yml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/workflows/tests.yml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.github/workflows/update-version.yml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/.gitignore +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/CITATION.cff +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/CONTRIBUTING.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/Dockerfile +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/LICENSE +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/Makefile +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/codecov.yaml +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/api.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/dtu23_download.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/eo-tides-abstract.gif +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/eo-tides-logo-128.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/eo-tides-logo-256.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/eo-tides-logo.gif +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/eo-tides-logo.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/eot20_download.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/fes_ftp.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/fes_myproducts.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/fes_productselection.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/fes_subscriptions.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/got_download.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/tide_models_clipped.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/assets/tpxo_download.jpg +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/install.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/migration.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/setup.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/docs/stylesheets/extra.css +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/eo_tides/__init__.py +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/figures/joss_abstract.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/figures/joss_fig_gesla.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/figures/joss_fig_list.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/figures/joss_fig_pixel.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/figures/joss_fig_stats.png +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/paper.bib +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/paper/paper.md +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/data/GESLA3.0_ALL/broome-62650-aus-bom +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/data/GESLA3.0_ALL/san_diego_ca-569a-usa-uhslc +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/data/GESLA3.0_ALL/sydney_fort_denison-60370-aus-bom +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/data/GESLA3_ALL 2.csv +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/data/IDO71013_2020.csv +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/data/tide_models.tar.gz +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/test_stats.py +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/test_validation.py +0 -0
- {eo_tides-0.7.4.dev7 → eo_tides-0.7.5}/tests/testing.ipynb +0 -0
@@ -1,19 +1,5 @@
|
|
1
1
|
name: Draft paper PDF
|
2
|
-
on:
|
3
|
-
push:
|
4
|
-
branches:
|
5
|
-
- main
|
6
|
-
- JOSS_paper
|
7
|
-
paths:
|
8
|
-
- paper/**
|
9
|
-
- .github/workflows/paper.yml
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- main
|
13
|
-
- JOSS_paper
|
14
|
-
paths:
|
15
|
-
- paper/**
|
16
|
-
- .github/workflows/paper.yml
|
2
|
+
on: workflow_dispatch
|
17
3
|
|
18
4
|
jobs:
|
19
5
|
paper:
|
@@ -32,10 +32,9 @@ jobs:
|
|
32
32
|
title: "Update changelog for ${{ github.event.release.tag_name }}"
|
33
33
|
body: |
|
34
34
|
This PR updates the changelog with details from the release [${{ github.event.release.tag_name }}](${{ github.event.release.html_url }}).
|
35
|
-
commit-message: "Update changelog for ${{ github.event.release.tag_name }}
|
35
|
+
commit-message: "Update changelog for ${{ github.event.release.tag_name }}"
|
36
36
|
branch: update-changelog-${{ github.event.release.tag_name }}
|
37
37
|
base: ${{ github.event.release.target_commitish }}
|
38
38
|
add-paths: |
|
39
39
|
docs/changelog.md
|
40
|
-
uv.lock
|
41
40
|
delete-branch: true
|
@@ -1,3 +1,5 @@
|
|
1
|
+
exclude: ^docs/changelog\.md$
|
2
|
+
|
1
3
|
repos:
|
2
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
3
5
|
rev: "v4.4.0"
|
@@ -10,16 +12,10 @@ repos:
|
|
10
12
|
- id: trailing-whitespace
|
11
13
|
|
12
14
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
13
|
-
# Ruff version.
|
14
15
|
rev: v0.6.4
|
15
16
|
hooks:
|
16
|
-
# Run
|
17
|
-
- id: ruff
|
18
|
-
types_or: [python, pyi]
|
19
|
-
args: [--fix, --select=I] # --select=ALL, I
|
20
|
-
# Run the formatter.
|
21
|
-
- id: ruff-format
|
22
|
-
types_or: [python, pyi]
|
17
|
+
- id: ruff # Run linter using pyproject.toml config
|
18
|
+
- id: ruff-format # Run formatter using pyproject.toml config
|
23
19
|
|
24
20
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
25
21
|
rev: "v3.0.3"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: eo-tides
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.5
|
4
4
|
Summary: Tide modelling tools for large-scale satellite earth observation analysis
|
5
5
|
Project-URL: Homepage, https://GeoscienceAustralia.github.io/eo-tides/
|
6
6
|
Project-URL: Repository, https://github.com/GeoscienceAustralia/eo-tides
|
@@ -23,7 +23,7 @@ Classifier: Topic :: Scientific/Engineering :: Oceanography
|
|
23
23
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
24
24
|
Requires-Python: <4.0,>=3.10
|
25
25
|
Requires-Dist: colorama>=0.4.3
|
26
|
-
Requires-Dist: dask[complete]
|
26
|
+
Requires-Dist: dask[complete]>=2023.1.0
|
27
27
|
Requires-Dist: geopandas>=0.10.0
|
28
28
|
Requires-Dist: matplotlib>=3.8.0
|
29
29
|
Requires-Dist: numpy>=1.26.0
|
@@ -56,11 +56,12 @@ Description-Content-Type: text/markdown
|
|
56
56
|
[](https://github.com/GeoscienceAustralia/eo-tides/blob/main/pyproject.toml)
|
57
57
|
[](https://codecov.io/gh/GeoscienceAustralia/eo-tides)
|
58
58
|
[](https://img.shields.io/github/license/GeoscienceAustralia/eo-tides)
|
59
|
-
[](https://joss.theoj.org/papers/b5680c39bf831c1159c41a2eb7ec9c5e)
|
60
60
|
|
61
61
|
- ⚙️ **Github repository**: <https://github.com/GeoscienceAustralia/eo-tides/>
|
62
|
-
- 📘 **Documentation**: <https://GeoscienceAustralia.github.io/eo-tides/>
|
63
62
|
- 🐍 **PyPI**: <https://pypi.org/project/eo-tides/>
|
63
|
+
- ℹ️ **Documentation**: <https://GeoscienceAustralia.github.io/eo-tides/>
|
64
|
+
- 📰 **Paper**: <https://doi.org/10.21105/joss.07786>
|
64
65
|
|
65
66
|
<br>
|
66
67
|
|
@@ -104,7 +105,7 @@ Interactive Jupyter Notebook usage examples and more complex coastal EO case stu
|
|
104
105
|
|
105
106
|
## Citing `eo-tides`
|
106
107
|
|
107
|
-
To cite `eo-tides` in your work, please use the following Journal of Open Source Software citation:
|
108
|
+
To cite `eo-tides` in your work, please use the following [Journal of Open Source Software](https://doi.org/10.21105/joss.07786) citation:
|
108
109
|
|
109
110
|
```
|
110
111
|
Bishop-Taylor, R., Phillips, C., Sagar, S., Newey, V., & Sutterley, T., (2025). eo-tides: Tide modelling tools for large-scale satellite Earth observation analysis. Journal of Open Source Software, 10(109), 7786, https://doi.org/10.21105/joss.07786
|
@@ -7,11 +7,12 @@
|
|
7
7
|
[](https://github.com/GeoscienceAustralia/eo-tides/blob/main/pyproject.toml)
|
8
8
|
[](https://codecov.io/gh/GeoscienceAustralia/eo-tides)
|
9
9
|
[](https://img.shields.io/github/license/GeoscienceAustralia/eo-tides)
|
10
|
-
[](https://joss.theoj.org/papers/b5680c39bf831c1159c41a2eb7ec9c5e)
|
11
11
|
|
12
12
|
- ⚙️ **Github repository**: <https://github.com/GeoscienceAustralia/eo-tides/>
|
13
|
-
- 📘 **Documentation**: <https://GeoscienceAustralia.github.io/eo-tides/>
|
14
13
|
- 🐍 **PyPI**: <https://pypi.org/project/eo-tides/>
|
14
|
+
- ℹ️ **Documentation**: <https://GeoscienceAustralia.github.io/eo-tides/>
|
15
|
+
- 📰 **Paper**: <https://doi.org/10.21105/joss.07786>
|
15
16
|
|
16
17
|
<br>
|
17
18
|
|
@@ -55,7 +56,7 @@ Interactive Jupyter Notebook usage examples and more complex coastal EO case stu
|
|
55
56
|
|
56
57
|
## Citing `eo-tides`
|
57
58
|
|
58
|
-
To cite `eo-tides` in your work, please use the following Journal of Open Source Software citation:
|
59
|
+
To cite `eo-tides` in your work, please use the following [Journal of Open Source Software](https://doi.org/10.21105/joss.07786) citation:
|
59
60
|
|
60
61
|
```
|
61
62
|
Bishop-Taylor, R., Phillips, C., Sagar, S., Newey, V., & Sutterley, T., (2025). eo-tides: Tide modelling tools for large-scale satellite Earth observation analysis. Journal of Open Source Software, 10(109), 7786, https://doi.org/10.21105/joss.07786
|
@@ -1,5 +1,30 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.7.4 - 2025-05-30
|
4
|
+
|
5
|
+
<!-- Release notes generated using configuration in .github/release.yml at main -->
|
6
|
+
### What's Changed
|
7
|
+
|
8
|
+
#### New features
|
9
|
+
|
10
|
+
* Add version attribute to init file by @robbibt in https://github.com/GeoscienceAustralia/eo-tides/pull/98
|
11
|
+
|
12
|
+
#### Documentation updates
|
13
|
+
|
14
|
+
* Fix capitalisation in JOSS paper bibliography by @robbibt in https://github.com/GeoscienceAustralia/eo-tides/pull/97
|
15
|
+
* Update suggested citation to use new JOSS paper citation by @robbibt in https://github.com/GeoscienceAustralia/eo-tides/pull/100
|
16
|
+
|
17
|
+
#### Other changes
|
18
|
+
|
19
|
+
* Update PR labelling and release template by @robbibt in https://github.com/GeoscienceAustralia/eo-tides/pull/99
|
20
|
+
* Reformat code with additional `ruff` linting rules by @robbibt in https://github.com/GeoscienceAustralia/eo-tides/pull/101
|
21
|
+
|
22
|
+
### New Contributors
|
23
|
+
|
24
|
+
* @github-actions made their first contribution in https://github.com/GeoscienceAustralia/eo-tides/pull/96
|
25
|
+
|
26
|
+
**Full Changelog**: https://github.com/GeoscienceAustralia/eo-tides/compare/0.7.3...0.7.4
|
27
|
+
|
3
28
|
## 0.7.3 - 2025-05-22
|
4
29
|
|
5
30
|
### Changes
|
@@ -99,19 +124,20 @@ Minor update to package dependencies
|
|
99
124
|
### New features
|
100
125
|
|
101
126
|
- Publishes ensemble tide modelling code for combining multiple global ocean tide models into a single locally optimised ensemble tide model using external model ranking data (e.g. satellite altimetry or NDWI-tide correlations along the coastline).
|
102
|
-
|
127
|
+
|
103
128
|
- Update ensemble code to latest version that includes FES2022, GOT5.6 and TPXO10 tide models
|
104
129
|
- Make ensemble model calculation function a top level function (i.e. rename from `_ensemble_model` to `ensemble_tides`)
|
105
130
|
- Load tide model ranking points from external `flatgeobuf` format file for faster cloud access
|
106
|
-
|
131
|
+
|
107
132
|
- Major refactor to statistics functions to standardise code across both `pixel_stats` and `tide_stats` and add support for multiple models
|
108
|
-
|
133
|
+
|
109
134
|
- `tide_stats` will now return a `pandas.Series` if one model is requested, and a `pandas.DataFrame` if multiple are requested
|
110
135
|
- Added a new `point_col` parameter to `tide_stats` to control the colour of plotted points. If `plot_var` is also provided, points will now be coloured differently by default.
|
111
|
-
|
136
|
+
|
112
137
|
- Added a new `crop_buffer` parameter to configure buffer distance when cropping model files with `crop=True` (defaults to 5 degrees)
|
113
|
-
|
138
|
+
|
114
139
|
- Reorder `model_tides` parameters to provide more logical flow and move more common params like `mode`, `output_format` and `output_units` higher
|
140
|
+
|
115
141
|
|
116
142
|
### Bug fixes
|
117
143
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
## Citing `eo-tides`
|
2
2
|
|
3
|
-
To cite `eo-tides` in your work, please use the following Journal of Open Source Software citation:
|
3
|
+
To cite `eo-tides` in your work, please use the following [Journal of Open Source Software](https://doi.org/10.21105/joss.07786) citation:
|
4
4
|
|
5
5
|
=== "Plain text"
|
6
6
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
[](https://github.com/GeoscienceAustralia/eo-tides)
|
7
7
|
[](https://pypi.org/project/eo-tides/)
|
8
8
|
[](https://github.com/GeoscienceAustralia/eo-tides/actions/workflows/tests.yml?query=branch%3Amain)
|
9
|
-
[](https://img.shields.io/github/commit-activity/m/GeoscienceAustralia/eo-tides)
|
10
9
|
[](https://img.shields.io/github/license/GeoscienceAustralia/eo-tides)
|
10
|
+
[](https://joss.theoj.org/papers/b5680c39bf831c1159c41a2eb7ec9c5e)
|
11
11
|
|
12
12
|
`eo-tides` provides provides powerful parallelized tools for integrating satellite Earth observation data with tide modelling. 🛠️🌊🛰️
|
13
13
|
|
@@ -41,7 +41,7 @@ For instructions on how to set up these models for use in `eo-tides`, refer to [
|
|
41
41
|
|
42
42
|
## Citing `eo-tides`
|
43
43
|
|
44
|
-
To cite `eo-tides` in your work, please use the following Journal of Open Source Software citation:
|
44
|
+
To cite `eo-tides` in your work, please use the following [Journal of Open Source Software](https://doi.org/10.21105/joss.07786) citation:
|
45
45
|
|
46
46
|
=== "Plain text"
|
47
47
|
|
@@ -49,10 +49,10 @@
|
|
49
49
|
"metadata": {},
|
50
50
|
"outputs": [],
|
51
51
|
"source": [
|
52
|
+
"import matplotlib.pyplot as plt\n",
|
52
53
|
"import odc.stac\n",
|
53
|
-
"import pystac_client\n",
|
54
54
|
"import planetary_computer\n",
|
55
|
-
"import
|
55
|
+
"import pystac_client\n",
|
56
56
|
"\n",
|
57
57
|
"from eo_tides.eo import tag_tides\n",
|
58
58
|
"from eo_tides.stats import tide_stats\n",
|
@@ -264,7 +264,7 @@
|
|
264
264
|
],
|
265
265
|
"source": [
|
266
266
|
"# Calculate NDWI\n",
|
267
|
-
"ds[[\"ndwi\"]] = (ds.green - ds.nir08) / (ds.green + ds.nir08)
|
267
|
+
"ds[[\"ndwi\"]] = (ds.green - ds.nir08) / (ds.green + ds.nir08)\n",
|
268
268
|
"\n",
|
269
269
|
"# Plot a single timestep\n",
|
270
270
|
"ds.ndwi.isel(time=1).plot.imshow(vmin=-0.5, vmax=0.5, cmap=\"RdBu\")"
|
@@ -222,9 +222,10 @@
|
|
222
222
|
}
|
223
223
|
],
|
224
224
|
"source": [
|
225
|
-
"from eo_tides.model import model_tides\n",
|
226
225
|
"import pandas as pd\n",
|
227
226
|
"\n",
|
227
|
+
"from eo_tides.model import model_tides\n",
|
228
|
+
"\n",
|
228
229
|
"tide_df = model_tides(\n",
|
229
230
|
" x=122.2186,\n",
|
230
231
|
" y=-18.0008,\n",
|
@@ -680,13 +681,11 @@
|
|
680
681
|
}
|
681
682
|
],
|
682
683
|
"source": [
|
683
|
-
"df = pd.DataFrame(\n",
|
684
|
-
"
|
685
|
-
"
|
686
|
-
"
|
687
|
-
"
|
688
|
-
" }\n",
|
689
|
-
")\n",
|
684
|
+
"df = pd.DataFrame({\n",
|
685
|
+
" \"time\": pd.date_range(start=\"2018-01-01\", end=\"2018-01-31\", periods=2),\n",
|
686
|
+
" \"x\": [122.21, 122.22],\n",
|
687
|
+
" \"y\": [-18.20, -18.21],\n",
|
688
|
+
"})\n",
|
690
689
|
"df"
|
691
690
|
]
|
692
691
|
},
|
@@ -1496,7 +1495,7 @@
|
|
1496
1495
|
" x=122.2186,\n",
|
1497
1496
|
" y=-18.0008,\n",
|
1498
1497
|
" time=pd.date_range(start=\"2018-01-01\", end=\"2018-01-02\", freq=\"5h\"),\n",
|
1499
|
-
" time_offset
|
1498
|
+
" time_offset=\"30 min\",\n",
|
1500
1499
|
" directory=directory,\n",
|
1501
1500
|
")"
|
1502
1501
|
]
|
@@ -109,8 +109,8 @@
|
|
109
109
|
],
|
110
110
|
"source": [
|
111
111
|
"import odc.stac\n",
|
112
|
-
"import pystac_client\n",
|
113
112
|
"import planetary_computer\n",
|
113
|
+
"import pystac_client\n",
|
114
114
|
"\n",
|
115
115
|
"# Connect to STAC catalog\n",
|
116
116
|
"catalog = pystac_client.Client.open(\n",
|
@@ -1031,7 +1031,7 @@
|
|
1031
1031
|
")\n",
|
1032
1032
|
"\n",
|
1033
1033
|
"# Plot the first four timesteps in our data\n",
|
1034
|
-
"tides_lowres.isel(time=[0, 1, 2, 3]).plot.imshow(col=\"time\", vmin=-3, vmax=3, cmap=\"RdBu\")
|
1034
|
+
"tides_lowres.isel(time=[0, 1, 2, 3]).plot.imshow(col=\"time\", vmin=-3, vmax=3, cmap=\"RdBu\")"
|
1035
1035
|
]
|
1036
1036
|
},
|
1037
1037
|
{
|
@@ -2071,14 +2071,14 @@
|
|
2071
2071
|
"import pandas as pd\n",
|
2072
2072
|
"\n",
|
2073
2073
|
"custom_times = pd.date_range(\n",
|
2074
|
-
" start=\"2022-01-01\"
|
2075
|
-
" end=\"2022-01-02\"
|
2074
|
+
" start=\"2022-01-01\",\n",
|
2075
|
+
" end=\"2022-01-02\",\n",
|
2076
2076
|
" freq=\"6h\",\n",
|
2077
2077
|
")\n",
|
2078
2078
|
"\n",
|
2079
2079
|
"# Model tides spatially\n",
|
2080
2080
|
"tides_highres = pixel_tides(\n",
|
2081
|
-
" data=ds
|
2081
|
+
" data=ds,\n",
|
2082
2082
|
" time=custom_times,\n",
|
2083
2083
|
" model=model,\n",
|
2084
2084
|
" directory=directory,\n",
|
@@ -701,8 +701,8 @@
|
|
701
701
|
],
|
702
702
|
"source": [
|
703
703
|
"import odc.stac\n",
|
704
|
-
"import pystac_client\n",
|
705
704
|
"import planetary_computer\n",
|
705
|
+
"import pystac_client\n",
|
706
706
|
"\n",
|
707
707
|
"# Connect to STAC catalog\n",
|
708
708
|
"catalog = pystac_client.Client.open(\n",
|
@@ -807,7 +807,7 @@
|
|
807
807
|
" data=ds_s2,\n",
|
808
808
|
" model=model,\n",
|
809
809
|
" directory=directory,\n",
|
810
|
-
")
|
810
|
+
")"
|
811
811
|
]
|
812
812
|
},
|
813
813
|
{
|
@@ -1603,7 +1603,7 @@
|
|
1603
1603
|
" data=ds_s1,\n",
|
1604
1604
|
" model=model,\n",
|
1605
1605
|
" directory=directory,\n",
|
1606
|
-
")
|
1606
|
+
")"
|
1607
1607
|
]
|
1608
1608
|
},
|
1609
1609
|
{
|
@@ -2411,7 +2411,7 @@
|
|
2411
2411
|
" plot_var=\"satellite_name\",\n",
|
2412
2412
|
" model=model,\n",
|
2413
2413
|
" directory=directory,\n",
|
2414
|
-
")
|
2414
|
+
")"
|
2415
2415
|
]
|
2416
2416
|
},
|
2417
2417
|
{
|
@@ -3110,7 +3110,7 @@
|
|
3110
3110
|
"import matplotlib.pyplot as plt\n",
|
3111
3111
|
"\n",
|
3112
3112
|
"stats_ds.spread.plot.imshow()\n",
|
3113
|
-
"plt.gca().set_title(\"Spread (%)\")
|
3113
|
+
"plt.gca().set_title(\"Spread (%)\");"
|
3114
3114
|
]
|
3115
3115
|
},
|
3116
3116
|
{
|
@@ -158,9 +158,10 @@
|
|
158
158
|
}
|
159
159
|
],
|
160
160
|
"source": [
|
161
|
-
"from eo_tides.model import model_tides\n",
|
162
161
|
"import pandas as pd\n",
|
163
162
|
"\n",
|
163
|
+
"from eo_tides.model import model_tides\n",
|
164
|
+
"\n",
|
164
165
|
"x, y = 122.2186, -18.0008\n",
|
165
166
|
"start_time = \"2018-01-01\"\n",
|
166
167
|
"end_time = \"2018-01-31\"\n",
|
@@ -58,7 +58,7 @@ def _standardise_inputs(
|
|
58
58
|
"""
|
59
59
|
|
60
60
|
# If `data` is an xarray object, extract its GeoBox and time
|
61
|
-
if isinstance(data,
|
61
|
+
if isinstance(data, xr.DataArray | xr.Dataset):
|
62
62
|
# Try to extract GeoBox
|
63
63
|
try:
|
64
64
|
gbox: GeoBox = data.odc.geobox
|
@@ -544,14 +544,13 @@ def pixel_tides(
|
|
544
544
|
# Reproject into original high resolution grid
|
545
545
|
if resample:
|
546
546
|
print("Reprojecting tides into original resolution")
|
547
|
-
|
547
|
+
return _pixel_tides_resample(
|
548
548
|
tides_lowres,
|
549
549
|
gbox,
|
550
550
|
resample_method,
|
551
551
|
dask_chunks,
|
552
552
|
dask_compute,
|
553
553
|
)
|
554
|
-
return tides_highres
|
555
554
|
|
556
555
|
print("Returning low resolution tide array")
|
557
556
|
return tides_lowres
|
@@ -55,10 +55,7 @@ def _parallel_splits(
|
|
55
55
|
raw_value = os.environ.get("CPU_GUARANTEE") or psutil.cpu_count(logical=False) or os.cpu_count() or 1
|
56
56
|
|
57
57
|
# Convert to integer
|
58
|
-
if isinstance(raw_value, str)
|
59
|
-
parallel_max = int(float(raw_value))
|
60
|
-
else:
|
61
|
-
parallel_max = int(raw_value)
|
58
|
+
parallel_max = int(float(raw_value)) if isinstance(raw_value, str) else int(raw_value)
|
62
59
|
|
63
60
|
# Calculate optimal number of splits based on constraints
|
64
61
|
splits_by_size = total_points / min_points_per_split
|
@@ -66,8 +63,7 @@ def _parallel_splits(
|
|
66
63
|
optimal_splits = min(splits_by_size, splits_by_cpu)
|
67
64
|
|
68
65
|
# Convert to integer and ensure at least 1 split
|
69
|
-
|
70
|
-
return final_split_count
|
66
|
+
return int(max(1, optimal_splits))
|
71
67
|
|
72
68
|
|
73
69
|
def _model_tides(
|
@@ -170,12 +166,7 @@ def _model_tides(
|
|
170
166
|
hc = amp * np.exp(cph)
|
171
167
|
|
172
168
|
# Compute delta times based on model
|
173
|
-
if pytmd_model.corrections in ("OTIS", "ATLAS", "TMD3", "netcdf")
|
174
|
-
# Use delta time at 2000.0 to match TMD outputs
|
175
|
-
deltat = np.zeros_like(ts.tt_ut1)
|
176
|
-
else:
|
177
|
-
# Use interpolated delta times
|
178
|
-
deltat = ts.tt_ut1
|
169
|
+
deltat = np.zeros_like(ts.tt_ut1) if pytmd_model.corrections in ("OTIS", "ATLAS", "TMD3", "netcdf") else ts.tt_ut1
|
179
170
|
|
180
171
|
# In "one-to-many" mode, extracted tidal constituents and timesteps
|
181
172
|
# are repeated/multiplied out to match the number of input points and
|
@@ -44,7 +44,7 @@ def _tide_statistics(obs_tides, all_tides, min_max_q=(0.0, 1.0), dim="time"):
|
|
44
44
|
offset_high = offset_high_m / tr
|
45
45
|
|
46
46
|
# Combine into a single dataset
|
47
|
-
|
47
|
+
return xr.merge(
|
48
48
|
[
|
49
49
|
mot.rename("mot"),
|
50
50
|
mat.rename("mat"),
|
@@ -61,8 +61,6 @@ def _tide_statistics(obs_tides, all_tides, min_max_q=(0.0, 1.0), dim="time"):
|
|
61
61
|
compat="override",
|
62
62
|
)
|
63
63
|
|
64
|
-
return stats_ds
|
65
|
-
|
66
64
|
|
67
65
|
def _stats_plain_english(mot, mat, hot, hat, lot, lat, otr, tr, spread, offset_low, offset_high):
|
68
66
|
# Plain text descriptors
|
@@ -568,7 +566,7 @@ def pixel_stats(
|
|
568
566
|
# Reproject statistics into original high resolution grid
|
569
567
|
if resample:
|
570
568
|
print("Reprojecting statistics into original resolution")
|
571
|
-
|
569
|
+
return _pixel_tides_resample(
|
572
570
|
stats_lowres,
|
573
571
|
gbox,
|
574
572
|
resample_method,
|
@@ -576,7 +574,6 @@ def pixel_stats(
|
|
576
574
|
dask_compute,
|
577
575
|
None,
|
578
576
|
)
|
579
|
-
return stats_highres
|
580
577
|
|
581
578
|
print("Returning low resolution statistics array")
|
582
579
|
return stats_lowres
|
@@ -7,7 +7,7 @@ import pathlib
|
|
7
7
|
import textwrap
|
8
8
|
import warnings
|
9
9
|
from collections import Counter
|
10
|
-
from typing import
|
10
|
+
from typing import TypeAlias
|
11
11
|
|
12
12
|
import numpy as np
|
13
13
|
import odc.geo
|
@@ -21,7 +21,7 @@ from scipy.spatial import cKDTree as KDTree
|
|
21
21
|
from tqdm import tqdm
|
22
22
|
|
23
23
|
# Type alias for all possible inputs to "time" params
|
24
|
-
DatetimeLike =
|
24
|
+
DatetimeLike: TypeAlias = np.ndarray | pd.DatetimeIndex | pd.Timestamp | datetime.datetime | str | list[str]
|
25
25
|
|
26
26
|
|
27
27
|
def _get_duplicates(array):
|
@@ -54,8 +54,7 @@ def _set_directory(
|
|
54
54
|
directory = pathlib.Path(directory).expanduser()
|
55
55
|
if not directory.exists():
|
56
56
|
raise FileNotFoundError(f"No valid tide model directory found at path `{directory}`")
|
57
|
-
|
58
|
-
return directory
|
57
|
+
return directory
|
59
58
|
|
60
59
|
|
61
60
|
def _standardise_time(
|
@@ -161,7 +160,7 @@ def _standardise_models(
|
|
161
160
|
raise ValueError(error_text)
|
162
161
|
|
163
162
|
# Return set of all ensemble plus any other requested models
|
164
|
-
models_to_process = sorted(
|
163
|
+
models_to_process = sorted(set(ensemble_models + [m for m in models_requested if m != "ensemble"]))
|
165
164
|
|
166
165
|
# Otherwise, models to process are the same as those requested
|
167
166
|
else:
|
@@ -271,7 +270,7 @@ def _clip_model_file(
|
|
271
270
|
for i in ["lat_z", "lat_v", "lat_u", "con"]:
|
272
271
|
try:
|
273
272
|
nc_clipped[i] = nc_clipped[i].isel(nx=0)
|
274
|
-
except:
|
273
|
+
except KeyError:
|
275
274
|
pass
|
276
275
|
|
277
276
|
return nc_clipped
|
@@ -558,8 +557,7 @@ def list_models(
|
|
558
557
|
|
559
558
|
if raise_error:
|
560
559
|
raise Exception(warning_msg)
|
561
|
-
|
562
|
-
warnings.warn(warning_msg, UserWarning)
|
560
|
+
warnings.warn(warning_msg, UserWarning)
|
563
561
|
|
564
562
|
# Return list of available and supported models
|
565
563
|
return available_models, supported_models
|
@@ -164,7 +164,7 @@ def _load_gesla_dataset(site, path, na_value):
|
|
164
164
|
)
|
165
165
|
|
166
166
|
# Combine two date fields
|
167
|
-
|
167
|
+
return (
|
168
168
|
gesla_df.assign(
|
169
169
|
time=pd.to_datetime(gesla_df["date"] + " " + gesla_df["time"]),
|
170
170
|
site_code=site,
|
@@ -173,8 +173,6 @@ def _load_gesla_dataset(site, path, na_value):
|
|
173
173
|
.set_index("time")
|
174
174
|
)
|
175
175
|
|
176
|
-
return gesla_df
|
177
|
-
|
178
176
|
|
179
177
|
def _nearest_row(gdf, x, y, max_distance=None):
|
180
178
|
# Create a point to find the nearest neighbor for
|
@@ -288,7 +286,7 @@ def load_gauge_gesla(
|
|
288
286
|
site_code = [site_code] if not isinstance(site_code, list) else site_code
|
289
287
|
|
290
288
|
# If x and y are tuples, use xy bounds to identify sites
|
291
|
-
elif isinstance(x,
|
289
|
+
elif isinstance(x, tuple | list) & isinstance(y, tuple | list):
|
292
290
|
bbox = BoundingBox.from_xy(x, y)
|
293
291
|
site_code = metadata_gdf.cx[bbox.left : bbox.right, bbox.top : bbox.bottom].index
|
294
292
|
|
@@ -317,7 +315,7 @@ def load_gauge_gesla(
|
|
317
315
|
# Prepare times
|
318
316
|
if time is None:
|
319
317
|
time = ["1800", str(datetime.datetime.now().year)]
|
320
|
-
time = [time] if not isinstance(time,
|
318
|
+
time = [time] if not isinstance(time, list | tuple) else time
|
321
319
|
start_time = _round_date_strings(time[0], round_type="start")
|
322
320
|
end_time = _round_date_strings(time[-1], round_type="end")
|
323
321
|
|
Binary file
|
@@ -27,9 +27,11 @@
|
|
27
27
|
"source": [
|
28
28
|
"import os\n",
|
29
29
|
"import platform\n",
|
30
|
-
"
|
31
|
-
"import pandas as pd\n",
|
30
|
+
"\n",
|
32
31
|
"import numpy as np\n",
|
32
|
+
"import pandas as pd\n",
|
33
|
+
"import psutil\n",
|
34
|
+
"\n",
|
33
35
|
"from eo_tides.model import model_tides"
|
34
36
|
]
|
35
37
|
},
|
@@ -36,7 +36,7 @@ classifiers = [
|
|
36
36
|
requires-python = ">=3.10,<4.0"
|
37
37
|
dependencies = [
|
38
38
|
"colorama>=0.4.3",
|
39
|
-
"dask[complete]>=2023.1.0
|
39
|
+
"dask[complete]>=2023.1.0",
|
40
40
|
"geopandas>=0.10.0",
|
41
41
|
"matplotlib>=3.8.0",
|
42
42
|
"numpy>=1.26.0",
|
@@ -107,18 +107,42 @@ allow_redefinition = true
|
|
107
107
|
testpaths = ["tests"]
|
108
108
|
|
109
109
|
[tool.ruff]
|
110
|
-
target-version = "py310"
|
111
|
-
line-length = 120
|
112
|
-
fix = true
|
113
|
-
|
114
|
-
|
115
|
-
|
110
|
+
target-version = "py310" # Target Python 3.10 syntax
|
111
|
+
line-length = 120 # Set max line length
|
112
|
+
fix = true # Allow auto-fix when used without pre-commit
|
113
|
+
lint.select = [
|
114
|
+
"I", # Import sorting
|
115
|
+
"W", # PyCodeStyle warnings
|
116
|
+
"F", # Pyflakes (unused vars, imports, etc.)
|
117
|
+
"E", # pycodestyle (spacing, etc.)
|
118
|
+
"UP", # Modern Python idioms
|
119
|
+
"B006", # Mutable default args
|
120
|
+
"B007", # Reusing loop variables
|
121
|
+
"C4", # Catch incorrect use of comprehensions, dict, list, etc
|
122
|
+
"FA", # Enforce from __future__ import annotations
|
123
|
+
"ISC", # Correct use of string concatenation
|
124
|
+
"ICN", # Common import conventions
|
125
|
+
"RET", # Good return practices
|
126
|
+
"SIM", # Common simplification rules
|
127
|
+
"TID", # Some good import practices
|
128
|
+
"PTH", # Use pathlib instead of os.path
|
129
|
+
"NPY", # Some numpy-specific things
|
130
|
+
]
|
131
|
+
lint.ignore = [
|
132
|
+
"E501", # Don't enforce line length
|
133
|
+
"SIM105", # contextlib.suppress
|
134
|
+
]
|
135
|
+
exclude = ["tests/testing.ipynb"] # Don't modify testing notebook
|
116
136
|
|
117
137
|
[tool.ruff.lint.per-file-ignores]
|
118
138
|
"tests/*" = [
|
119
|
-
|
139
|
+
"S101", # Allow `assert` in test files
|
140
|
+
"NPY002" # Allow legacy numpy random generation
|
120
141
|
]
|
121
142
|
|
143
|
+
[tool.ruff.format]
|
144
|
+
preview = true # Enable experimental formatting improvements
|
145
|
+
|
122
146
|
[tool.deptry.per_rule_ignores]
|
123
147
|
DEP002 = [
|
124
148
|
"folium",
|