Skip to content

Conversation

Copy link

Copilot AI commented Nov 27, 2025

Pull request type

  • Code maintenance (refactoring, formatting, tests)

Checklist

  • Tests for the changes have been added (if needed)
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally

Current behavior

The test_function_grid.py file tests Function.from_grid() and linear_grid interpolation, but lacks coverage for the shepard_fallback path that triggers when linear_grid is set without a grid interpolator.

New behavior

Added 4 tests for shepard_fallback:

  • test_shepard_fallback_warning - Verifies warning emission when fallback triggers
  • test_shepard_fallback_2d_interpolation - Validates 2D interpolation matches standard shepard
  • test_shepard_fallback_3d_interpolation - Validates 3D interpolation matches standard shepard
  • test_shepard_fallback_at_exact_data_points - Confirms exact values at data points
# Example: Testing fallback warning
func = Function(source=[(0,0,0), (1,0,1)], interpolation="shepard")
with warnings.catch_warnings(record=True) as w:
    func.set_interpolation("linear_grid")
    assert "falling back to shepard interpolation" in str(w[0].message)

Breaking change

  • No

Additional information

Addresses review feedback from PR #875 requesting test coverage for shepard_fallback.

Original prompt

#875 update test_function_grid.py to include tests for shephard_fallback as well


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@aZira371 aZira371 changed the title [WIP] Update test_function_grid.py to include tests for shephard_fallback [WIP] Update test_function_grid.py to include tests for shepard_fallback Nov 27, 2025
Co-authored-by: aZira371 <99824864+aZira371@users.noreply.github.com>
Copilot AI changed the title [WIP] Update test_function_grid.py to include tests for shepard_fallback TST: Add tests for shepard_fallback in test_function_grid.py Nov 27, 2025
Copilot AI requested a review from aZira371 November 27, 2025 04:41
Copilot finished work on behalf of aZira371 November 27, 2025 04:41
@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.38%. Comparing base (69caf40) to head (beced24).
⚠️ Report is 1 commits behind head on copilot/enhance-drag-curve-functionality.

Additional details and impacted files
@@                             Coverage Diff                              @@
##           copilot/enhance-drag-curve-functionality     #879      +/-   ##
============================================================================
+ Coverage                                     80.25%   80.38%   +0.12%     
============================================================================
  Files                                           104      104              
  Lines                                         12912    12912              
============================================================================
+ Hits                                          10363    10379      +16     
+ Misses                                         2549     2533      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aZira371 aZira371 marked this pull request as ready for review November 27, 2025 04:53
@aZira371 aZira371 requested a review from a team as a code owner November 27, 2025 04:53
@aZira371 aZira371 merged commit 8572b1e into copilot/enhance-drag-curve-functionality Nov 27, 2025
26 checks passed
@aZira371 aZira371 deleted the copilot/update-test-function-grid branch November 27, 2025 05:04
@github-project-automation github-project-automation bot moved this from Backlog to Closed in LibDev Roadmap Nov 27, 2025
Gui-FernandesBR pushed a commit that referenced this pull request Nov 27, 2025
* Add tests for shepard_fallback in test_function_grid.py

Co-authored-by: aZira371 <99824864+aZira371@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aZira371 <99824864+aZira371@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants