shading: use morphology.footprint_rectangle((1, 3)) for 1x3 structuring element#233
Conversation
|
@Omesh37 did you test this locally? pvanalytics isn't getting much work and this fix has uncovered another unrelated problem. |
|
@cwhanse Yes, I have tested using command |
|
@Omesh37 there's also an error related to converting a timedelta. If you don't have time/patience to track that down, I'll see if I can push to your PR. |
|
@cwhanse I suggest a possible fix to this that is: Storing pandas offset object and then returning the result. I have tested using: |
|
@Omesh37 let's not fix that timedelta here. I'll submit a PR to fix it, then we can move this forward. |
|
@Omesh37 can you rebase this to main, so we can see if the Timedelta fix + this PR exposes any new errors? Thanks. |
a9ff351 to
cfd31c9
Compare
|
@cwhanse I have rebased to main :) |
… for skimage < 0.23
|
@cwhanse The import fallback needed to be at module level rather than inside the function, otherwise |
|
Le sigh. The fix I pushed in #236 requires pandas > 2.1. Since pvanalytics stops tests when the first one fails (I should change this), the error went undetected. If you can find a way to fix that statement (series. index.diff()) without advancing pandas, that's fine. Or, I can bump up the minimum pandas version. |
|
@cwhanse I tried using plain index subtraction which works across pandas versions. |
|
Winner. Thanks for sticking this one out. |
|
Finally it worked. Glad to help you out :) |
Fixes a TypeError / FutureWarning caused by differing scikit-image APIs. The structuring element creation in pvanalytics/features/shading.py now uses the modern
morphology.footprint_rectangle((1,3))call.Testing


FutureWarningfromskimage#226in
docs/whatsnewfor all changes. Includes link to the GitHub Issue with
:issue:`num`or this Pull Request with
:pull:`num`. Includes contributor nameand/or GitHub username (link with
:ghuser:`user`).