Stop reporting two things nobody can act on - #19
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two sources of noise, neither indicating a problem.
[rast] unknown calendar (assuming standard): GregorianSome 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, sinceGregorianis 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()calledgetNOAA.bathy()whether or not the grid was already on disk. marmap handles that case, but announces it: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 theR_user_dirlocation the Copernicus files already use. A study area downloaded once now stays downloaded. Passingpathstill 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 throughgetNOAA.bathy(): slower and chattier, not wrong.Verification
R CMD check— Status: OK. Full suite green. Installed into both R 4.6.1 and 4.3.2.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 satelliteCHL, 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