Skip to content

Fix new test warnings (issue #971)#986

Merged
lior-antonov merged 5 commits into
masterfrom
issue971
Jul 15, 2026
Merged

Fix new test warnings (issue #971)#986
lior-antonov merged 5 commits into
masterfrom
issue971

Conversation

@ilayfalach

Copy link
Copy Markdown
Collaborator

Summary

Fixes the hera-owned deprecation warnings reported in #971 (introduced/surfaced after #882):

  • hera/utils/logging/helpers.py: replaced deprecated importlib.resources.read_text with files().joinpath().read_text().
  • Eliminated invalid escape sequences across 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 unrelated SyntaxErrors are skipped by the test rather than silently ignored.
  • hera/riskassessment/agents/effects/InjuryLevel.py: plt.close('all') before each plt.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 pyproj Transformer instead.
  • matplotlibCountour.py's ContourSet.collections warning was already fixed on master (verified, no change needed).
  • CI: added JUPYTER_PLATFORM_DIRS=1 to silence jupyter_client's platformdirs migration notice.

Warnings originating in the vendored hermes/pyargos repos (cloned into _vendor/ by CI) are tracked separately and require PRs to those repos.

Test plan

  • hera/tests/test_logging_helpers.py (new) — asserts no DeprecationWarning loading the default logging config
  • hera/tests/test_no_invalid_escapes.py (new) — compiles every hera/**/*.py file with escape warnings as errors
  • hera/tests/test_topography.py (extended) — new regression tests for the single-point CRS conversion warning
  • hera/tests/test_riskassessment_flow.py — passes with -W error::matplotlib.MatplotlibDeprecationWarning
  • Full suite (pytest hera/tests/ -m "not slow" --ignore=hera/tests/test_notebooks.py): 645 passed, 10 skipped, 1 xfailed, no unexpected warnings
  • Confirm CI's warnings summary no longer lists the hera-owned items from Fix new warnings from test #971

🤖 Generated with Claude Code

Ilay Falach and others added 5 commits July 14, 2026 10:55
…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>
@lior-antonov
lior-antonov merged commit d9cd557 into master Jul 15, 2026
2 checks passed
@lior-antonov
lior-antonov deleted the issue971 branch July 15, 2026 08:17
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.

2 participants