Skip to content

Docs overhaul + cleanup & coverage (rebased on master)#92

Merged
ViralBShah merged 4 commits into
masterfrom
vs/docs-mat-convention
Jun 5, 2026
Merged

Docs overhaul + cleanup & coverage (rebased on master)#92
ViralBShah merged 4 commits into
masterfrom
vs/docs-mat-convention

Conversation

@ViralBShah

@ViralBShah ViralBShah commented Jun 5, 2026

Copy link
Copy Markdown
Member

Rebased onto master as a single linear PR. Combines the documentation work with the cleanup/coverage work that had been merged into this branch (former #93), dropping the intermediate merge commits.

Documentation

  • Core concepts page: cv::OpenCV. naming, the (channels, cols, rows) Mat layout, dtypes, Julia-array interop, scalars/geometry.
  • API reference page: @docs for the module, Mat, Vec, the geometry primitives, and load/save/imdecode (replaces the raw @autodocs dump on the landing page).
  • Rewritten index.md (install, quick-start, layout callout, manual ToC — merged with Expand README and docs to address #3 #86's version/versioning sections), docstrings on Mat/Vec/fileio/geometry types, a real jldoctest.

Cleanup & coverage

  • Dedup the depth↔dtype map (_CV_DEPTH table); OpenCVError; split cv_manual_wrap.jl into src/overrides/; julia_to_cpp throws instead of silent nothing.
  • Coverage of hand-written src/ raised 50% → 80% (new test_core_types.jl/test_conversions.jl + fileio/objdetect additions); codecov.yml ignores src/generated/.
  • Fixed two latent load(::Stream) bugs found by the new coverage (shadowed read, non-existent 1-arg imdecode).

Verified on the rebased branch: full suite 310/310, makedocs builds clean (no broken refs / missing docs, doctest passes).

🤖 Generated with Claude Code

@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.
✅ Project coverage is 80.82%. Comparing base (e4baed5) to head (c859dc6).

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             @@
##           master      #92       +/-   ##
===========================================
+ Coverage   11.79%   80.82%   +69.02%     
===========================================
  Files          18       13        -5     
  Lines        2594      292     -2302     
===========================================
- Hits          306      236       -70     
+ Misses       2288       56     -2232     

☔ 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.

Base automatically changed from vs/cxxwrap-compat-017 to vs/value-vector-conversion June 5, 2026 20:47
Base automatically changed from vs/value-vector-conversion to master June 5, 2026 21:18
ViralBShah and others added 3 commits June 5, 2026 21:33
…doctest

The package shipped zero docstrings, and the (channels, cols, rows) Mat memory
layout — the convention that made the features2d descriptor test wrong — was
undocumented. Add:

- A Mat docstring explaining the (channels, cols, rows) axis order with the
  descriptor-matrix consequence (keypoint axis is dim 3), plus a jldoctest so the
  existing (previously no-op) doctest CI job tests something real.
- Docstrings on Vec, fileio load/save, and imdecode(::AbstractVector{UInt8}).
- A module-level OpenCV docstring pointing at the layout and gen/funclist.csv.
- A 'Memory layout' note in the Getting Started docs page.

Verified: doctest(OpenCV) passes (1 doctest); suite 230/230.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The docstrings added earlier rendered only via a raw `@autodocs` dump at the
bottom of the landing page, and there was no narrative reference for the
package's conventions. Restructure the manual into real pages:

- Core concepts (new): the cv:: -> OpenCV. naming map, the (channels, cols, rows)
  Mat layout, supported dtypes, Julia-array interop, scalars and geometry types.
- API reference (new): @docs blocks for the hand-written surface (module, Mat,
  Vec, the geometry primitives, load/save/imdecode), replacing the index autodocs.
- index.md: trimmed to a real landing page — install, quick start, the layout
  callout, and a Manual table of contents.
- Docstrings for the geometry primitives in typestructs.jl (Point, Point3, Size,
  Rect, RotatedRect, Range, TermCriteria, cvComplex).
- make.jl: register the new pages; checkdocs=:exports.

Verified locally: full `makedocs` build is clean (no broken @refs, no missing
docs) and the doctest passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…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>
@ViralBShah ViralBShah force-pushed the vs/docs-mat-convention branch from 5e61e0f to ccfb63e Compare June 5, 2026 21:37
@ViralBShah ViralBShah changed the title Document the Mat (channels, cols, rows) layout + docstrings + doctest Docs overhaul + cleanup & coverage (rebased on master) Jun 5, 2026
The README had grown to duplicate the documentation site (version-query
snippet, getting-started, the Mandrill usage example, versioning prose). Cut
those — they live in the docs now — and keep the README focused on what only
belongs at the repo root: a one-paragraph description, a prominent docs link,
installation, and contributor/developer info (local dev, the three-layer
architecture). Also refresh the src/ file list (src/overrides/, errors.jl;
cv_manual_wrap.jl was split).
@ViralBShah ViralBShah merged commit bf09181 into master Jun 5, 2026
10 checks passed
@ViralBShah ViralBShah deleted the vs/docs-mat-convention branch June 5, 2026 21:46
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