tirthasheshpatel's Blog

Week #1: Creating a (big) PR

tirthasheshpatel
Published: 06/12/2021

What did you do this week?

This week I submitted an overview of the progress on the mailing list (here) and created a pull request on SciPy (#14215). Thankfully, all the tests pass and SciPy builds with UNU.RAN on all the required platforms! I also created some flowcharts to elucidate the design of the internal API and manifest how callbacks are acquired and released. I also tried to write a higher-level API (tirthasheshpatel/scipy#8) as suggested by one of my mentors.

What is coming up next?

We have discussed quite a lot of points to keep me busy for a couple of weeks down the line :). Here it is:
  • Generate/build UNU.RAN tests and try integrating into SciPy test suite.
  • Maybe figure out a way to speed up the performance on NumPy < 1.19.
  • Write better/stronger tests.
  • Mock up API that uses same object interface i.e. bundle all functions together in a dist parameter.
  • Address code reviews on my PR.
  • Add relation [of the UNU.RAN API] to the rv_discrete and rv_continuous classes in tutorial. Add in docs that rvs of UNU.RAN methods and SciPy distributions differ.

Did you get stuck anywhere?

No blockers this week!
View Blog Post

Week #0: Polishing the Prototype

tirthasheshpatel
Published: 06/07/2021

A little introduction

Hello everyone! I am Tirth, a last year computer science undergraduate student at Nirma University in India. I have been using NumPy and SciPy since I started doing scientific computing in my first year of college. I have been contributing to SciPy since last year and hope to continue to do so :). I will we working this summer to integrate UNU.RAN library in the scipy.stats submodule. UNU.RAN is a C library for Universal Non-Uniform RANdom number generation. It has been used in the ROOT project by CERN and R bindings for the library (Runuran) have also been created. My goal would be to integrate methods for sampling from univariate continuous and discrete distributions.

What did you do this week?

I got to know my mentors, Christoph and Nicholas, in the first week of the community bonding period. Since then, we have been meeting regularly to discuss the API and have been exchanging a lot of design ideas. Over the span of last three weeks, I have been able to significantly enhance my prototype to the point where I feel confident enough to propose a PR on SciPy. I started out with tirthasheshpatel/scipy#5 on my fork which was thread-unsafe and made my way up to tirthasheshpatel/scipy#6 which seems in a very good shape. It builds with UNU.RAN on all the required platforms and tests pass with an exception of a flaky failure. During the last week, I have created this excel sheet with some information on the methods I propose to add in SciPy. It also contains the information about the methods to add and parameters to keep, etc. It will help me with coding those methods in the coming weeks and also document the decisions properly.

What is coming up next?

As the PR on my fork builds and tests pass, I hope to create a PR on SciPy by next week. I also aim to circulate a mail in the Mailing List regarding the imminent PR and try to get feedback from other devs on the design of the API. Nevertheless, the coming weeks are critical to the work I aim to finish during GSoC so I hope to get things done without much contention!

Did you get stuck anywhere?

There have not been any serious blockers during the community bonding period but the Windows CI failed due to some unrelated Pythran errors. After a few abortive attempts to resolve them, the discussion on #13717 helped me fix the failing builds. As pointed out in this comment, I was missing LLVM and MinGW binaries in the PATH which caused some weird linking problems for 64-bit builds. It was moment of relief to see builds passing on windows, since windows failures worried me the most. Hopefully, everything passes on the SciPy PR that I aim to create by the end of this week :). Fingers crossed!
View Blog Post