docs: rewrite the MeteoLowFreq documentation from the code (#843) - #1078
Open
ilayfalach wants to merge 2 commits into
Open
ilayfalach wants to merge 2 commits into
ilayfalach wants to merge 2 commits into
Conversation
…ixes #843) The page documented four things that were wrong and omitted most of the API. Checked every name against hera/measurements/meteorology/lowfreqdata/: - `plotSeasonalHourly` does not exist anywhere in the package. - `calcHourlyDist` takes `Field` (capital F) and `normalization`, not `field` and `density`. - `plotProbContourf_bySeason` takes `plotField`, a single column name, not `fields=[...]`. - `plotScatter` was shown on `dailyPlots` correctly, but `dateLinePlot`, `plotProbContourf` and `resampleSecondMoments` were not documented at all. The page now follows the structure of the sibling MeteoHighFreq page and covers: the data source format and docType, toolkit initialisation, all three analysis methods (with the exact columns `addDatesColumns` adds and the three valid `normalization` values), and all four plotting methods grouped by the `dailyPlots` / `seasonalPlots` accessor they hang off. It also records that the toolkit constant `MeteoLowFreq` and the database toolkit name `lowFreqMeteorology` differ, which the old page did not mention. hera/tests/unit/test_lowfreq_docs_match_code.py parses the Python examples out of the page and resolves every `lf.<accessor>.<method>(...)` call and keyword argument against the real classes. On the old page it fails with exactly the four errors above. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`presenation.__init__`, `Plots.__init__`, `SeasonalPlots.__init__` and `DailyPlots.__init__` each printed emoji debug lines, so every `getToolkit(METEOROLOGY_LOWFREQ)` wrote seven lines to stdout. That is noise in a notebook and corrupts the output of any CLI or script that pipes stdout. Found while documenting the toolkit for #843; unrelated to the documentation itself, hence a separate commit. Deleted rather than converted to logger calls: none of these classes has a logger and the lines carry no information a caller would want. Co-Authored-By: Claude Opus 5 (1M context) <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.
Closes #843.
The problem
Four things on the page were wrong:
plotSeasonalHourlydoes not exist anywhere in the package.calcHourlyDisttakesField(capital F) andnormalization, notfieldanddensity.plotProbContourf_bySeasontakesplotField, one column name, notfields=[...].dateLinePlot,plotProbContourfandresampleSecondMomentswere not documented at all.What changed
The page now follows the structure of the sibling MeteoHighFreq page: data source format and
docType, initialisation, all three analysis methods (with the exact columnsaddDatesColumnsadds and the three validnormalizationvalues), and all four plotting methods grouped by thedailyPlots/seasonalPlotsaccessor they hang off. It also records that the toolkit constant isMeteoLowFreqwhile the name in the database islowFreqMeteorology.Test
hera/tests/unit/test_lowfreq_docs_match_code.pyparses the Python examples out of the page and resolves everylf.<accessor>.<method>(...)call and keyword argument against the real classes. On the old page it fails with exactly the four errors above, so this cannot drift again silently.Second commit, unrelated to the docs
presenation.__init__,Plots.__init__,SeasonalPlots.__init__andDailyPlots.__init__each printed emoji debug lines, so everygetToolkit(METEOROLOGY_LOWFREQ)wrote seven lines to stdout. Removed.🤖 Generated with Claude Code