Articles on joaosferreira's Bloghttps://blogs.python-gsoc.orgUpdates on different articles published on joaosferreira's BlogenMon, 31 Aug 2020 12:19:35 +0000Final Week Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/final-week-check-in-1/<h2>What did you do this week?</h2>
<p>This week I concluded the PR for the <code>random</code> module by adding multimethods for the <code>Generator</code> class. This PR was the last one of my GSoC project. I also wrote the project's final report for my third and final evaluation where I included a short description of the project, links to the the code, a summary of the current state of the project, discussed future work, and enumerated challenges and learnings.</p>
<h2>What will you do after GSoC has ended?</h2>
<p>They say all good things come to an end and this blog post marks the end of my GSoC journey. Soon I will start working on my master's thesis and look for job opportunities in the industry. I also intend to keep working on unumpy and other open-source software projects.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Mon, 31 Aug 2020 12:19:35 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/final-week-check-in-1/Week 12 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-12-check-in-1/<h2>What did you do this week?</h2>
<p>This week I started a new <a href="https://github.com/Quansight-Labs/unumpy/pull/73">PR</a> that adds multimethods for NumPy's <code>random</code> module. This continues the work started by one of my mentors by revising some multimethods and adding new ones as well as important classes like <code>RandomState</code> and <code>Generator</code> along with their methods. The multimethods added so far are manifold and so I won't extend the length of this blog post by enumerating them. You can however read the full list of multimethods in the PR link provided above. I also patched one ongoing PR that added multimethods for statistical functions by refactoring some default implementations. The defaults were redundantly using, in most but not all cases, a helper function for reducing the array argument's dimensions. This was brought to my attention by one of my mentors which resulted in a simple refactoring of the defaults.</p>
<h2>What is coming up next?</h2>
<p>The final week of GSoC is ahead of me and with that said now is the time to finish my project and write the final report. As for the first, this means mostly concluding the <code>random</code> module PR. If I have time I will also work on the documentation of unumpy's multimethods by linking it to NumPy's documentation through Sphinx. Although this might be an easy task, since this is my first time working with Sphinx I don't have an estimate for how long it will take me to do it. Ultimately, this might have to be done after GSoC has ended. More importantly, this upcoming week I want to focus on writing a good final report to showcase the work done during the program. This is of the utmost importance, as it is a necessary step in order to successfully pass the third and final evaluation.</p>
<h2>Did you get stuck anywhere?</h2>
<p>There were no blockers this week.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Tue, 25 Aug 2020 15:15:41 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-12-check-in-1/Week 11 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-11-check-in-2/<h2>What did you do this week?</h2>
<p>This week's work was divided into two parts: fixing some issues in the backends and patching up older PRs. While working on the PR for indexing routines we noticed a bug in the backends that caused some classes to not be dispatched properly. What was happening was that all the classes added in the PR were calling NumPy classes regardless of the backend being used instead of calling the equivalent classes in the respective backends. This issue also touched on another problem that I encountered while preparing the new PR for the <code>random</code> module. The backends were also not dispatching the multimethods in modules correctly. This was apparent by the <code>linalg</code> module's tests which at the time were fixed to the NumPy backend. Because of this I created a new <a href="https://github.com/Quansight-Labs/unumpy/pull/72">PR</a> that fixed both of these issues and extended the <code>linalg</code> tests to other backends which allowed the PR for indexing routines to be patched and merged. I also worked on a previous PR that adds multimethods for statistical functions by adding default implementations to most of the reduction methods (e.g., <code>median</code>, <code>mean</code>, <code>var</code>).</p>
<h2>What is coming up next?</h2>
<p>This week I was expected to start a new PR that adds multimethods for NumPy's <code>random</code> module but as I talked about in the first part of this blog post, some issues had to be fixed first. Although this delayed the PR to the next week all work seems to be on schedule. If I have time in this upcoming week I will also start writing documentation for the unumpy project and my GSoC final report. In the latter I intend to add a short description of the work that was done, allow who reads it to easily find the code, summarize the current state of the project, discuss future work, and enumerated challenges and learnings.</p>
<h2>Did you get stuck anywhere?</h2>
<p>I was able to unblock from last week's default implementation of <code>median</code> with some help. Overall, the other defaults were done without many difficulties.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Wed, 19 Aug 2020 13:58:31 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-11-check-in-2/Week 10 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-10-check-in-1/<h2>What did you do this week?</h2>
<p>This week I started a new <a href="https://github.com/Quansight-Labs/unumpy/pull/70#">PR</a> that adds multimethods for statistical functions. The multimethods added are the following:</p>
<p><strong>Order statistics</strong></p>
<ul>
<li><code>percentile</code></li>
<li><code>nanpercentile</code></li>
<li><code>quantile</code></li>
<li><code>nanquantile</code></li>
</ul>
<p><strong>Averages and variances</strong></p>
<ul>
<li><code>median</code></li>
<li><code>average</code></li>
<li><code>mean</code></li>
<li><code>nanmedian</code></li>
<li><code>nanmean</code></li>
<li><code>nanstd</code></li>
<li><code>nanvar</code></li>
</ul>
<p><strong>Correlating</strong></p>
<ul>
<li><code>corrcoef</code></li>
<li><code>correlate</code></li>
<li><code>cov</code></li>
</ul>
<p><strong>Histograms</strong></p>
<ul>
<li><code>histogram</code></li>
<li><code>histogram2d</code></li>
<li><code>histogramdd</code></li>
<li><code>bincount</code></li>
<li><code>histogram_bin_edges</code></li>
<li><code>digitize</code></li>
</ul>
<p>As of now these new additions have the essential parts of a multimethod, both an argument extractor and replacer but are missing default implementations. I've also modified some of the argument replacers to support the <code>out</code> keyword making them more general purpose thus removing the need for some of the other more specific argument replacers.</p>
<h2>What is coming up next?</h2>
<p>I'll continue the PR started this week by working on default implementations for the simpler multimethods like <code>median</code> and <code>mean</code>. I will also start a new PR that adds multimethods for NumPy's random module that picks up on an older PR left off by one of my mentors. I've been wanting to work on these multimethods for a while but wasn't able to because of other project commitments. After discussing with my mentors we decided to change the work expected for the following week from the JAX backend implementation to the random module since this has a higher priority.</p>
<h2>Did you get stuck anywhere?</h2>
<p>Yes, working on the default implementation for <code>median</code>. Although this might be one of the easiest defaults from the multimethods in the current PR it has proven to be a bit of a challenge. The idea is to transverse the array along the given axes and apply a reduction function. Because of the array manipulations necessary to accomplish this and since I can't use item assignment the default is being more complicated than initial thought. More recently one of my mentors provided a general template for implementing it which might help me unblock. If I can do this other reduction multimethods' defaults should easily follow.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Tue, 11 Aug 2020 15:16:06 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-10-check-in-1/Week 9 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-9-check-in-2/<h2>What did you do this week?</h2>
<p>This week I continued the PR started in the previous week by adding more multimethods for indexing routines. The multimethods added are the following:</p>
<p><strong>Generating index arrays</strong></p>
<ul>
<li><code>c_</code></li>
<li><code>r_</code></li>
<li><code>s_</code></li>
</ul>
<p><strong>Indexing-like operations</strong></p>
<ul>
<li><code>take</code></li>
<li><code>take_along_axis</code></li>
<li><code>choose</code></li>
<li><code>diagonal</code></li>
<li><code>select</code></li>
</ul>
<p><strong>Inserting data into arrays</strong></p>
<ul>
<li><code>place</code></li>
<li><code>put</code></li>
<li><code>put_along_axis</code></li>
<li><code>putmask</code></li>
<li><code>fill_diagonal</code></li>
</ul>
<p><strong>Iterating over arrays</strong></p>
<ul>
<li><code>nditer</code></li>
<li><code>ndenumerate</code></li>
<li><code>ndindex</code></li>
<li><code>nested_iters</code></li>
<li><code>lib.Arrayterator</code></li>
</ul>
<p>Most of the work developed during this week was adding default implementations to the new mutimethods. Also, this is the first PR that makes use of the overriding of unumpy's classes to implement some classes for indexing routines. Unfortunately, I wasn't able to start the PR that adds multimethods for Numpy's random module that I set out to do in the last blog post. Nevertheless, since this is considered extra work there are no delays in the timeline. I will try to do this PR in the following weeks.</p>
<h2>What is coming up next?</h2>
<p>I will start a new PR that adds mutimethods for statistic functions. The work for this following week might be more demanding since the PR is expected to last only one week and it covers a considerable amount of multimethods. Also, some of the default implementations might add an extra challenge. Let's see how it goes! I also need to patch up the PR for the indexing routines which should be almost done.</p>
<h2>Did you get stuck anywhere?</h2>
<p>I didn't get stuck this week.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Tue, 04 Aug 2020 00:43:32 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-9-check-in-2/Week 8 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-8-check-in-2/<h2>What did you do this week?</h2>
<p>This week I started a new <a href="https://github.com/Quansight-Labs/unumpy/pull/67">PR</a> that adds multimethods for indexing routines. The multimethods added so far are the following:</p>
<p><strong>Genenating index arrays</strong></p>
<ul>
<li><code>indices</code></li>
<li><code>ix_</code></li>
<li><code>ravel_multi_index</code></li>
<li><code>unravel_index</code></li>
<li><code>diag_indices</code></li>
<li><code>diag_indices_from</code></li>
<li><code>mask_indices</code></li>
<li><code>tril_indices</code></li>
<li><code>tril_indices_from</code></li>
<li><code>triu_indices</code></li>
<li><code>triu_indices_from</code></li>
</ul>
<p>I also finished the two PRs from the previous week, one that adds multimethods for mathematical functions and another for functional programming routines. As mentioned in my last blog post, this week I also managed to merge another <a href="https://github.com/Quansight-Labs/unumpy/pull/66">PR</a> that picks up on work previously done by one of my mentors. This PR extended the overriding of classes to other backends, more specifically, to Dask and Sparse.</p>
<h2>What is coming up next?</h2>
<p>I will continue the PR started this week by adding more multimethods that target indexing routines. This should be mostly writing default implementations for the new multimethods. Depending on how this goes I might also start a new PR that picks up on work previously started by one of my mentors on adding multimethods for NumPy's random module.</p>
<h2>Did you get stuck anywhere?</h2>
<p>There were no blocks this week, only one test that I could not understand why it was failing. Turns out that uarray, the backend mechanism behind unumpy, was calling the default implementations after these failed in a given backend with the arguments previously marked for dispatching not being coerced into array types. This was fixed on the uarray side by one of my mentors by skipping this last call to the defaults under certain conditions.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Wed, 29 Jul 2020 00:13:47 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-8-check-in-2/Week 7 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-7-check-in-3/<h2>What did you do this week?</h2>
<p>I started a new <a href="https://github.com/Quansight-Labs/unumpy/pull/65">PR</a> that adds multimethods for functional programming routines. The multimethods added are the following:</p>
<ul>
<li><code>apply_along_axis</code></li>
<li><code>apply_over_axes</code></li>
<li><code>frompyfunc</code></li>
<li><code>piecewise</code></li>
</ul>
<p>Other work done this week was mainly adding default implementations to a previous PR that adds multimethods for mathematical functions. I've also managed to finally pick up the work started by one of my mentors that adds an overriding class (this was discussed in previous blog posts). This was done by adding the function <code>overriden_class</code> to both Dask and Sparse backends.</p>
<h2>What is coming up next?</h2>
<p>Next week I will be starting a new PR that adds multimethods for indexing routines and also patch up the ongoing PRs from this week. I will also try to open a new PR that branches off from <a href="http://github.com/Quansight-Labs/unumpy/pull/61">this one</a> and adds the work done this week on the overriding class. When this is merged it will enable me to add some mutlimethods that I've been holding off like <code>nan_to_num</code> and <code>real_if_close</code>.</p>
<h2>Did you get stuck anywhere?</h2>
<p>Trying to understand NumPy's implementations for some mathematical functions like <code>unwrap</code> and <code>interp</code> to implement their defaults was a bit difficult at first but I managed to self unblock. I haven't previously looked at NumPy's code for help on writing defaults but this week I found it to be very helpful although it can also be confusing sometimes (and can feel like cheating). I still didn't fully understand <code>unwraps</code>'s implementation though.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Tue, 21 Jul 2020 02:40:35 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-7-check-in-3/Week 6 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-6-check-in-2/<h2>What did you do this week?</h2>
<p>I started a new <a href="https://github.com/Quansight-Labs/unumpy/pull/64">PR</a> that adds multimethods for mathematical functions. The multimethods that were added are the following:</p>
<p><strong>Trigonometric functions</strong></p>
<ul>
<li><code>degrees</code></li>
<li><code>radians</code></li>
<li><code>unwrap</code></li>
</ul>
<p><strong>Rounding</strong></p>
<ul>
<li><code>around</code> (and its aliase <code>round_</code>)</li>
<li><code>fix</code></li>
</ul>
<p><strong>Sums, products, differences</strong></p>
<ul>
<li><code>cumprod</code></li>
<li><code>cumsum</code></li>
<li><code>nancumprod</code></li>
<li><code>nancumsum</code></li>
<li><code>ediff1d</code></li>
<li><code>cross</code></li>
<li><code>trapz</code></li>
</ul>
<p><strong>Other special functions</strong></p>
<ul>
<li><code>i0</code></li>
<li><code>sinc</code></li>
</ul>
<p><strong>Arithmetic operations</strong></p>
<ul>
<li><code>float_power</code></li>
</ul>
<p><strong>Handling complex numbers</strong></p>
<ul>
<li><code>angle</code></li>
<li><code>real</code></li>
<li><code>imag</code></li>
<li><code>conjugate</code></li>
</ul>
<p><strong>Miscellaneous</strong></p>
<ul>
<li><code>convolve</code></li>
<li><code>clip</code></li>
<li><code>nan_to_num</code></li>
<li><code>real_if_close</code></li>
<li><code>interp</code></li>
</ul>
<p>I've also concluded the PR on array manipulation routines from previous weeks which still had some unresolved issues. It turns out that this week's work was mostly spent patching up the previous PR and less working on the new one unfortunately. This ended up delaying the new PR a bit but since the new one already added quite a few multimethods the schedule is unaffected.</p>
<h2>What is coming up next?</h2>
<p>Continuing the new PR by adding default implementations to the appropriate multimethods and starting a new PR that adds multimethods for functional programming routines. I already did some offline prototyping of default implementations for mathematical functions, the more easy ones at least. The more difficult ones (e.g., <code>unwrap</code>, <code>convolve</code> and <code>interp</code>) should be the focus of that part of next week's work.</p>
<h2>Did you get stuck anywhere?</h2>
<p>There were no major blocks this week. The only issue was the somewhat precedence that the older PR had which prevented the newer one to advance. For example, both PRs had failing tests in the XND backend so this backend was removed (the project is not maintained anymore) in the older PR. Since this has now been merged the newer PR can now receive those changes that fix its failing tests.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Wed, 15 Jul 2020 00:54:56 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-6-check-in-2/Week 5 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-5-check-in-2/<h2>What did you do this week?</h2>
<p>I continued the PR started in the previous week by adding more multimethods for array manipulation. The following multimethods were added:</p>
<p><strong>Tiling arrays</strong></p>
<ul>
<li><code>tile</code></li>
<li><code>repeat</code></li>
</ul>
<p><strong>Adding and removing elements</strong></p>
<ul>
<li><code>delete</code></li>
<li><code>insert</code></li>
<li><code>append</code></li>
<li><code>resize</code></li>
<li><code>trim_zeros</code></li>
</ul>
<p><strong>Rearranging elements</strong></p>
<ul>
<li><code>flip</code></li>
<li><code>fliplr</code></li>
<li><code>flipud</code></li>
<li><code>reshape</code></li>
<li><code>roll</code></li>
<li><code>rot90</code></li>
</ul>
<p>Most of the work was adding default implementations for the above multimethods which relied heavily on array slicing. Contrary to what I mentioned in my last blog post, not much time was dedicated to writing <code>overriden_class</code> for other backends so I will try to compensate in the next weeks.</p>
<h2>What is coming up next?</h2>
<p>As described in my proposal's timeline I'll be starting a new PR that adds multimethods for mathematical functions. This will be the focus of this week's work as some of these multimethods are also needed by sangyx, another GSoC student working on uarray. He is working on the udiff library that uses uarray and unumpy for automatic differentiation. To avoid getting in his way I will try to finish this PR as soon as possible.</p>
<h2>Did you get stuck anywhere?</h2>
<p>There were times when I didn't know exactly how to implement a specific default but this was easily overcome with the help of my mentors who would point me in the right direction. Asking for help sooner rather than later has proven to be invaluable. Looking back I think there were no major blocks this week.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Tue, 07 Jul 2020 15:33:04 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-5-check-in-2/Week 4 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-4-check-in-1/<h2>What did you do this week?</h2>
<p>I started a <a href="https://github.com/Quansight-Labs/unumpy/pull/60">PR</a> that adds multimethods for array manipulation routines. I'll name the multimethods according to the NumPy docs sectioning:</p>
<p><strong>Basic operations</strong></p>
<ul>
<li><code>copyto</code></li>
</ul>
<p><strong>Changing number of dimensions</strong></p>
<ul>
<li><code>expand_dims</code></li>
<li><code>squeeze</code></li>
</ul>
<p><strong>Changing kind of array</strong></p>
<ul>
<li><code>asfarray</code></li>
<li><code>asfortranarray</code></li>
<li><code>asarray_chkfinite</code></li>
<li><code>require</code></li>
</ul>
<p><strong>Joining arrays</strong></p>
<ul>
<li><code>dstack</code></li>
</ul>
<p><strong>Splitting arrays</strong></p>
<ul>
<li><code>split</code></li>
<li><code>array_split</code></li>
<li><code>dsplit</code></li>
<li><code>hsplit</code></li>
<li><code>vsplit</code></li>
</ul>
<p>As mentioned in my last blog post, this week I also started reviewing a <a href="https://github.com/Quansight-Labs/unumpy/pull/61">PR</a> that implements metaclasses from which classes in unumpy instantiate. They are used to override these classes with ones from the backend being used through a property method called <code>overriden_class</code>. Currently only the NumPy backend has this method but I've been trying to implement it in other backends as well.</p>
<ul>
</ul>
<ul>
</ul>
<ul>
</ul>
<h2>What is coming up next?</h2>
<p>The current PR should last one more week since I'll continue to add more multimethods for array manipulation routines. I will also be working on adding <code>overriden_class</code> to other backends as I've been doing this past week.</p>
<h2>Did you get stuck anywhere?</h2>
<p>I think the only place I got stuck was trying to implement <code>overriden_class</code> for other backends. To be more specific, I tried implementing it in the Dask backend first and foremost, however, this backend is different since it uses another backend internally. From my understanding this causes that some classes might have to be overridden by the <code>inner</code> backend and others by Dask itself. With that said, I might need help later on with this issue. In general, I feel that this metaclasses feature has been the most challenging part of my project so far. Although this wasn't initially included in my proposal and can be considered extra work I welcome the challenge and hope that my mentors keep entrusting me more of these features. Also, given that the semester is almost ending I start having more free time on my hands to tackle these problems which is what I want.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Tue, 30 Jun 2020 16:08:50 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-4-check-in-1/Week 3 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-3-check-in-2/<h2>What did you do this week?</h2>
<p>I continued the work started in last week's PR by adding more multimethods on array creation:</p>
<p>Numerical ranges:</p>
<ul>
<li><code>geomspace</code></li>
</ul>
<p>Building matrices:</p>
<ul>
<li><code>diagflat</code></li>
<li><code>tri</code></li>
<li><code>tril</code></li>
<li><code>triu</code></li>
<li><code>vander</code></li>
</ul>
<p>These additions conclude the mentioned PR which at the time of writing this is almost ready to be merged. I also tried to implement a metaclass type for classes in unumpy.</p>
<h2>What is coming up next?</h2>
<p>I'll be starting a new PR that intendes to expand unumpy's coverage of array manipulation routines. The PR is expected to last two weeks given the extensive and diverse nature of the multimethods covered. Also, following the discussion about the inclusion of a metaclass type from which other classes in unumpy instantiate, it's expected that I review a PR by one of my mentors on this. This is a good opportunity for me to start getting used to reviewing PRs. As a note, I think the workload in the next two weeks might increase a bit but as college assignments start to decrease a good balance between the two should stay constant.</p>
<h2>Did you get stuck anywhere?</h2>
<p>The biggest challenge this week was trying to implement the metaclass type. Although I was given some good pointers on how to proceed with this I still faced some problems on doing this correctly. Creating a metaclass with the added difficulty of writing multimethods for its methods was a bit overwhelming. I spent almost an entire day on this and got little results. Looking back I should have asked for help which would surely have helped me unblock. I'll be sure to keep that in mind next time. With that said, I'm still learning the ropes but I already feel that my Python skills are improving significantly.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Mon, 22 Jun 2020 15:20:37 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-3-check-in-2/Week 2 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-2-check-in-6/<h2>What did you do this week?</h2>
<p>This week I started a <a href="https://github.com/Quansight-Labs/unumpy/pull/59">PR</a> that further adds multimethods for array creation routines. I'll name the additions according to the NumPy docs sectioning:</p>
<p>Ones and zeros:</p>
<ul>
<li><code>identity</code></li>
<li><code>ones_like</code></li>
<li><code>zeros_like</code></li>
<li><code>full_like</code></li>
</ul>
<p>From existing data:</p>
<ul>
<li><code>asanyarray</code></li>
<li><code>ascontiguousarray</code></li>
<li><code>copy</code></li>
<li><code>frombuffer</code></li>
<li><code>fromfile</code></li>
<li><code>fromfunction</code></li>
<li><code>fromiter</code></li>
<li><code>fromstring</code></li>
<li><code>loadtxt</code></li>
</ul>
<p>During this week I also started learning about metaclasses in Python. This was encouraged by my mentors as a way to level up my Python skills so that I can tackle more complicated features in unumpy. This was mostly done by reading documentation, posts and articles about the subject and watching one of my mentors code some examples.</p>
<h2>What is coming up next?</h2>
<p>The current PR will be stretched to this upcoming week where I'll be covering more multimethods for these routines. Also, as briefly discussed in my previous blog post, I will eventually be picking up a PR that adds multimethods for the <code>random</code> module. However, as stated in this <a href="https://github.com/Quansight-Labs/uarray/issues/245">issue</a>, classes in unumpy like <code>np.random.RandomState</code> could benefit from a custom metaclass. Given the importance of this feature for current and future implementations additional work during this week will be focused on the creation of this metaclass.</p>
<h2>Did you get stuck anywhere?</h2>
<p>There were some difficulties writing tests for some of these routines as there were a lot of errors that I didn't understand at first. Going over each one separately and writing why I thought they were failing actually helped in fixing some of them. At the time of writing this they are almost all resolved with only one exception.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Mon, 15 Jun 2020 16:55:12 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-2-check-in-6/Week 1 Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/week-1-check-in-5/<h2>What did you do this week?</h2>
<p>I started a new <a href="https://github.com/Quansight-Labs/unumpy/pull/57">PR</a> that adds mathematical constants and mutlimethods for logic routines. These included:</p>
<p>Math constants:</p>
<ul>
<li><code>euler_gamma</code></li>
<li><code>nan</code> and aliases</li>
<li><code>inf</code> and aliases</li>
<li><code>NINF</code></li>
<li><code>PZERO</code></li>
<li><code>NZERO</code></li>
<li><code>newaxis</code></li>
</ul>
<p>Logic functions:</p>
<ul>
<li><code>isposinf</code></li>
<li><code>isneginf</code></li>
<li><code>iscomplex</code></li>
<li><code>iscomplexobj</code></li>
<li><code>isreal</code></li>
<li><code>isrealobj</code></li>
<li><code>isscalar</code></li>
<li><code>array_equal</code></li>
<li><code>array_equiv</code></li>
</ul>
<p>I've also continued to work on the PR started during community bonding. This one also originated a new issue. </p>
<h2>What is coming up next?</h2>
<p>I'll be adding more multimethods, this time addressing routines for <a href="https://numpy.org/doc/stable/reference/routines.array-creation.html">array creation</a>. I've already done <a href="https://github.com/Quansight-Labs/unumpy/pull/54">two multimethods</a> on array creation when I was applying for GSoC which might help this coming week. I'm also thinking about picking up another PR left off by one of my mentors. The one about NumPy's <code>random</code> module seems interesting and challenging. However, this still has to be discussed with my mentors since this was not part of my proposal and it also depends on the available time I'll have. Although I have an exam and a project assignment to deliver I hope to keep a good rhythm going during this week. Let's see how it goes!</p>
<h2>Did you get stuck anywhere?</h2>
<p>I haven't had any major blocks this week. The default implementation for <code>norm</code> in the Linear Algebra module was the toughest as I was trying to implement a simple solution that would take into account all the corner cases. I realized that sometimes an elegant solution is not easily attainable and that correctness is more important. The result was not that bad I hope.</p>
<p>This week was also the start of my weekly meetings with my mentors. We discussed my PRs and other things about the project which was quite helpful. I really appreciate their availability and commitment.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Mon, 08 Jun 2020 00:50:55 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/week-1-check-in-5/Community Bonding Check-inhttps://blogs.python-gsoc.org/en/joaosferreiras-blog/community-bonding-check-in/<h2>What did you do during this period?</h2>
<p>I had an onboarding meeting with my mentors where we got to know each other a bit better. They advised me to play around with <code>uarray</code> and <code>unumpy</code> without any goal in mind which I found to be a very good advice. I played a bit with special methods by implementing a simple <code>Vector2D</code> class and used the code in this <a href="https://github.com/Quansight-Labs/quansight-labs-site/blob/master/posts/2019/07/uarray-update-api-changes-overhead-and-comparison-to-__array_function__.ipynb">notebook</a> with some print statements to understand better the protocols and how they are called. I wanted to start earlier on my project so I took over a <a href="https://github.com/Quansight-Labs/unumpy/pull/56">PR</a> from one of my mentors which adds multimethods for the <code>linalg</code> module.</p>
<h2>What is coming up next?</h2>
<p>I'm going to continue the PR that I have been working on since it still isn't finished and I will also follow the proposed timeline and start adding multimethods for other routines like checking class equality in array elements. Some mathematical constants and their aliases are also missing so I will be adding these too and probably refactoring the existing ones into classes. This week marks the end of my college classes but I still have some assignments and exams coming up in the following weeks so there's a lot of work ahead of me to proper balance both university studies and GSoC but I wouldn't have it other way.</p>
<h2>Did you get stuck anywhere?</h2>
<p>I consider the PR that I started working during this period to be a challenging one since some mathematical intuition is needed to translate Linear Algebra routines into proper functions. Things like decomposition of a matrix into eigenvalues and eigenvectors to calculate its n-th power is something I'm not too familiar with specially in a programming context. With that said there hasn't been a roadblock for me up until now and usually I can wrap my head around these concepts in half a day. It should be noted that mentor help plays a huge part in this as they frequently give me very good advices. Despite that I usually think a lot before doing a commit to make sure that what I'm pushing is correct I notice that I still can't avoid some mistakes, even ones that should be obvious to me. I guess these mistakes are normal and they are corrected soon after so no harm's done but I'm training myself to not do them as often.</p>livingfromtheoutsidein@gmail.com (joaosferreira)Fri, 29 May 2020 15:21:35 +0000https://blogs.python-gsoc.org/en/joaosferreiras-blog/community-bonding-check-in/