Skip to content

Add comprehensive test coverage for non-omitted modules#359

Merged
lispandfound merged 3 commits intotype_checkingfrom
copilot/sub-pr-358
Nov 13, 2025
Merged

Add comprehensive test coverage for non-omitted modules#359
lispandfound merged 3 commits intotype_checkingfrom
copilot/sub-pr-358

Conversation

Copy link

Copilot AI commented Nov 13, 2025

Adds comprehensive test coverage for all modules not excluded from coverage checks (grid.py, siteamp_models.py, timeseries.py, xyts.py, geo.py).

Changes

  • grid.py: Test ValueError when coordinate_patchgrid() called without resolution or nx/ny
  • siteamp_models.py: Test 5 validation errors in cb_amp_multi():
    • Empty DataFrame
    • Missing required columns
    • NaN, infinite, and non-positive values
  • timeseries.py: Test error conditions:
    • ZeroDivisionError in ampdeamp() with zero amplification factor
    • ValueError for invalid LFSeis file format in parser constructor
    • ValueError when no seis files found in directory
  • xyts.py: Test error conditions:
    • ValueError for invalid XYTS file format
    • AttributeError when calling tslice_get() or pgv() on meta-only instances
  • geo.py: Comprehensive test coverage with 13 new test cases:
    • Distance calculations (get_distances, closest_location)
    • Coordinate transformations (gen_mat, xy2ll, ll2xy, gp2xy)
    • Mathematical utilities (rotation_matrix, angle_diff edge cases)
    • Path generation (path_from_corners)
    • Great circle calculations (ll_cross_along_track_dist)

Coverage Impact

  • grid.py: 100% (all raise statements covered)
  • siteamp_models.py: 89% (all targeted raises covered)
  • timeseries.py: 99% (all targeted raises covered)
  • xyts.py: 97% (all targeted raises covered)
  • geo.py: 100% (improved from 49% to 100%)

All 25 new test cases pass with no security issues detected.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>
@lispandfound
Copy link
Contributor

@copilot try adding extra test cases in the geo module.

Copilot AI changed the title [WIP] Align standards with the rest of the codebase Add test coverage for explicit raise statements in non-omitted modules Nov 13, 2025
Copilot AI requested a review from lispandfound November 13, 2025 01:15
Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 13, 2025

@copilot try adding extra test cases in the geo module.

Added comprehensive test coverage for the geo module, improving coverage from 49% to 100%. The changes include 13 new test cases covering:

  • get_distances() - single and multiple reference points
  • closest_location() - finding nearest location
  • gen_mat() - transformation matrix generation
  • xy2ll() and ll2xy() - coordinate conversion roundtrip
  • gp2xy() - grid point to XY conversion
  • rotation_matrix() - 2D rotation matrix
  • path_from_corners() - path generation with return and file output
  • ll_cross_along_track_dist() - cross-track and along-track distance calculations
  • angle_diff() - additional edge cases for angle differences

All 46 tests in test_geo.py now pass. See commit a68c3ff.

@lispandfound lispandfound marked this pull request as ready for review November 13, 2025 01:22
Copilot AI changed the title Add test coverage for explicit raise statements in non-omitted modules Add comprehensive test coverage for non-omitted modules Nov 13, 2025
@lispandfound lispandfound merged commit 34bfe8d into type_checking Nov 13, 2025
6 of 8 checks passed
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