Fix new test warnings (issue #971)#986
Merged
Merged
Conversation
…ers (issue971) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ession test (issue971) Raw docstrings for LaTeX blocks, doubled backslashes in OpenFOAM banner strings (output unchanged), and a repo-wide compile-time test. Legacy files with pre-existing SyntaxErrors are skipped by the test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ssue971) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ersion (issue971) geopandas.GeoDataFrame.to_crs() on a 1-row frame triggers pyproj's 'ndim > 0 to a scalar' DeprecationWarning on the pinned geopandas 1.0.1 / pyproj 3.6.1 / numpy 1.26.4 combo (confirmed by reproducing with those exact pinned versions in an isolated venv — not reproducible with newer geopandas). Route single-point conversions through a scalar pyproj Transformer instead, which is unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e971) Co-Authored-By: Claude Sonnet 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.
Summary
Fixes the hera-owned deprecation warnings reported in #971 (introduced/surfaced after #882):
hera/utils/logging/helpers.py: replaced deprecatedimportlib.resources.read_textwithfiles().joinpath().read_text().hera/sources (LaTeX docstrings made raw, OpenFOAM banner strings backslash-escaped) and added a repo-wide regression test (test_no_invalid_escapes.py) so new instances are caught automatically. Pre-existing dead files with unrelatedSyntaxErrors are skipped by the test rather than silently ignored.hera/riskassessment/agents/effects/InjuryLevel.py:plt.close('all')before eachplt.switch_backend()call to avoid matplotlib's "Auto-close()ing of figures upon backend switching" deprecation.hera/measurements/GIS/raster/topography.py: fixed pyproj's "ndim > 0 to a scalar" DeprecationWarning — reproduced against the exact pinned CI versions (geopandas 1.0.1 / pyproj 3.6.1 / numpy 1.26.4) in an isolated venv;GeoDataFrame.to_crs()on a 1-row frame triggers it, so single-point conversions now go through a scalar pyprojTransformerinstead.matplotlibCountour.py'sContourSet.collectionswarning was already fixed on master (verified, no change needed).JUPYTER_PLATFORM_DIRS=1to silencejupyter_client's platformdirs migration notice.Warnings originating in the vendored
hermes/pyargosrepos (cloned into_vendor/by CI) are tracked separately and require PRs to those repos.Test plan
hera/tests/test_logging_helpers.py(new) — asserts noDeprecationWarningloading the default logging confighera/tests/test_no_invalid_escapes.py(new) — compiles everyhera/**/*.pyfile with escape warnings as errorshera/tests/test_topography.py(extended) — new regression tests for the single-point CRS conversion warninghera/tests/test_riskassessment_flow.py— passes with-W error::matplotlib.MatplotlibDeprecationWarningpytest hera/tests/ -m "not slow" --ignore=hera/tests/test_notebooks.py): 645 passed, 10 skipped, 1 xfailed, no unexpected warnings🤖 Generated with Claude Code