Skip to content

Stop reporting two things nobody can act on - #19

Merged
chross22 merged 1 commit into
masterfrom
quieter-reads
Aug 7, 2026
Merged

Stop reporting two things nobody can act on#19
chross22 merged 1 commit into
masterfrom
quieter-reads

Conversation

@chross22

@chross22 chross22 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Two sources of noise, neither indicating a problem.

[rast] unknown calendar (assuming standard): Gregorian

Some Copernicus files declare their calendar as Gregorian, which is not one of the spellings CF lists. terra warns and assumes the standard calendar — and that assumption is correct, since Gregorian is the standard calendar, spelled with a capital. The warning names nothing to do about it, and one per file makes 50 on a 50-day fetch, burying the warnings that matter.

Only that message is muffled, matched on its text. Every other warning from the read still propagates, because a file that is genuinely unreadable should still say so — there's a test for both halves.

marmap narrating a local file read

fetch_bathymetry() called getNOAA.bathy() whether or not the grid was already on disk. marmap handles that case, but announces it:

Querying NOAA database ...
This may take seconds to minutes, depending on grid size
File already exists ; loading 'marmap_coord_-70;42;-68;43_res_10.csv'

An existing grid is now read with marmap::read.bathy() instead. Same object, no commentary, and no NOAA round trip. Verified identical in values and extent.

That only helps if the download survives the session, so the cache moved from tempdir() to the R_user_dir location the Copernicus files already use. A study area downloaded once now stays downloaded. Passing path still overrides it.

The cache filename is marmap's convention rather than ours, so marmap_cache_file() reproduces it and a test pins it — including that a box written corner-reversed resolves to the same file. Should marmap ever change the convention, the match fails and every fetch goes back through getNOAA.bathy(): slower and chattier, not wrong.

Verification

  • R CMD checkStatus: OK. Full suite green. Installed into both R 4.6.1 and 4.3.2.
  • Cached-read path verified end to end: zero lines printed, values and extent identical to the downloaded grid, and getNOAA.bathy() mocked to error so a NOAA request would fail the test rather than pass quietly.

Note

I could not reproduce the calendar warning on CHL_MODEL, NO3, or satellite CHL, monthly or daily — it depends on which product wrote the file. The fix is at the read, so it applies whichever product emits it.

🤖 Generated with Claude Code

Two sources of noise, neither of which indicated a problem.

Some Copernicus files declare their calendar as "Gregorian", which is
not one of the spellings CF lists, so terra warns and assumes the
standard calendar. That assumption is correct - Gregorian is the
standard calendar, spelled with a capital - and the warning names
nothing to do about it. One per file makes fifty on a fifty-day fetch,
which buries the warnings that matter. Only that message is muffled,
matched on its text; every other warning from the read still propagates,
because a file that is genuinely unreadable should still say so.

fetch_bathymetry() called getNOAA.bathy() whether or not the grid was
already on disk. marmap handles that case, but narrates it: "Querying
NOAA database", then "File already exists ; loading ...". An existing
grid is now read with read.bathy() instead, which returns the same
object without the commentary or the NOAA round trip. Verified identical
in values and extent.

That only helps if the download survives the session, so the cache moved
from tempdir() to the R_user_dir location the Copernicus files already
use. A study area downloaded once now stays downloaded. Passing `path`
still overrides it.

The cache filename is marmap's convention rather than ours, so
marmap_cache_file() reproduces it and a test pins it. Should marmap ever
change it, the match fails and every fetch goes back through
getNOAA.bathy() - slower and chattier, not wrong.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chross22
chross22 merged commit 0f1aa9a into master Aug 7, 2026
5 checks passed
@chross22
chross22 deleted the quieter-reads branch August 7, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant