Fix #999: Replace hardcoded paths in Australia notebook with get_data and tempdir - #1418
Conversation
Fixes the nbqa-ruff pre-commit failure introduced in 874a2b8: the new os/tempfile/get_data imports broke isort ordering. Groups them as stdlib -> third-party -> first-party. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Hi @proofbyhuman welcome to Deepforest, you have 10 PRs open (#1409–#1418). I read all ten diffs and their linked issues. Consolidating into one comment instead of ten threads. The set isn't mergeable as a set
Whichever merges first conflicts with the rest. CI hasn't runThe green checks are only Per-PR#1410 — duplicates existing code. #1409 — call sites not updated. 11 sites still pass Also: #1416 — orphans #1415 — wrong issue. #1414 — fragile detection. Catches bare #1413 — network-dependent pin. Pins #1412 — removes a deliberate error. Deletes the #1417 — matches #1274's spec. #1418 — valid. #1411 — fine. Bare On the AI-assisted workflowPlease review the Ai given code before submitting The specific gap is that these tools don't survey the existing codebase before adding to it — grepping for an existing implementation before starting would have caught #1410, and probably the #1409/#1413/#1416 overlap too. SuggestionPick 2–3, draft the rest until those land. #1417, #1418 and #1409 look fine. That gives maintainers something reviewable and lets later PRs build on a merged base instead of conflicting. |
|
Hola Viki Sharma, estoy muy agradecido con la devolución, tendré en cuenta
todas las sugerencias y actuaré en consecuencia muchas gracias .
atte.
Ramiro guevara
El jue, 30 jul 2026 a las 13:16, vicky sharma ***@***.***>)
escribió:
… *vickysharma-prog* left a comment (weecology/DeepForest#1418)
<#1418 (comment)>
Hi @proofbyhuman <https://github.com/proofbyhuman> welcome to Deepforest,
you have 10 PRs open (#1409
<#1409>–#1418
<#1418>). I read all ten
diffs and their linked issues. Consolidating into one comment instead of
ten threads.
The set isn't mergeable as a set
- *#1416 <#1416> contains
#1415 <#1415>'s commit.*
Its commit list starts with docs: improve checkpoint documentation and
fix code snippet in user g… and its diff duplicates the entire
docs/user_guide/11_training.md change from #1415
<#1415>.
- *#1409 <#1409>, #1410
<#1410>, #1412
<#1412>, #1416
<#1416> all edit overlapping
regions of src/deepforest/main.py.* #1409
<#1409> rewrites
predict_file's signature; #1416
<#1416> edits inside that
same function. #1412
<#1412> and #1416
<#1416> both change
predict_dataloader.
- *#1413 <#1413> adds a
new predict_file(csv_file=...) call site* — the keyword #1409
<#1409> deprecates.
Whichever merges first conflicts with the rest.
CI hasn't run
The green checks are only pre-commit.ci and readthedocs. The test suite
is gated on maintainer approval, which you asked for on #1412
<#1412>. No test in any of
these ten has executed. #1409
<#1409> also states the suite
wasn't run locally.
Per-PR
*#1410 <#1410> — duplicates
existing code.* ImagesCallback.on_train_start at
src/deepforest/callbacks.py:53 already logs sample training images at
train start, same default of 5 (dataset_samples=5). The existing one
guards on distributed.is_global_zero(trainer) (yours has no rank guard —
every DDP rank would log), skips on fast_dev_run, and samples the actual
dataset via dataset[idx], i.e. post-augmentation. Yours re-reads the raw
CSV, so it shows pre-augmentation annotations and won't catch the
transform/coordinate bugs the description cites. It's also always-on rather
than opt-in. Suggest closing.
*#1409 <#1409> — call sites
not updated.* 11 sites still pass csv_file= as a keyword and would emit
DeprecationWarning: src/deepforest/scripts/predict.py:55 (production
code), tests/test_evaluate.py:24,50,315,379, tests/test_IoU.py:14,
tests/test_main.py:433,1169, tests/profile_evaluate.py:15,
tests/profile_predict_file.py:17, docs/user_guide/12_evaluation.md:201.
Two more pass positionally (tests/test_main.py:441,
docs/user_guide/16_prediction.md:133) — those won't warn, they silently
rebind to input_file.
Also: root_dir now defaults to None, but the docstring's "if none, uses
image_dir in config" fallback isn't implemented, so None fails.
*#1416 <#1416> — orphans
config.batch_size.* After this change nothing reads it, but it stays in
src/deepforest/conf/config.yaml:8 and src/deepforest/conf/schema.py:148.
Anyone setting it is silently ignored, no warning. Needs removal or
explicit deprecation. #889
<#889>'s item 3 ("update
the config doc") also isn't covered. Minor: bird.yaml keeps batch_size: 32
alongside the new keys, and there's an unrelated lambda reformat in
evaluate().
*#1415 <#1415> — wrong issue.* Closes
#1380 is incorrect. #1380
<#1380> asks for a
HuggingFace model card for weecology/cropmodel-deadtrees; this edits
docs/user_guide/11_training.md. Separately, the rewritten example calls
m.create_trainer(fast_dev_run=True) then m.trainer.fit(m) without
configuring config.train.csv_file, so it fails as written.
*#1414 <#1414> — fragile
detection.* Catches bare Exception and substring-matches "401" /
"Unauthorized". huggingface_hub raises typed GatedRepoError /
HfHubHTTPError with .response.status_code — catch those and check == 401.
Substring matching false-positives on any error text containing "401"
(commit hash, path, port). The test patches with a plain Exception("401
Client Error..."), so it validates the substring match against its own
mock, not real HF behavior. Also #1401
<#1401> is a CI failure on
a gated repo; a better message doesn't fix it, so this likely doesn't close
the issue.
*#1413 <#1413> —
network-dependent pin.* Pins 0.80/0.72 against a live download of
weecology/deepforest-tree. Fails for everyone the moment the model is
republished, including on unrelated PRs. Deriving from integer counts
(44/55, 44/61) is right, but consider pinning a revision or adding a
marker so it can be deselected. Also uses csv_file=, deprecated by your
#1409 <#1409>.
*#1412 <#1412> — removes a
deliberate error.* Deletes the workers > 0 ValueError in predict_tile and
replaces it with a silent auto-override. That error looks intentional;
turning a loud failure into a quiet correction is a maintainer decision.
Test also calls m.load_model("weecology/deepforest-tree") —
network-dependent and slow.
*#1417 <#1417> — matches #1274
<#1274>'s spec.*
inverse_transform is identical to RandomPadTo's, worth sharing rather
than duplicating. apply_transform returns a different shape than its
input — fine at the default p=1.0, but you expose p, and if Kornia
applies to a subset of a batch at p<1.0 the shapes may not concat. Worth
testing with p=0.5.
*#1418 <#1418> — valid.*
australia.tif does ship in src/deepforest/data/. But the notebook's
stored cell outputs weren't regenerated, so the rendered docs page still
shows results from the old Plot13Ortho.tif. #999
<#999> is about the page
rendering incorrectly, so re-run the notebook before committing.
*#1411 <#1411> — fine.* Bare
print() matches the surrounding code (datasets/training.py:71).
callbacks.py uses pl_module.print() (rank-aware) but that isn't available
in a dataset constructor.
On the AI-assisted workflow
Please review the Ai given code before submitting
You disclosed AI use on all ten via the template and named the tool each
time — that's correct and not the issue. What's showing is that the review
step is being skipped: #1411
<#1411>'s description
contains a stray proofbyhuman/antigravity string, #1410
<#1410>'s ends with
verification.ification, #1415
<#1415> targets the wrong
issue, and #1410 <#1410>
rebuilds something already in callbacks.py. Those are all catchable in a
minute of reading. The "I have reviewed and validated all AI-generated
code" checkbox is the load-bearing part, not the disclosure.
The specific gap is that these tools don't survey the existing codebase
before adding to it — grepping for an existing implementation before
starting would have caught #1410
<#1410>, and probably the
#1409 <#1409>/#1413
<#1413>/#1416
<#1416> overlap too.
Suggestion
Pick 2–3, draft the rest until those land. #1417
<#1417>, #1418
<#1418> and #1409
<#1409> look fine. That gives
maintainers something reviewable and lets later PRs build on a merged base
instead of conflicting.
—
Reply to this email directly, view it on GitHub
<#1418?email_source=notifications&email_token=CA3AEFPYC3F2JQTUREQQZUT5HNYG7A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMJTGM2DEMBZGUZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5133420953>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CA3AEFJSKM3LLSFOLN3MRST5HNYG7AVCNFSNUABFKJSXA33TNF2G64TZHMYTENBSHEYDAMRTHNEXG43VMU5TKMBRGMZDANRVHA42C5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CA3AEFPLE5N46LR4YKJMWY35HNYG7A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMJTGM2DEMBZGUZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/CA3AEFPE74ZBVHOZJ5V4T7D5HNYG7A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMJTGM2DEMBZGUZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1418 +/- ##
==========================================
+ Coverage 86.61% 86.72% +0.11%
==========================================
Files 26 28 +2
Lines 3736 4069 +333
==========================================
+ Hits 3236 3529 +293
- Misses 500 540 +40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…mage The australia.tif bundled via get_data() is 708x751 pixels (much smaller than the original ~15k x 14k image), so the crop slice [12000:13000] was out of bounds. Changed to [200:500] which fits within the sample. Also fixed the rasterio show() call: since r is now in channels-last format (h, w, c), we need transpose(2, 0, 1) to convert to channels-first (c, h, w) for rasterio, instead of the previous np.rollaxis which assumed channels-first input. Cleared stale outputs that contained hardcoded paths from the original author's environment.
Fixes the nbqa-ruff pre-commit failure on e9ce8fc: replacing np.rollaxis with r.transpose(2, 0, 1) removed the last use of numpy in the notebook, leaving the import unused. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Thanks for taking the time to go through all ten — one thread was far more useful than ten. The process points are done: #1410 and #1414 are closed, and #1411, #1412, #1413, #1415 and #1416 are drafts. That leaves #1409, #1417 and #1418. On re-running this notebook: I can't execute it as-is, and since the blocker is pre-existing code I'd rather ask than change something you didn't ask me to touch. Cell 7 ends with: plot = visualize.plot_results(results=boxes, image=r)
plt.imshow(plot)
plt.show()
You're right that the outputs are the crux. To be precise about the current state: this branch cleared the stored outputs, because they embedded The minimal fix would be dropping the One more thing I noticed while checking: |
Description
This PR fixes #999 by removing hardcoded local user paths in the 'Working with deepforest data' documentation notebook (
docs/user_guide/examples/Australia.ipynb).Key changes:
/Users/benweinstein/Downloads/Plot13Ortho.tif) withget_data("australia.tif").tempfile.gettempdir().osandtempfile) to code blocks.Related Issue(s)
Closes #999
AI-Assisted Development
AI tools used (if applicable):
Gemini (Google DeepMind Agentic Assistant)