Skip to content

Cleanup (depth table, OpenCVError, split overrides) + coverage 50%→80%#93

Merged
ViralBShah merged 1 commit into
vs/docs-mat-conventionfrom
vs/cleanup-and-coverage
Jun 5, 2026
Merged

Cleanup (depth table, OpenCVError, split overrides) + coverage 50%→80%#93
ViralBShah merged 1 commit into
vs/docs-mat-conventionfrom
vs/cleanup-and-coverage

Conversation

@ViralBShah

Copy link
Copy Markdown
Member

Summary

The combined medium/low-value cleanup PR, plus a coverage push that took the hand-written src/ from 50.3% → 79.8% line coverage.

Medium

  • Dedup the depth↔dtype map (mat_conversion.jl): the two parallel 7-branch if/elseif ladders are replaced by one bijective _CV_DEPTH table + _cv_depth/_julia_eltype helpers. Adding a dtype is now one entry.
  • No silent nothing: julia_to_cpp(::InputArray) now throws OpenCVError on an unsupported eltype instead of falling through to an implicit return nothing.
  • README: repoint the wrapped-methods link to the vendored gen/funclist.csv.

Low

  • Split cv_manual_wrap.jl by concern → src/overrides/{defaults,covariance,convenience}.jl.
  • OpenCVError exception type (used at the mat_conversion error sites). Raw cv::Exceptions still surface as ErrorException until the generator wraps them — noted in the docstring.

Coverage push

New test/test_core_types.jl and test/test_conversions.jl, plus fileio/objdetect additions, cover the Mat/Vec AbstractArray interface, all 7 cv::Mat dtypes, Scalar tuples of every arity, the typestructs, OpenCVError, the scalar identity/Tuple/Bool conversions, FileIO Stream + flags/params, show(::MIME"image/png"), and CascadeClassifier empty(). codecov.yml now ignores the machine-generated src/generated/. GUI window fns (createButton/createTrackbar/setMouseCallback) remain a documented headless gap.

Two latent bugs found & fixed by the new coverage

  • load(::Stream) called bare read — but the generated cv::read wrappers shadow Base.read inside the module, so it never reached Base.read. Now qualified.
  • load(::Stream) reshaped to 3D and called a 1-arg imdecode that never existed. Now uses the imdecode(::AbstractVector{UInt8}) convenience method (MethodError when using OpenCV.imdecode #58).

Suite: 310/310.

Stacked on #92#91#90 (base retargets to master as those merge).

🤖 Generated with Claude Code

…e 50%->80%

Medium-value:
- Replace the two parallel 7-branch depth<->dtype if/elseif ladders in
  mat_conversion.jl with one bijective _CV_DEPTH table + _cv_depth/_julia_eltype
  helpers; adding a dtype is now one entry.
- julia_to_cpp(::InputArray) no longer falls through to a silent `return nothing`
  on an unsupported eltype -- it throws OpenCVError.
- Repoint the README wrapped-methods link to the vendored gen/funclist.csv.

Low-value:
- Split cv_manual_wrap.jl by concern into src/overrides/{defaults,covariance,
  convenience}.jl.
- Add an OpenCVError exception type (used at the mat_conversion error sites);
  raw cv::Exceptions still surface as ErrorException until the generator wraps
  them (noted).

Coverage push (src/, excluding generated): 50.3% -> 79.8%. New test_core_types.jl
and test_conversions.jl plus fileio/objdetect additions cover the Mat/Vec
AbstractArray interface, all 7 cv::Mat dtypes, Scalar tuples of every arity,
typestructs, OpenCVError, the scalar identity/Tuple/Bool conversions, FileIO
Stream + flags/params, show(MIME image/png), and CascadeClassifier empty().
codecov.yml now ignores src/generated/.

Two latent bugs surfaced and fixed by the new fileio coverage:
- load(::Stream) called bare `read` (the generated cv::read wrappers shadow
  Base.read inside the module) -- now Base.read.
- load(::Stream) reshaped to 3D and called a 1-arg imdecode that never existed --
  now uses the imdecode(::AbstractVector{UInt8}) convenience method (#58).

Suite: 310/310.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.51613% with 22 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (vs/docs-mat-convention@0c232ed). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/overrides/convenience.jl 35.71% 18 Missing ⚠️
src/overrides/covariance.jl 63.63% 4 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             vs/docs-mat-convention      #93   +/-   ##
=========================================================
  Coverage                          ?   80.82%           
=========================================================
  Files                             ?       13           
  Lines                             ?      292           
  Branches                          ?        0           
=========================================================
  Hits                              ?      236           
  Misses                            ?       56           
  Partials                          ?        0           

☔ View full report in Codecov by Harness.
📢 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.

@ViralBShah ViralBShah merged commit 22aa16b into vs/docs-mat-convention Jun 5, 2026
10 of 18 checks passed
@ViralBShah ViralBShah deleted the vs/cleanup-and-coverage branch June 5, 2026 21:18
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.

1 participant