Skip to content

fix: repair FRLM VMT coverage fallback#521

Open
samay2504 wants to merge 1 commit intopysal:mainfrom
samay2504:fix/frlm-vmt-coverage-fallback
Open

fix: repair FRLM VMT coverage fallback#521
samay2504 wants to merge 1 commit intopysal:mainfrom
samay2504:fix/frlm-vmt-coverage-fallback

Conversation

@samay2504
Copy link
Copy Markdown

This PR fixes issue #520 by correcting the fallback path in FRLM.get_vmt_coverage() so it initialises missing flow coverage state and delegates to the existing get_flow_coverage() method rather than calling a non-existent method, and it adds a regression test that removes flow_coverage before invocation to confirm the method now returns VMT metrics instead of raising AttributeError.

Copilot AI review requested due to automatic review settings April 11, 2026 17:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes FRLM’s VMT coverage fallback path so get_vmt_coverage() no longer calls a non-existent flow coverage method when flow_coverage has been removed, and adds a regression test to prevent the AttributeError reported in issue #520.

Changes:

  • Update FRLM.get_vmt_coverage() to initialize missing flow_coverage state and delegate to the existing get_flow_coverage() implementation.
  • Add a regression test that deletes flow_coverage before calling get_vmt_coverage() and asserts VMT metrics are returned.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
spopt/locate/flow.py Fixes the fallback in get_vmt_coverage() by initializing flow_coverage and calling get_flow_coverage() instead of a missing method.
spopt/tests/test_locate/test_flow.py Adds a regression test covering the missing-flow_coverage attribute scenario from issue #520.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.0%. Comparing base (9b36063) to head (5edad42).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #521     +/-   ##
=======================================
+ Coverage   76.9%   77.0%   +0.1%     
=======================================
  Files         29      29             
  Lines       3700    3701      +1     
=======================================
+ Hits        2846    2849      +3     
+ Misses       854     852      -2     
Files with missing lines Coverage Δ
spopt/locate/flow.py 73.4% <100.0%> (+0.2%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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