Skip to content

Add assertions for plot legend titles in bearing overview tests - #259

Open
tlukkezen wants to merge 1 commit into
mainfrom
claude/cpt-name-not-shown-in-plot-bearing-overview-w1gZa
Open

Add assertions for plot legend titles in bearing overview tests#259
tlukkezen wants to merge 1 commit into
mainfrom
claude/cpt-name-not-shown-in-plot-bearing-overview-w1gZa

Conversation

@tlukkezen

Copy link
Copy Markdown
Contributor

Summary

Enhanced test coverage for bearing overview plot functionality by adding assertions that verify the legend title contains the expected test ID.

Key Changes

  • test_multi_cpt_results.py: Updated test_multi_cpt_bearing_results to extract the figure from plot_bearing_overview() and assert that the bearing legend title matches the expected format "name: {test_id}"
  • test_multi_cpt_tension_results.py: Applied the same test enhancement to test_multi_cpt_bearing_results for tension results
  • test_grouper.py: Updated test_grouper_results_max_bearing with identical legend title assertion logic
  • test_multi_cpt_results.py & test_multi_cpt_tension_results.py: Added assertion to verify soil_properties.test_id matches the expected test ID

Implementation Details

The tests now:

  1. Capture the figure object returned by plot_bearing_overview() instead of just type-checking it
  2. Iterate through figure axes to find the one with a legend
  3. Assert that the legend title text equals f"name: {test_id}" to ensure proper labeling of bearing capacity plots
  4. Verify soil properties contain the correct test ID reference

This improves test robustness by validating not just the plot structure, but also the correctness of the legend labeling which is important for plot readability and data traceability.

https://claude.ai/code/session_01RW9aBjmj37XkwsM2AmgAPH

Add assertions to ensure that soil_properties.test_id is correctly
propagated from the API response and that plot_bearing_overview()
displays the actual CPT name ("name: <test_id>") in the legend title
rather than the fallback "name: unknown".

Covers compression single-CPT results, tension single-CPT results,
and the grouper MaxBearingResult code paths.

https://claude.ai/code/session_01RW9aBjmj37XkwsM2AmgAPH
@tlukkezen tlukkezen self-assigned this Apr 13, 2026
@github-actions

Copy link
Copy Markdown

Super-linter summary

Language Validation result

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 24339545496

Coverage remained the same at 83.038%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2995
Covered Lines: 2487
Line Coverage: 83.04%
Coverage Strength: 2.49 hits per line

💛 - Coveralls

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.

3 participants