From 4bad364fffc4f5ade68e79b91e08804cc4aafff4 Mon Sep 17 00:00:00 2001 From: WassCodeur Date: Mon, 1 Jul 2024 11:30:36 +0000 Subject: [PATCH] DOC: Add Wachiou's week 4 Blog post --- .../2024-06-26-week3-wachiou-bouraima.rst | 7 +- .../2024-06-26-week4-wachiou-bouraima.rst | 112 ++++++++++++++++++ 2 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 docs/source/posts/2024/2024-06-26-week4-wachiou-bouraima.rst diff --git a/docs/source/posts/2024/2024-06-26-week3-wachiou-bouraima.rst b/docs/source/posts/2024/2024-06-26-week3-wachiou-bouraima.rst index c000457a7e..78f2e163f7 100644 --- a/docs/source/posts/2024/2024-06-26-week3-wachiou-bouraima.rst +++ b/docs/source/posts/2024/2024-06-26-week3-wachiou-bouraima.rst @@ -11,14 +11,14 @@ Hello everyone, Welcome to the fourth week of my Google Summer of Code (GSoC) 2024 journey! This week I've been delving into the technical aspects of my project, -focusing on the consistent application of the warn_on_args_to_kwargs decorator and the initial implementation of lazy loading. +focusing on the consistent application of the ``warn_on_args_to_kwargs`` decorator and the initial implementation of lazy loading. Consistent application of ``warn_on_args_to_kwargs`` ---------------------------------------------------- This week I continued to apply the decorator to foonctions. -To ensure consistency across the code base,I audited all functions that could benefit from the warn_on_args_to_kwargs decorator. +To ensure consistency across the code base,I audited all functions that could benefit from the ``warn_on_args_to_kwargs`` decorator. To do this, I had to: 1. Identify target functions: @@ -60,6 +60,7 @@ What Happens Next? For week 4, I plan to: * Continue refining the ``warn_on_args_to_kwargs`` decorator based on feedback of my Peer `Iñigo Tellaetxe Elorriaga `_, `Robin Roy `_, `Kaustav Deka `_, my guide: `Serge Koudoro `_ and the others community members. +* Apply the ``warn_on_args_to_kwargs`` decorator to all the remaining modules and update all the unitests of these modules too, to respect the desired format. * Dive deep intp the lazy loading functionality based on my research to optimize performance. * Further engage in code reviews to support my peers and improve our project @@ -68,4 +69,4 @@ Did I get stuck? I didn't get stuck -Thank you for following my progress. Your feedback is always welcome. \ No newline at end of file +Thank you for following my progress. Your feedback is always welcome. diff --git a/docs/source/posts/2024/2024-06-26-week4-wachiou-bouraima.rst b/docs/source/posts/2024/2024-06-26-week4-wachiou-bouraima.rst new file mode 100644 index 0000000000..b8bfd466f9 --- /dev/null +++ b/docs/source/posts/2024/2024-06-26-week4-wachiou-bouraima.rst @@ -0,0 +1,112 @@ +WEEK 4: Updating Decorator, Exploring Lazy Loading, and Code Reviews +==================================================================== + +.. post:: June 26, 2024 + :author: Wachiou BOURAIMA + :tags: google + :category: gsoc + +Hello everyone, +-------------- + +Welcome again to my Google summer of code 2024 (GSoC' 2024) journey 2024!. +This week, I focused on updating the ``warn_on_args_to_kwargs`` decorator, applying it across multiple modules, exploring lazy loading, and continuing with code reviews. + + +Updating the ``warn_on_args_to_kwargs`` decorator +------------------------------------------------- + +Based on feedback from my mentor `Serge Koudoro `_ and peers `Iñigo Tellaetxe Elorriaga `_, `Robin Roy `_, `Kaustav Deka `_, I refined the ``warn_on_args_to_kwargs`` decorator and its associated unit tests: + +1. Improvements: + + - Added conditions to verify if the values of ``from_version``, ``until_version``, and the current version of FURY are respected. This includes handling cases where ``from_version`` is greater than the current version of FURY, ``until_version`` is less than the current version of FURY, and ``until_version`` is greater than or equal to the current version of FURY. + - Ensured the decorator and tests cover a broader range of edge cases. + - Enhanced the warnong messages for better clarity and guidance. + +2. Doctest Updates: + + - Updated the doctest considering the values of `from_version` and `until_version`. + - Moved the doctest from the `def decorator()` function to the root function. + +3. Unit Tests: + +.. code-block:: python + + def test_warn_on_args_to_kwargs(): + @warn_on_args_to_kwargs() + def func(a, b, *, c, d=4, e=5): + return a + b + c + d + e + + # if FURY_CURRENT_VERSION is less than from_version + fury.__version__ = "0.0.0" + npt.assert_equal(func(1, 2, 3, 4, 5), 15) + npt.assert_equal(func(1, 2, c=3, d=4, e=5), 15) + npt.assert_raises(TypeError, func, 1, 3) + +- This ensures robust validation and helps catch potential issues early. + + +Applying the ``warn_on_args_to_kwargs`` Decorator +----------------------------------------------- + +This week, I applied the ``warn_on_args_to_kwargs`` decorator to several modules, ensuring consistent usage and improved code quality. The modules updated include: + +- `actors` +- `ui` +- `animation` +- `shares` +- `data` + +For each module, I opened a pull request to track the changes and facilitate reviews: + +- `actors`: https://github.com/fury-gl/fury/pull/898 +- `animation`: https://github.com/fury-gl/fury/pull/899 +- `data`: https://github.com/fury-gl/fury/pull/900 +- `shares`: https://github.com/fury-gl/fury/pull/901 +- `ui`: https://github.com/fury-gl/fury/pull/902 + + +Exploring lazy loading +---------------------- + +In order to optimize performance, I've started exploring and implementing lazy loading. This week, the focus was on the following points: + +- Getting to grips with how the lazy loader works +- Implementing some small script to understand how the Lazy loader works +- I also read the SPEC1 document available at `SPEC1 `_. +- Understanding the benefits of lazy loading and how it can be applied to the FURY code base +- Planning the integration of lazy loading into the FURY code base + +`Code sample: <"https://gist.github.com/WassCodeur/98297d7a59b27979d27945760e3ffb10.js">`_ + + +Peer Code Review +---------------- + +This week, I continued to dedicate time to reviewing the code of my peers. Specifically, I reviewed Kaustav Deka’s work, providing constructive feedback and suggestions for improvement. You can view the pull request here: `https://github.com/dipy/dipy/pull/3239 `_. + + +Acknowledgements +---------------- + +I am deeply grateful to my classmates `Iñigo Tellaetxe Elorriaga `_, `Robin Roy `_, `Kaustav Deka `_ for their continuous support and insightful suggestions. Special thanks to my mentor, `Serge Koudoro `_ , whose expertise and guidance have been invaluable in navigating these technical challenges. + + +Did I get stuck? +----------------- + +Yes, I was a bit confused about understanding lazy loader, but thanks to the help of my mentor `Serge Koudoro `_ , I was able to understand it better. + + +What's next? +------------ + +For the upcoming week, I plan to: + +- Implement lazy loading in the FURY code base +- Continue refining the ``warn_on_args_to_kwargs`` decorator based on feedback +- Engage in more code reviews to support my peers +- Prepare to working on the FURY website to improve the documentation and user experience + +Thank you for following my progress. Your feedback is always welcome.