eo-tides 0.6.3.dev5__tar.gz → 0.6.3.dev7__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 (77) hide show
  1. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.gitignore +1 -0
  2. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/PKG-INFO +1 -1
  3. eo_tides-0.6.3.dev7/docs/install.md +136 -0
  4. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/eo_tides/model.py +8 -1
  5. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/pyproject.toml +1 -1
  6. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/test_model.py +25 -1
  7. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/testing.ipynb +89 -104
  8. eo_tides-0.6.3.dev5/docs/install.md +0 -49
  9. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.editorconfig +0 -0
  10. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  11. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  12. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.github/actions/setup-python-env/action.yml +0 -0
  13. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.github/workflows/check-links.yml +0 -0
  14. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.github/workflows/main.yml +0 -0
  15. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.github/workflows/on-release-main.yml +0 -0
  16. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.github/workflows/paper.yml +0 -0
  17. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/.pre-commit-config.yaml +0 -0
  18. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/CITATION.cff +0 -0
  19. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/CONTRIBUTING.md +0 -0
  20. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/Dockerfile +0 -0
  21. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/LICENSE +0 -0
  22. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/Makefile +0 -0
  23. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/README.md +0 -0
  24. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/codecov.yaml +0 -0
  25. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/api.md +0 -0
  26. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/dtu23_download.jpg +0 -0
  27. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/eo-tides-abstract.gif +0 -0
  28. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/eo-tides-logo-128.png +0 -0
  29. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/eo-tides-logo-256.png +0 -0
  30. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/eo-tides-logo.gif +0 -0
  31. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/eo-tides-logo.png +0 -0
  32. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/eot20_download.jpg +0 -0
  33. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/fes_ftp.jpg +0 -0
  34. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/fes_myproducts.jpg +0 -0
  35. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/fes_productselection.jpg +0 -0
  36. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/fes_subscriptions.jpg +0 -0
  37. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/got_download.jpg +0 -0
  38. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/tide_models_clipped.jpg +0 -0
  39. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/assets/tpxo_download.jpg +0 -0
  40. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/changelog.md +0 -0
  41. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/credits.md +0 -0
  42. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/index.md +0 -0
  43. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/migration.md +0 -0
  44. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/notebooks/Case_study_intertidal.ipynb +0 -0
  45. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/notebooks/Model_tides.ipynb +0 -0
  46. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/notebooks/Satellite_data.ipynb +0 -0
  47. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/notebooks/Tide_statistics.ipynb +0 -0
  48. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/notebooks/Validating_tides.ipynb +0 -0
  49. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/setup.md +0 -0
  50. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/docs/stylesheets/extra.css +0 -0
  51. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/eo_tides/__init__.py +0 -0
  52. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/eo_tides/eo.py +0 -0
  53. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/eo_tides/stats.py +0 -0
  54. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/eo_tides/utils.py +0 -0
  55. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/eo_tides/validation.py +0 -0
  56. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/mkdocs.yml +0 -0
  57. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/benchmarking.ipynb +0 -0
  58. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/figures/joss_abstract.png +0 -0
  59. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/figures/joss_fig_gesla.png +0 -0
  60. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/figures/joss_fig_list.png +0 -0
  61. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/figures/joss_fig_pixel.png +0 -0
  62. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/figures/joss_fig_stats.png +0 -0
  63. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/paper.bib +0 -0
  64. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/paper.md +0 -0
  65. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/paper/paper.pdf +0 -0
  66. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/conftest.py +0 -0
  67. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/data/GESLA3_ALL 2.csv +0 -0
  68. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/data/IDO71013_2020.csv +0 -0
  69. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/data/broome-62650-aus-bom +0 -0
  70. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/data/san_diego_ca-569a-usa-uhslc +0 -0
  71. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/data/sydney_fort_denison-60370-aus-bom +0 -0
  72. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/data/tide_models.tar.gz +0 -0
  73. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/test_eo.py +0 -0
  74. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/test_stats.py +0 -0
  75. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/test_utils.py +0 -0
  76. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/tests/test_validation.py +0 -0
  77. {eo_tides-0.6.3.dev5 → eo_tides-0.6.3.dev7}/uv.lock +0 -0
@@ -1,6 +1,7 @@
1
1
  # Ignore project-specific directories
2
2
  tests/data/tide_models
3
3
  tests/data/tide_models_clipped
4
+ tests/data/tide_models_synthetic
4
5
  docs/source
5
6
 
6
7
  # From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eo-tides
3
- Version: 0.6.3.dev5
3
+ Version: 0.6.3.dev7
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
@@ -0,0 +1,136 @@
1
+ # Installing `eo-tides`
2
+
3
+ ## Stable version
4
+
5
+ The latest stable release of `eo-tides` is:
6
+
7
+ [![PyPI](https://img.shields.io/pypi/v/eo-tides)](https://pypi.org/project/eo-tides/)
8
+
9
+ It is compatible with the following Python versions:
10
+
11
+ [![Python Version from PEP 621 TOML](https://img.shields.io/pypi/pyversions/eo-tides)](https://github.com/GeoscienceAustralia/eo-tides/blob/main/pyproject.toml)
12
+
13
+ `eo-tides` can be installed into your Python environment using either `pip` (the standard Python package manager), or `uv` ([a fast Python package manager](https://docs.astral.sh/uv/) written in Rust).
14
+
15
+ !!! tip
16
+
17
+ We recommend installing with `uv` as this makes it easy to set up an isolated environment containing compatible Python packages.
18
+
19
+ === "Installing with `pip`"
20
+
21
+ Install `eo-tides` with essential package dependencies only:
22
+ ```console
23
+ python3 -m pip install eo-tides
24
+ ```
25
+
26
+ To install [additional package dependencies](https://github.com/GeoscienceAustralia/eo-tides/blob/main/pyproject.toml#L62-L69) required for running the included Jupyter Notebook examples (including `odc-stac` and `pystac-client` for loading freely available satellite data), run:
27
+
28
+ ```console
29
+ python3 -m pip install eo-tides[notebooks]
30
+ ```
31
+
32
+ === "Installing with `uv`"
33
+
34
+ First, [install `uv` using the method of your choice](https://docs.astral.sh/uv/getting-started/installation/). Then:
35
+
36
+ Create a new virtual environment:
37
+ ```console
38
+ uv venv
39
+ ```
40
+
41
+ Activate your virtual environment:
42
+ ```console
43
+ source .venv/bin/activate
44
+ ```
45
+
46
+ Install `eo-tides` into your virtual environment, with essential package dependencies only:
47
+ ```console
48
+ uv pip install eo-tides
49
+ ```
50
+
51
+ To install [additional package dependencies](https://github.com/GeoscienceAustralia/eo-tides/blob/main/pyproject.toml#L62-L69) required for running the included Jupyter Notebook examples (including `odc-stac` and `pystac-client` for loading freely available satellite data), run:
52
+
53
+ ```console
54
+ uv pip install eo-tides[notebooks]
55
+ ```
56
+
57
+ ## Unstable development pre-releases
58
+
59
+ Unstable development pre-releases of `eo-tides` are also available:
60
+
61
+ [![PyPI](https://img.shields.io/badge/pypi-releases-f48041)](https://pypi.org/project/eo-tides/#history)
62
+
63
+ === "Installing with `pip`"
64
+
65
+ Install an example `eo-tides` pre-release (see [full list here](https://pypi.org/project/eo-tides/#history)):
66
+ ```console
67
+ python3 -m pip install eo-tides==0.6.3.dev5
68
+ ```
69
+
70
+ === "Installing with `uv`"
71
+
72
+ First, [install `uv` using the method of your choice](https://docs.astral.sh/uv/getting-started/installation/). Then:
73
+
74
+ Create a new virtual environment:
75
+ ```console
76
+ uv venv
77
+ ```
78
+
79
+ Activate your virtual environment:
80
+ ```console
81
+ source .venv/bin/activate
82
+ ```
83
+
84
+ Install an example `eo-tides` pre-release (see [full list here](https://pypi.org/project/eo-tides/#history)):
85
+ ```console
86
+ uv pip install eo-tides==0.6.3.dev5
87
+ ```
88
+
89
+ !!! important
90
+
91
+ Unstable development pre-releases may contain bugs and untested new features. Unless you need access to a specific unpublished feature, we recommend installing the latest stable version instead.
92
+
93
+ ### Advanced: Developing locally
94
+
95
+ To work on `eo-tides` locally, we recommend using `uv`.
96
+
97
+ First, [install `uv` using the method of your choice](https://docs.astral.sh/uv/getting-started/installation/).
98
+
99
+ Clone the `eo-tides` repository:
100
+
101
+ ```console
102
+ git clone https://github.com/GeoscienceAustralia/eo-tides
103
+ cd eo-tides/
104
+ ```
105
+
106
+ Use `uv sync` to populate an environment with package dependencies from the `eo-tides` [lockfile](https://github.com/GeoscienceAustralia/eo-tides/blob/main/uv.lock):
107
+
108
+ ```console
109
+ uv sync --all-extras
110
+ ```
111
+
112
+ Set up pre-commit hooks:
113
+
114
+ ```console
115
+ uv run pre-commit install
116
+ ```
117
+
118
+ We provide a [pre-prepared Makefile](https://github.com/GeoscienceAustralia/eo-tides/blob/main/Makefile) that you can use to easily run common tasks:
119
+
120
+ ```console
121
+ # Run code quality checks
122
+ make check
123
+
124
+ # Run pytest tests
125
+ make test
126
+
127
+ # Run Jupyter notebook tests
128
+ make test-notebooks
129
+
130
+ # Build and preview documentation
131
+ make docs
132
+ ```
133
+
134
+ ## Next steps
135
+
136
+ Once you have installed `eo-tides`, you will need to [download and set up at least one tide model](setup.md) before you can model tides.
@@ -330,6 +330,9 @@ def ensemble_tides(
330
330
  x = tide_df.index.get_level_values(level="x")
331
331
  y = tide_df.index.get_level_values(level="y")
332
332
 
333
+ # Identify input datatype
334
+ input_dtype = tide_df.tide_height.dtype
335
+
333
336
  # Load model ranks points and reproject to same CRS as x and y
334
337
  model_ranking_cols = [f"rank_{m}" for m in ensemble_models]
335
338
  try:
@@ -373,6 +376,7 @@ def ensemble_tides(
373
376
  .set_index(["tide_model", "x", "y"])
374
377
  .groupby(["x", "y"])
375
378
  .rank()
379
+ .astype("float32") # use smaller dtype for rankings to save memory
376
380
  )
377
381
 
378
382
  # If no custom ensemble funcs are provided, use a default ensemble
@@ -404,9 +408,12 @@ def ensemble_tides(
404
408
 
405
409
  # Use weightings to combine multiple models into single ensemble
406
410
  ensemble_df = (
407
- # Calculate weighted mean and convert back to dataframe
411
+ # Calculate weighted mean
408
412
  grouped.weighted.sum()
409
413
  .div(grouped.weights.sum())
414
+ # Make sure datatype is the same as the input
415
+ .astype(input_dtype)
416
+ # Convert to dataframe
410
417
  .to_frame("tide_height")
411
418
  # Label ensemble model and ensure indexes are in expected order
412
419
  .assign(tide_model=ensemble_n)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "eo-tides"
3
- version = "0.6.3.dev5"
3
+ version = "0.6.3.dev7"
4
4
  description = "Tide modelling tools for large-scale satellite earth observation analysis"
5
5
  authors = [
6
6
  { name = "Robbi Bishop-Taylor" },
@@ -3,7 +3,7 @@ import pandas as pd
3
3
  import pytest
4
4
  from pyTMD.compute import tide_elevations
5
5
 
6
- from eo_tides.model import _parallel_splits, _set_directory, model_phases, model_tides
6
+ from eo_tides.model import _parallel_splits, _set_directory, ensemble_tides, model_phases, model_tides
7
7
  from eo_tides.validation import eval_metrics
8
8
 
9
9
  GAUGE_X = 122.2183
@@ -432,6 +432,30 @@ def test_model_tides_ensemble():
432
432
  ])
433
433
 
434
434
 
435
+ # Test ensemble dtype is set correctly
436
+ @pytest.mark.parametrize(
437
+ "dtype",
438
+ ["float32", "float64", "int16"],
439
+ )
440
+ def test_model_tides_ensemble_dtype(dtype):
441
+ # Create dummy modelled tide data with specific dtype
442
+ modelled_tides_df = pd.DataFrame({
443
+ "time": pd.date_range(start="2000-01-01", periods=5, freq="5h").repeat(2),
444
+ "x": 122.2183,
445
+ "y": -18.0008,
446
+ "tide_model": ["EOT20", "HAMTIDE11"] * 5,
447
+ "tide_height": np.random.uniform(-4, 3, 10).astype(dtype),
448
+ })
449
+ modelled_tides_df = modelled_tides_df.set_index(["time", "x", "y"])
450
+
451
+ # Run ensemble modelling on modelled tides input
452
+ ensemble_df = ensemble_tides(modelled_tides_df, ensemble_models=ENSEMBLE_MODELS, crs="EPSG:4326")
453
+
454
+ # Verify that output tides match are as expected, and match the iput data
455
+ assert ensemble_df.tide_height.dtype == dtype
456
+ assert ensemble_df.tide_height.dtype == modelled_tides_df.tide_height.dtype
457
+
458
+
435
459
  @pytest.mark.parametrize("time_offset", ["15 min", "20 min"])
436
460
  def test_model_phases(time_offset):
437
461
  phase_df = model_phases(
@@ -21,7 +21,7 @@
21
21
  },
22
22
  {
23
23
  "cell_type": "code",
24
- "execution_count": 1,
24
+ "execution_count": null,
25
25
  "metadata": {},
26
26
  "outputs": [],
27
27
  "source": [
@@ -44,6 +44,15 @@
44
44
  "ENSEMBLE_MODELS = [\"EOT20\", \"HAMTIDE11\"] # simplified for tests"
45
45
  ]
46
46
  },
47
+ {
48
+ "cell_type": "code",
49
+ "execution_count": null,
50
+ "metadata": {},
51
+ "outputs": [],
52
+ "source": [
53
+ "cd .."
54
+ ]
55
+ },
47
56
  {
48
57
  "cell_type": "markdown",
49
58
  "metadata": {},
@@ -53,7 +62,7 @@
53
62
  },
54
63
  {
55
64
  "cell_type": "code",
56
- "execution_count": 2,
65
+ "execution_count": null,
57
66
  "metadata": {},
58
67
  "outputs": [],
59
68
  "source": [
@@ -108,7 +117,7 @@
108
117
  "\n",
109
118
  " # Load measured tides from ABSLMP tide gauge data\n",
110
119
  " measured_tides_df = pd.read_csv(\n",
111
- " \"../tests/data/IDO71013_2020.csv\",\n",
120
+ " \"tests/data/IDO71013_2020.csv\",\n",
112
121
  " index_col=0,\n",
113
122
  " parse_dates=True,\n",
114
123
  " na_values=-9999,\n",
@@ -220,23 +229,6 @@
220
229
  "create_synthetic_hamtide11()"
221
230
  ]
222
231
  },
223
- {
224
- "cell_type": "code",
225
- "execution_count": 2,
226
- "metadata": {},
227
- "outputs": [
228
- {
229
- "name": "stdout",
230
- "output_type": "stream",
231
- "text": [
232
- "/home/jovyan/Robbi/eo-tides\n"
233
- ]
234
- }
235
- ],
236
- "source": [
237
- "cd .."
238
- ]
239
- },
240
232
  {
241
233
  "cell_type": "markdown",
242
234
  "metadata": {},
@@ -250,7 +242,7 @@
250
242
  "metadata": {},
251
243
  "outputs": [],
252
244
  "source": [
253
- "!export EO_TIDES_TIDE_MODELS=./tests/data/tide_models && pytest tests/test_model.py --verbose -k test_model_tides_ensemble"
245
+ "!export EO_TIDES_TIDE_MODELS=./tests/data/tide_models && pytest tests/test_model.py --verbose -k test_model_tides_ensemble_dtype"
254
246
  ]
255
247
  },
256
248
  {
@@ -282,53 +274,81 @@
282
274
  },
283
275
  {
284
276
  "cell_type": "code",
285
- "execution_count": 5,
286
- "metadata": {},
287
- "outputs": [
288
- {
289
- "name": "stdout",
290
- "output_type": "stream",
291
- "text": [
292
- "\u001b[1m============================= test session starts ==============================\u001b[0m\n",
293
- "platform linux -- Python 3.10.15, pytest-8.3.3, pluggy-1.5.0 -- /env/bin/python3.10\n",
294
- "cachedir: .pytest_cache\n",
295
- "rootdir: /home/jovyan/Robbi/eo-tides\n",
296
- "configfile: pyproject.toml\n",
297
- "plugins: anyio-4.6.2.post1, nbval-0.11.0\n",
298
- "collected 29 items / 20 deselected / 9 selected \u001b[0m\u001b[1m\n",
299
- "\n",
300
- "tests/test_utils.py::test_clip_models \u001b[32mPASSED\u001b[0m\u001b[33m [ 11%]\u001b[0m\n",
301
- "tests/test_utils.py::test_clip_models_bbox[EOT20-bbox0-point0-hawaii] \u001b[32mPASSED\u001b[0m\u001b[33m [ 22%]\u001b[0m\n",
302
- "tests/test_utils.py::test_clip_models_bbox[EOT20-bbox1-point1-uk] \u001b[32mPASSED\u001b[0m\u001b[33m [ 33%]\u001b[0m\n",
303
- "tests/test_utils.py::test_clip_models_bbox[EOT20-bbox2-point2-aus] \u001b[32mPASSED\u001b[0m\u001b[33m [ 44%]\u001b[0m\n",
304
- "tests/test_utils.py::test_clip_models_bbox[EOT20-bbox3-point3-pacific] \u001b[32mPASSED\u001b[0m\u001b[33m [ 55%]\u001b[0m\n",
305
- "tests/test_utils.py::test_clip_models_bbox[HAMTIDE11-bbox4-point4-hawaii] \u001b[32mPASSED\u001b[0m\u001b[33m [ 66%]\u001b[0m\n",
306
- "tests/test_utils.py::test_clip_models_bbox[HAMTIDE11-bbox5-point5-uk] \u001b[32mPASSED\u001b[0m\u001b[33m [ 77%]\u001b[0m\n",
307
- "tests/test_utils.py::test_clip_models_bbox[HAMTIDE11-bbox6-point6-aus] \u001b[32mPASSED\u001b[0m\u001b[33m [ 88%]\u001b[0m\n",
308
- "tests/test_utils.py::test_clip_models_bbox[HAMTIDE11-bbox7-point7-pacific] \u001b[32mPASSED\u001b[0m\u001b[33m [100%]\u001b[0m\n",
309
- "\n",
310
- "\u001b[33m=============================== warnings summary ===============================\u001b[0m\n",
311
- "<frozen importlib._bootstrap>:241\n",
312
- " <frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject\n",
313
- "\n",
314
- "tests/test_utils.py: 36 warnings\n",
315
- " /env/lib/python3.10/site-packages/pyproj/transformer.py:817: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)\n",
316
- " return self._transformer._transform_point(\n",
317
- "\n",
318
- "tests/test_utils.py::test_clip_models_bbox[EOT20-bbox0-point0-hawaii]\n",
319
- "tests/test_utils.py::test_clip_models_bbox[HAMTIDE11-bbox4-point4-hawaii]\n",
320
- " /home/jovyan/Robbi/eo-tides/eo_tides/model.py:125: UserWarning: On-the-fly cropping is not compatible with the provided clipped model files; running with `crop=False`.\n",
321
- " warnings.warn(\n",
322
- "\n",
323
- "-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html\n",
324
- "\u001b[33m=========== \u001b[32m9 passed\u001b[0m, \u001b[33m\u001b[1m20 deselected\u001b[0m, \u001b[33m\u001b[1m39 warnings\u001b[0m\u001b[33m in 74.74s (0:01:14)\u001b[0m\u001b[33m ===========\u001b[0m\n"
325
- ]
326
- }
327
- ],
277
+ "execution_count": null,
278
+ "metadata": {},
279
+ "outputs": [],
328
280
  "source": [
329
281
  "!export EO_TIDES_TIDE_MODELS=./tests/data/tide_models && pytest tests/test_utils.py --verbose -k test_clip_models"
330
282
  ]
331
283
  },
284
+ {
285
+ "cell_type": "markdown",
286
+ "metadata": {},
287
+ "source": [
288
+ "## Ensemble dtype"
289
+ ]
290
+ },
291
+ {
292
+ "cell_type": "code",
293
+ "execution_count": null,
294
+ "metadata": {},
295
+ "outputs": [],
296
+ "source": [
297
+ "from eo_tides.model import model_tides\n",
298
+ "from eo_tides.model import ensemble_tides\n",
299
+ "\n",
300
+ "# Set modelling location based on bbox centroid\n",
301
+ "time = pd.date_range(start=\"2000-01\", end=\"2001-03\", freq=\"5h\")\n",
302
+ "\n",
303
+ "# Model using unclipped vs clipped files\n",
304
+ "tide_df = model_tides(\n",
305
+ " x=GAUGE_X,\n",
306
+ " y=GAUGE_Y,\n",
307
+ " time=time,\n",
308
+ " model=\"all\",\n",
309
+ " directory=\"./tests/data/tide_models\",\n",
310
+ ")\n",
311
+ "\n",
312
+ "# tide_df[\"tide_height\"] = tide_df.tide_height.astype(\"float64\")\n",
313
+ "# ensemble_df = ensemble_tides(tide_df, ensemble_models=[\"EOT20\", \"HAMTIDE11\"], crs=\"EPSG:4326\")\n",
314
+ "\n",
315
+ "# print(ensemble_df)\n",
316
+ "# print(ensemble_df.dtypes)"
317
+ ]
318
+ },
319
+ {
320
+ "cell_type": "code",
321
+ "execution_count": null,
322
+ "metadata": {},
323
+ "outputs": [],
324
+ "source": [
325
+ "print(tide_df)"
326
+ ]
327
+ },
328
+ {
329
+ "cell_type": "code",
330
+ "execution_count": null,
331
+ "metadata": {},
332
+ "outputs": [],
333
+ "source": [
334
+ "import pandas as pd\n",
335
+ "import numpy as np\n",
336
+ "\n",
337
+ "# Create data with a cross product approach\n",
338
+ "data = pd.DataFrame({\n",
339
+ " 'time': pd.date_range(start='2000-01-01', periods=5, freq='5h').repeat(2),\n",
340
+ " 'x': 122.2183,\n",
341
+ " 'y': -18.0008,\n",
342
+ " 'tide_model': ['EOT20', 'HAMTIDE11'] * 5,\n",
343
+ " 'tide_height': np.random.uniform(-4, 3, 10).astype(\"float32\")\n",
344
+ "})\n",
345
+ "\n",
346
+ "# Set multi-index\n",
347
+ "data = data.set_index(['time', 'x', 'y'])\n",
348
+ "\n",
349
+ "print(data)"
350
+ ]
351
+ },
332
352
  {
333
353
  "cell_type": "markdown",
334
354
  "metadata": {},
@@ -338,44 +358,9 @@
338
358
  },
339
359
  {
340
360
  "cell_type": "code",
341
- "execution_count": 4,
342
- "metadata": {},
343
- "outputs": [
344
- {
345
- "name": "stdout",
346
- "output_type": "stream",
347
- "text": [
348
- "Preparing to clip suitable NetCDF models: ['HAMTIDE11']\n",
349
- "\n"
350
- ]
351
- },
352
- {
353
- "name": "stderr",
354
- "output_type": "stream",
355
- "text": [
356
- "Clipping HAMTIDE11: 100%|██████████| 9/9 [00:00<00:00, 16.72it/s]\n"
357
- ]
358
- },
359
- {
360
- "name": "stdout",
361
- "output_type": "stream",
362
- "text": [
363
- " ✅ Clipped model exported and verified\n",
364
- "\n",
365
- "Outputs exported to tests/data/tide_models_synthetic_aus\n",
366
- "────────────────────────────────────────────────────────────────────────────────\n",
367
- " 󠀠🌊 | Model | Expected path \n",
368
- "────────────────────────────────────────────────────────────────────────────────\n",
369
- " ✅ │ HAMTIDE11 │ tests/data/tide_models_synthetic_aus/hamtide \n",
370
- "────────────────────────────────────────────────────────────────────────────────\n",
371
- "\n",
372
- "Summary:\n",
373
- "Available models: 1/52\n",
374
- "Modelling tides with HAMTIDE11\n",
375
- "Modelling tides with HAMTIDE11\n"
376
- ]
377
- }
378
- ],
361
+ "execution_count": null,
362
+ "metadata": {},
363
+ "outputs": [],
379
364
  "source": [
380
365
  "from eo_tides.utils import clip_models\n",
381
366
  "from eo_tides.model import model_tides\n",
@@ -2777,7 +2762,7 @@
2777
2762
  ],
2778
2763
  "metadata": {
2779
2764
  "kernelspec": {
2780
- "display_name": "Python 3 (ipykernel)",
2765
+ "display_name": ".venv",
2781
2766
  "language": "python",
2782
2767
  "name": "python3"
2783
2768
  },
@@ -2791,7 +2776,7 @@
2791
2776
  "name": "python",
2792
2777
  "nbconvert_exporter": "python",
2793
2778
  "pygments_lexer": "ipython3",
2794
- "version": "3.10.15"
2779
+ "version": "3.12.0"
2795
2780
  }
2796
2781
  },
2797
2782
  "nbformat": 4,
@@ -1,49 +0,0 @@
1
- # Installing `eo-tides`
2
-
3
- ## Stable version
4
-
5
- [![Release](https://img.shields.io/github/v/release/GeoscienceAustralia/eo-tides)](https://pypi.org/project/eo-tides/)
6
- [![Python Version from PEP 621 TOML](https://img.shields.io/pypi/pyversions/eo-tides)](https://github.com/GeoscienceAustralia/eo-tides/blob/main/pyproject.toml)
7
-
8
- The [latest stable release](https://pypi.org/project/eo-tides/) of `eo-tides` can be installed into your Python environment from [PyPI](https://pypi.org/project/eo-tides/) using `pip`:
9
-
10
- ```console
11
- python3 -m pip install eo-tides
12
- ```
13
-
14
- By default, only essential package dependencies are installed. To install all packages required for running the included Jupyter Notebook examples (including `odc-stac` and `pystac-client` for loading freely available satellite data), run:
15
-
16
- ```console
17
- python3 -m pip install eo-tides[notebooks]
18
- ```
19
-
20
- ## Unstable development version
21
-
22
- To install the latest unstable development version of `eo-tides` directly from Github, run:
23
-
24
- ```console
25
- python3 -m pip install git+https://github.com/GeoscienceAustralia/eo-tides.git
26
- ```
27
-
28
- !!! important
29
-
30
- Unstable development versions of `eo-tides` may contain bugs and untested new features. Unless you need access to a specific unpublished feature, we recommend installing the latest stable version instead.
31
-
32
- ### Cloning locally
33
-
34
- To clone the `eo-tides` repository locally:
35
-
36
- ```console
37
- git clone https://github.com/GeoscienceAustralia/eo-tides.git
38
- ```
39
-
40
- Navigate to the project directory and install in editable mode from your local copy of the repository:
41
-
42
- ```console
43
- cd eo-tides
44
- python3 -m pip install -e .
45
- ```
46
-
47
- ## Next steps
48
-
49
- Once you have installed `eo-tides`, you will need to [download and set up at least one tide model](setup.md) before you can model tides.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes