Week 2

Getting Pull Request 1 in …. Hello everyone, hope this blog finds you well.

This week marked the beginning of my journey into pull requests as I tackled my very first one. This task holds significant weight in Phase 1 of my work. Throughout my programming experience, I have firmly held the belief that a codebase should not be populated with superfluous functionalities just for the sake of it. Instead, every implemented feature must be meticulously crafted to handle all possible scenarios, and the accompanying documentation must be of top notch quality.

Aim :

My purpose for this week was to make a Pull request and get it in successfully. That would lead to the completion of 2 stalled Pull requests - #20304 and #22124.

I have made the pull request here - #25227. Although I could not get the pull request merged, I am very close to that goal.

Work : Let us go through the Pull Request and the reviews I addressed in brief.

  • Hosting of images for HTML page : If you remember my progress upto last week, hosting of images was a challenge which I was trying to figure out. I had hosted them at my GSOC-Images repository and added links in my code. To figure out a permanent solution, I used SVG images. I had to draw them first and commit them. One blocker which I came across here was rendering the HTML page in dark mode. It was a pre-existing issue in SymPy : #24695 SVG images in the docs are not visible in dark mode. So I planned to improvise and use colors that could be seen with both white and black backgrounds : )

  • Another development in this pull request was how I would add plots in the page. Instead of converting the images to SVG’s, I used the plot directive- a sphinx extension for embedded plots. Now the plots will be dynamically generated every time the page gets loaded instead of being statically placed in the code as an images.
    .. plot:: guides/physics/generate_plots.py q3_4    # Path to script which generates the plots.
    
  • Another review which I addressed deals with rendering of the math equations. Jason suggested that the math directive should be used instead of opening and closing the equations with $. They provide better rendering and formatting of lines due to the latex alignment environment.

    Look how nicely this script format a differential equation

          .. math::
              \frac + c\frac + ky(t) = w^2u(t) \\\\
              with \ initial \ conditions \\
              y(0) = t,\quad\frac\bigg|_{t=0} = 0\\
    

    image

Some comments/reviews on this pull request were out of scope of this pull request. None the less they need to be addressed at some point during the summer (probably in phase 2). I have raised the following issues so that the comments can be tracked -

  1. #25236- To be discussed : Better representation of Transfer Function expressions.
  2. #25235- Shift physics example files to guides\physics-guides\.
  3. #23234- Adjust Scale of Pole Zero Plot for better understanding of poles and zeros.

Observations and Challenges :

  1. This week my mentors and I figured out a platform to communicate, which is one of the challenges I faced during week 1.
  2. Right now, the examples are both symbolic and numeric in nature. As pointed out here by Jason there are no examples which are fully symbolic. We did not explore this idea in depth. Making an example fully symbolic will restrict the kind of examples we can attempt to solve using SymPy.

Future Work : In the upcoming week, I would be working on implementing the Root Locus Plot for graphical analysis of Transfer Functions.

Address

Mumbai, Maharashtra, India