napari icon indicating copy to clipboard operation
napari copied to clipboard

DeprecationWarning in ensure_iterable and is_iterable, Closes #6256

Open palec87 opened this issue 1 year ago • 14 comments

References and relevant issues

Supposed to Close #6256. I am not sure about the stacklevel arg of the warning.

Description

Added DeprecationWarning if arguments passed and removed the functionality related to them within the functions.

Regarding checklist

I am not sure about the docs repo.

palec87 avatar Apr 13 '24 16:04 palec87

Thanks, the new logic looks good to me – but I not a core dev so it's not my role to decide if this is ok.

I would mark this as ready for review. This seem to have picked up conflicts with the main branch.

@palec87 are you familiar with merging with/rebasing on main and fixing merge conflicts ?

Carreau avatar Apr 22 '24 08:04 Carreau

@palec87 As @Carreau pointed out there are some conflicts. If you would like you can resolve them and get the PR out of draft mode. If you are not familiar with resolving conflicts I would also be happy to have a small call with you to show you.

melonora avatar May 01 '24 06:05 melonora

@palec87 As @Carreau pointed out there are some conflicts. If you would like you can resolve them and get the PR out of draft mode. If you are not familiar with resolving conflicts I would also be happy to have a small call with you to show you.

Hi @melonora, I would like to go with the call and not messing up. Perhaps tomorrow 3/5? Thanks for help @Carreau too, very appreciated.

palec87 avatar May 02 '24 07:05 palec87

Great! What timezone are you in?

melonora avatar May 02 '24 09:05 melonora

Great! What timezone are you in?

I am UTC+1, free untill lunch for sure.

palec87 avatar May 02 '24 11:05 palec87

Hi @palec87, I see that some tests are failing due to the deprecation warning. I am implementing some minor fixes for those. These are not related to the merge.

melonora avatar May 08 '24 10:05 melonora

however, they are related to the changes. Although at a first glance it seems that allow_none and color have no effect it has some downstream effects on the shapes layer that are not yet all too clear to me.

I tested this after fixing the deprecation warning errors.

melonora avatar May 08 '24 11:05 melonora

however, they are related to the changes. Although at a first glance it seems that allow_none and color have no effect it has some downstream effects on the shapes layer that are not yet all too clear to me.

I tested this after fixing the deprecation warning errors.

Hi @melonora, I see, do you think it is because of the Deprecation warning? Your testing means running the pytest locally, or something else? To me it looks like test_ problem, not shapes layer probles. However, I did not see the -W option for pytest which would result in such errors.

palec87 avatar May 08 '24 12:05 palec87

I can push fixes for the deprecation warning and then the actual errors will show. Is it ok if I do so?

melonora avatar May 08 '24 12:05 melonora

Otherwise I can schedule a short call again and we can go through it together.

melonora avatar May 08 '24 12:05 melonora

Sure, please push the changes.

palec87 avatar May 08 '24 12:05 palec87

Ok now you see the actual problem. Particularly the problem occurs here: https://github.com/palec87/napari/blob/7e558aaec49d5a112e477f51218a512b42d31af1/napari/layers/shapes/shapes.py#L2276-L2312

melonora avatar May 08 '24 12:05 melonora

if you want we can have a look together

melonora avatar May 08 '24 12:05 melonora

if you want we can have a look together

I see know, pretty deep for me, but I have 30 mins, if you want to show me.

palec87 avatar May 08 '24 12:05 palec87

@palec87 Would you ahve time Friday?

melonora avatar May 15 '24 09:05 melonora

@palec87 Would you ahve time Friday?

Hi @melonora , yes I think so. Ping me on LinkIn?

palec87 avatar May 15 '24 09:05 palec87

Hello @melonora, here is my fix. I removed deprecation for allow_none, because it is being set True in stack_utils.py on line 121. Shapes tests were failing because of conditionals when color has been set as object(). Now tests are passing locally.

palec87 avatar May 20 '24 16:05 palec87

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 92.43%. Comparing base (2102518) to head (96967a9).

Files Patch % Lines
napari/utils/misc.py 80.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6836      +/-   ##
==========================================
+ Coverage   92.31%   92.43%   +0.11%     
==========================================
  Files         613      613              
  Lines       55176    55180       +4     
==========================================
+ Hits        50936    51003      +67     
+ Misses       4240     4177      -63     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 20 '24 18:05 codecov[bot]