Fix: syntax errors in utility function validations#1336
Fix: syntax errors in utility function validations#1336abhayrajjais01 wants to merge 1 commit intoweecology:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1336 +/- ##
==========================================
+ Coverage 87.34% 87.65% +0.31%
==========================================
Files 24 24
Lines 2978 2989 +11
==========================================
+ Hits 2601 2620 +19
+ Misses 377 369 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
henrykironde
left a comment
There was a problem hiding this comment.
Hi @abhayrajjais01, thanks for the suggestions. Could you share the script you were running when you encountered this bug? If you discovered it using AI, that’s also okay. Once I have that information, I can better guide you on how to proceed.
ce1c1a1 to
dc09e9a
Compare
|
Hi @henrykironde, thanks for reviewing! the original code used |
bfad71b to
2b7831a
Compare
…ngs.warn, fix len(string) check
d07531b to
f6427b8
Compare
|
If you take the time to fully understand the function, what it does, and how it is used, you may arrive at a good design or solution for this PR. I strongly encourage reviewing and understanding the code before submitting changes, rather than sending AI generated patches that may not yet be fully understood. |
henrykironde
left a comment
There was a problem hiding this comment.
Please refer to the comment above
Description
This PR addresses bugs in
src/deepforest/utilities.pywhere validation checks would either crash the program or execute incorrect string length logic.Changes:
raise DeprecationWarning(...)withwarnings.warn(..., DeprecationWarning). The previous implementation threw an exception and killed the process, effectively making the functions unreachable.__assign_image_path__wherelen()was evaluated on the first character of the image path string instead of on the array of unique existing paths. This prevented false-positive warnings from firing on valid string paths.Type of change
nge which fixes an issue)
AI-Assisted Development
AI tools used (if applicable):
AI tools were initially used to understand the codebase better. but code was written and verified manually.