fury-gl / fury

FURY - Free Unified Rendering in pYthon.
https://fury.gl
Other
226 stars 165 forks source link

NF: Add keyword_only decorator to enforce keyword-only arguments #888

Open WassCodeur opened 1 month ago

WassCodeur commented 1 month ago

Description:

Added @keyword_only decorator to enforce keyword-only arguments in project functions.

Modification details:

This contribution represents the first step towards applying the @keyword_only decorator to the appropriate functions in the project. Current modifications include the creation of the decorator, associated documentation and unit tests. The next step will be to identify and apply the decorator to relevant functions throughout the project.

WassCodeur commented 1 month ago

Hi @skoudoro! I'm trying to understand why the test fails on github.

skoudoro commented 1 month ago

Also, You do not need to close and open a new PR. a PR can be updated. When, it is open, it is better to update it.

it is very confusing to open and close multiple time the same PR. Let me know if you need more explanation

skoudoro commented 1 month ago

So please, reopen this one and try to update it

WassCodeur commented 1 month ago

Okay, I've already reopened it. Thank you

itellaetxe commented 1 month ago

Your decorator is raising the Warnings correctly, where the keyword-only functions are not being called only with keywords. You can adjust the function calls as the warning suggests to do, so you get rid of the warnings. Similar to what @deka27 did in his decorator PR.

WassCodeur commented 1 month ago

Hi @skoudoro, @itellaetxe !

Thank you for your comments. I'm working on it.

skoudoro commented 1 month ago

Hi @WassCodeur,

What is the status of this PR? Can you also rebase this PR to apply the last changes.

It would be great to have all this update as soon as possible

WassCodeur commented 1 month ago

Hi @skoudoro !

Okay. I'm making the last improvements. I'll push it today.

skoudoro commented 3 weeks ago

What is the status of this PR, we need to move forward @WassCodeur.

WassCodeur commented 3 weeks ago

Extensive job modifying both the function definitions and function calls to match the requirements of your decorator. Just a small comment on a commented test function.

Maybe you could comment the test cases of the decorator a bit so it is clearer? On the other hand, is something like deprecates_from_version being implemented? I might have overlooked it, but I could not see it.

All in all, good. GJ Wachiou

Thank you @itellaetxe for your constructive feedback!

Yes, you're right, I have to comment on it to make it clearer. For deprecates_from_version I managed it from L151 to L161 in the decorators.py file.

WassCodeur commented 1 week ago

Hi @skoudoro

Thank you for your comments, I will take into account all your remarks and fix them too.