fix: PointCloud.Read() double-joins a caller-supplied "data/" prefix - #92
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Read() hardcodes "data" as the mvtbdata subfolder via
mvtb_path_to_datafile("data", filename) -- the documented convention is
that callers pass a bare filename (PointCloud.Read('bunny.ply')). But
both of the book's own figure-generation scripts
(figures/code/chapter14/fig14_43.py, fig14_44.py) call
PointCloud.Read('data/bunny.ply') with a redundant "data/" prefix, a
convention that predates mvtb_path_to_datafile's current auto-prefixing
design. That redundant prefix made the lookup search for
mvtbdata/data/data/bunny.ply, which doesn't exist, even though
mvtbdata/data/bunny.ply is genuinely present in the package.
Strip a leading "data" path component before joining, so both
PointCloud.Read('bunny.ply') and PointCloud.Read('data/bunny.ply')
resolve to the same file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
petercorke
force-pushed
the
fix/pointcloud-read-data-prefix
branch
from
August 16, 2026 02:28
c8d054d to
fff671c
Compare
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
PointCloud.Read('data/bunny.ply')fails withValueError: file ('data', 'data/bunny.ply') not found locally or in mvtbdata, even thoughmvtbdata/data/bunny.plygenuinely exists in the installed package.Read()hardcodes"data"as themvtbdatasubfolder viamvtb_path_to_datafile("data", filename). The documented/intended convention is a bare filename (PointCloud.Read('bunny.ply')), but both of the book's own figure-generation scripts (figures/code/chapter14/fig14_43.py,fig14_44.py) callRead('data/bunny.ply')with a redundantdata/prefix -- an older convention that predatesmvtb_path_to_datafile's current auto-prefixing design. That redundant prefix makes the lookup search formvtbdata/data/data/bunny.ply, which doesn't exist.datapath component before joining, so both forms resolve to the same file -- keeps the book's existing example scripts working without requiring readers to edit them.Test plan
tests/test_pointcloud.py::TestPointCloud::test_read(new) -- covers bothRead('bunny.ply')andRead('data/bunny.ply'), asserts identical point countbunny_pcd = PointCloud.Read('bunny.ply'))🤖 Generated with Claude Code