forcingkit 0.17.0__tar.gz → 0.17.1__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 (143) hide show
  1. {forcingkit-0.17.0 → forcingkit-0.17.1}/PKG-INFO +1 -1
  2. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/conf.py +1 -1
  3. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/fetchers.rst +2 -1
  4. {forcingkit-0.17.0 → forcingkit-0.17.1}/pyproject.toml +1 -1
  5. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/noaa.py +10 -3
  6. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_noaa_currents.py +25 -0
  7. {forcingkit-0.17.0 → forcingkit-0.17.1}/uv.lock +1 -1
  8. {forcingkit-0.17.0 → forcingkit-0.17.1}/.agents/forcingkit.md +0 -0
  9. {forcingkit-0.17.0 → forcingkit-0.17.1}/.claude/CLAUDE.md +0 -0
  10. {forcingkit-0.17.0 → forcingkit-0.17.1}/.env.template +0 -0
  11. {forcingkit-0.17.0 → forcingkit-0.17.1}/.github/copilot-instructions.md +0 -0
  12. {forcingkit-0.17.0 → forcingkit-0.17.1}/.github/workflows/docs.yml +0 -0
  13. {forcingkit-0.17.0 → forcingkit-0.17.1}/.github/workflows/publish-client.yml +0 -0
  14. {forcingkit-0.17.0 → forcingkit-0.17.1}/.github/workflows/publish.yml +0 -0
  15. {forcingkit-0.17.0 → forcingkit-0.17.1}/.github/workflows/tests.yml +0 -0
  16. {forcingkit-0.17.0 → forcingkit-0.17.1}/.gitignore +0 -0
  17. {forcingkit-0.17.0 → forcingkit-0.17.1}/.markdownlint.yaml +0 -0
  18. {forcingkit-0.17.0 → forcingkit-0.17.1}/.pre-commit-config.yaml +0 -0
  19. {forcingkit-0.17.0 → forcingkit-0.17.1}/.python-version +0 -0
  20. {forcingkit-0.17.0 → forcingkit-0.17.1}/AGENTS.md +0 -0
  21. {forcingkit-0.17.0 → forcingkit-0.17.1}/CONTRIBUTING.md +0 -0
  22. {forcingkit-0.17.0 → forcingkit-0.17.1}/Dockerfile +0 -0
  23. {forcingkit-0.17.0 → forcingkit-0.17.1}/LICENSE +0 -0
  24. {forcingkit-0.17.0 → forcingkit-0.17.1}/README.md +0 -0
  25. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/LICENSE +0 -0
  26. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/README.md +0 -0
  27. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/pyproject.toml +0 -0
  28. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/src/forcingkit_client/__init__.py +0 -0
  29. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/src/forcingkit_client/client.py +0 -0
  30. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/src/forcingkit_client/schema.py +0 -0
  31. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/src/forcingkit_client/store.py +0 -0
  32. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/src/forcingkit_client/trajectory.py +0 -0
  33. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/tests/conftest.py +0 -0
  34. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/tests/test_client.py +0 -0
  35. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/tests/test_schema.py +0 -0
  36. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/tests/test_trajectory.py +0 -0
  37. {forcingkit-0.17.0 → forcingkit-0.17.1}/client/uv.lock +0 -0
  38. {forcingkit-0.17.0 → forcingkit-0.17.1}/docker-compose.yml +0 -0
  39. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/Makefile +0 -0
  40. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/make.bat +0 -0
  41. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/requirements-docs.txt +0 -0
  42. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/_extra/CNAME +0 -0
  43. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/_static/custom.css +0 -0
  44. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/_static/forcingkit-noreaster-wind.gif +0 -0
  45. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/atmospheric_forcing.rst +0 -0
  46. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/client.rst +0 -0
  47. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/hycom.rst +0 -0
  48. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/index.rst +0 -0
  49. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/layered_mesh.rst +0 -0
  50. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/mesh_frames.rst +0 -0
  51. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/necofs.rst +0 -0
  52. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/nyofs.rst +0 -0
  53. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/rivers.rst +0 -0
  54. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/roadmap.rst +0 -0
  55. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/sources.rst +0 -0
  56. {forcingkit-0.17.0 → forcingkit-0.17.1}/docs/source/waves.rst +0 -0
  57. {forcingkit-0.17.0 → forcingkit-0.17.1}/main.py +0 -0
  58. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/__init__.py +0 -0
  59. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/__init__.py +0 -0
  60. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/jobs.py +0 -0
  61. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/main.py +0 -0
  62. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/routers/bathymetry.py +0 -0
  63. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/routers/plotly_api.py +0 -0
  64. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/routers/removed.py +0 -0
  65. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/routers/stores.py +0 -0
  66. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/routers/viewer.py +0 -0
  67. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/forcingkit_serve/stac.py +0 -0
  68. {forcingkit-0.17.0 → forcingkit-0.17.1}/service/run_server.py +0 -0
  69. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/__init__.py +0 -0
  70. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/data/rivers/northeast_us.json +0 -0
  71. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/dispatcher.py +0 -0
  72. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/coastwatch.py +0 -0
  73. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/dbofs.py +0 -0
  74. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/erddap.py +0 -0
  75. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/hrrr.py +0 -0
  76. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/hrrr_atmosphere.py +0 -0
  77. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/hrrr_levels.py +0 -0
  78. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/hrrr_points.py +0 -0
  79. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/hycom.py +0 -0
  80. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/hydrography.py +0 -0
  81. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/ndbc.py +0 -0
  82. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/necofs.py +0 -0
  83. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/nwps.py +0 -0
  84. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/nyofs.py +0 -0
  85. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/usgs.py +0 -0
  86. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/fetchers/usgs_rivers.py +0 -0
  87. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/layered_mesh.py +0 -0
  88. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/mesh_frames.py +0 -0
  89. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/ramps/currents_lis.csv +0 -0
  90. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/ramps/currents_lis_dark.csv +0 -0
  91. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/ramps/currents_lis_deep.csv +0 -0
  92. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/ramps/currents_lis_haline.csv +0 -0
  93. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/render.py +0 -0
  94. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/settings.py +0 -0
  95. {forcingkit-0.17.0 → forcingkit-0.17.1}/src/forcingkit/zarr_stream.py +0 -0
  96. {forcingkit-0.17.0 → forcingkit-0.17.1}/static/app.js +0 -0
  97. {forcingkit-0.17.0 → forcingkit-0.17.1}/static/favicon.ico +0 -0
  98. {forcingkit-0.17.0 → forcingkit-0.17.1}/static/favicon.svg +0 -0
  99. {forcingkit-0.17.0 → forcingkit-0.17.1}/static/index.html +0 -0
  100. {forcingkit-0.17.0 → forcingkit-0.17.1}/static/logo.svg +0 -0
  101. {forcingkit-0.17.0 → forcingkit-0.17.1}/static/preview3d.js +0 -0
  102. {forcingkit-0.17.0 → forcingkit-0.17.1}/static/styles.css +0 -0
  103. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/__init__.py +0 -0
  104. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_auth.py +0 -0
  105. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_erddap_fetch.py +0 -0
  106. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_mesh_frames_necofs.py +0 -0
  107. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_necofs_volume_live.py +0 -0
  108. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_nwps_nomads.py +0 -0
  109. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_nyofs_obc_fetch.py +0 -0
  110. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_obc_offshore_nj.py +0 -0
  111. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_ofs_archive_paths.py +0 -0
  112. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/integration/test_s3_roms_fetchers.py +0 -0
  113. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/scripts/inspect_dem.py +0 -0
  114. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/scripts/inspect_grib.py +0 -0
  115. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/scripts/inspect_zarr.py +0 -0
  116. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_coastwatch.py +0 -0
  117. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_dbofs.py +0 -0
  118. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_dispatcher.py +0 -0
  119. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_erddap.py +0 -0
  120. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_hrrr_atm.py +0 -0
  121. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_hrrr_idx.py +0 -0
  122. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_hrrr_levels.py +0 -0
  123. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_hrrr_points.py +0 -0
  124. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_hycom.py +0 -0
  125. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_jobs.py +0 -0
  126. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_layered_mesh.py +0 -0
  127. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_main.py +0 -0
  128. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_mesh_frames.py +0 -0
  129. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_ndbc.py +0 -0
  130. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_necofs_hindcast.py +0 -0
  131. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_necofs_mesh_cache.py +0 -0
  132. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_necofs_parent.py +0 -0
  133. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_necofs_volume.py +0 -0
  134. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_noaa_datum.py +0 -0
  135. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_nwps.py +0 -0
  136. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_nyofs.py +0 -0
  137. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_obc_donor_report.py +0 -0
  138. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_obc_pipeline.py +0 -0
  139. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_removed_routes.py +0 -0
  140. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_settings.py +0 -0
  141. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_usgs.py +0 -0
  142. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_usgs_rivers.py +0 -0
  143. {forcingkit-0.17.0 → forcingkit-0.17.1}/tests/unit/test_zarr_stream.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: forcingkit
3
- Version: 0.17.0
3
+ Version: 0.17.1
4
4
  Summary: Spatiotemporal forcing for computational Earth-system models: selects, regrids and serves model-ready time series with provenance.
5
5
  Project-URL: Documentation, https://forcingkit.docs.lhzn.io
6
6
  Project-URL: Issues, https://github.com/lhzn-io/forcingkit/issues
@@ -9,7 +9,7 @@ sys.path.insert(0, os.path.abspath("../../src"))
9
9
  project = "forcingkit"
10
10
  copyright = "2026, Long Horizon Observatory"
11
11
  author = "Daniel Fry"
12
- release = "0.17.0"
12
+ release = "0.17.1"
13
13
 
14
14
  extensions = [
15
15
  "sphinx.ext.autodoc",
@@ -154,7 +154,8 @@ These serve validation rather than forcing:
154
154
  verified window is cached for good and one still holding preliminary readings for a day, because
155
155
  CO-OPS replaces preliminary readings once it has reviewed them. Current predictions
156
156
  (``/api/v1/currents``) and the
157
- current-station list (``/api/v1/currents/stations``) use the same client.
157
+ current-station list (``/api/v1/currents/stations``) use the same client; cached predictions are
158
+ fetched again after 30 days (since 0.17.1), so harmonic constants NOAA re-publishes reach them.
158
159
  - **NDBC** buoy meteorology and ADCP profiles (``/api/v1/ndbc``), from the `NOAA National Data
159
160
  Buoy Center <https://www.ndbc.noaa.gov/>`__, through insitukit's NDBC client: each month from
160
161
  the monthly, yearly or real-time file, each file downloaded once, and each column's own
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "forcingkit"
7
- version = "0.17.0"
7
+ version = "0.17.1"
8
8
  description = "Spatiotemporal forcing for computational Earth-system models: selects, regrids and serves model-ready time series with provenance."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -23,6 +23,9 @@ TIDE_DATUMS = ("NAVD", "MSL")
23
23
  # How long a cached water-level window that still holds preliminary readings is served before
24
24
  # CO-OPS is asked again (a verified window is kept for good).
25
25
  PRELIMINARY_TTL_S = 24 * 3600
26
+ # How long cached current predictions are served before CO-OPS is asked again. Predictions follow
27
+ # from a station's harmonic constants, which NOAA re-publishes now and then.
28
+ PREDICTIONS_TTL_S = 30 * 86400
26
29
 
27
30
 
28
31
  def _utc(stamp: str) -> datetime:
@@ -221,13 +224,17 @@ def fetch_noaa_current_predictions(
221
224
  ``interval_minutes``. The metadata carries the station's position, the bin depth (metres
222
225
  below the surface), and the mean flood and ebb directions (degrees true, toward which the
223
226
  water flows). Only harmonic stations give a series; subordinate stations give slack and
224
- maximum times only and are refused. ``get`` is ignored (kept for callers of earlier
225
- releases; requests go through insitukit).
227
+ maximum times only and are refused. A cached response is served for ``PREDICTIONS_TTL_S``
228
+ (30 days), then fetched again, so a re-published set of harmonic constants reaches it.
229
+ ``get`` is ignored (kept for callers of earlier releases; requests go through insitukit).
226
230
  """
227
231
  os.makedirs(cache_dir, exist_ok=True)
228
232
  key = f"currents_{station_id}_b{bin_number}_{start_time}_{end_time}_{interval_minutes}"
229
233
  cache_path = os.path.join(cache_dir, key.replace(":", "-") + ".json")
230
- if not cache_bust and os.path.exists(cache_path):
234
+ fresh = os.path.exists(cache_path) and (
235
+ datetime.now().timestamp() - os.path.getmtime(cache_path) < PREDICTIONS_TTL_S
236
+ )
237
+ if fresh and not cache_bust:
231
238
  with open(cache_path) as f:
232
239
  return json.load(f)
233
240
 
@@ -159,3 +159,28 @@ def test_station_listing_keeps_harmonic_bins_in_the_box(tmp_path, monkeypatch):
159
159
  [-73.86, 40.75, -72.84, 41.35], cache_dir=str(tmp_path)
160
160
  )
161
161
  assert len(calls) == 1
162
+
163
+
164
+ def test_cached_predictions_expire_after_thirty_days(tmp_path, monkeypatch):
165
+ import os
166
+
167
+ rows = [
168
+ {
169
+ "meanFloodDir": 272,
170
+ "Bin": "15",
171
+ "meanEbbDir": 79,
172
+ "Time": "2026-04-02 00:00",
173
+ "Depth": "6.7",
174
+ "Velocity_Major": 30.3,
175
+ }
176
+ ]
177
+ calls = answer(monkeypatch, {"current_predictions": {"cp": rows}})
178
+ args = ("LIS1027", 15, "2026-04-02T00:00:00", "2026-04-02T00:30:00")
179
+ noaa.fetch_noaa_current_predictions(*args, cache_dir=str(tmp_path))
180
+ noaa.fetch_noaa_current_predictions(*args, cache_dir=str(tmp_path))
181
+ assert len(calls) == 2 # one prediction request and one metadata request
182
+ for p in tmp_path.glob("currents_*.json"):
183
+ t = p.stat().st_mtime - noaa.PREDICTIONS_TTL_S - 60
184
+ os.utime(p, (t, t))
185
+ noaa.fetch_noaa_current_predictions(*args, cache_dir=str(tmp_path))
186
+ assert len(calls) == 4
@@ -1000,7 +1000,7 @@ wheels = [
1000
1000
 
1001
1001
  [[package]]
1002
1002
  name = "forcingkit"
1003
- version = "0.17.0"
1003
+ version = "0.17.1"
1004
1004
  source = { editable = "." }
1005
1005
  dependencies = [
1006
1006
  { name = "bottleneck" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes