Cleanup (depth table, OpenCVError, split overrides) + coverage 50%→80%#93
Merged
Merged
Conversation
…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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mat_conversion.jl): the two parallel 7-branchif/elseifladders are replaced by one bijective_CV_DEPTHtable +_cv_depth/_julia_eltypehelpers. Adding a dtype is now one entry.nothing:julia_to_cpp(::InputArray)nowthrowsOpenCVErroron an unsupported eltype instead of falling through to an implicitreturn nothing.gen/funclist.csv.Low
cv_manual_wrap.jlby concern →src/overrides/{defaults,covariance,convenience}.jl.OpenCVErrorexception type (used at themat_conversionerror sites). Rawcv::Exceptions still surface asErrorExceptionuntil the generator wraps them — noted in the docstring.Coverage push
New
test/test_core_types.jlandtest/test_conversions.jl, plus fileio/objdetect additions, cover the Mat/VecAbstractArrayinterface, all 7cv::Matdtypes, Scalar tuples of every arity, the typestructs,OpenCVError, the scalar identity/Tuple/Bool conversions, FileIO Stream + flags/params,show(::MIME"image/png"), andCascadeClassifierempty().codecov.ymlnow ignores the machine-generatedsrc/generated/. GUI window fns (createButton/createTrackbar/setMouseCallback) remain a documented headless gap.Two latent bugs found & fixed by the new coverage
load(::Stream)called bareread— but the generatedcv::readwrappers shadowBase.readinside the module, so it never reachedBase.read. Now qualified.load(::Stream)reshaped to 3D and called a 1-argimdecodethat never existed. Now uses theimdecode(::AbstractVector{UInt8})convenience method (MethodErrorwhen usingOpenCV.imdecode#58).Suite: 310/310.
🤖 Generated with Claude Code