GSoC Week 1

The First week of the coding period has come to an end, I had a meeting with Jason and Sartaj, my mentors, on 22nd of May. I was going to start working on the Singularity Functions class, so we had a discussion on how to proceed. We exchanged our thoughts on removing the is_real check for the arguments passed through the rewrite(Piecewise) method. We also discussed how we can let the pretty printer prints the derivatives of DiracDelta class. They suggested me to review some Pull Requests of other members in order to encourage them, interact with other community members  and learn. The meeting was quite interesting. We ended up discussing many new things that we can implement.

Progress of Week 1

  • In PR 11139, I was trying to figure out how to pretty print the derivative of DiracDelta class as:-
In [1]: DiracDelta(y, 3)
Out[1]:
 (3)
δ   (y)

Jason helped me to figure out the way. I will try to complete the implementation part by the middle of the next week.

  • In PR 11178, I have started working on the Singularity Functions class. Sartaj suggested me to keep the implementation of pretty printing part for later. Till now I have defined eval(), fdiff(), rewrite(Piecewise) only.
In [2]: SingularityFunction(x, a, n)
Out[2]: SingularityFunction(x, a, n)

In [3]: SingularityFunction(y, 6, 2).diff(y)
Out[3]: 2*SingularityFunction(y, 6, 1)

In [4]: SingularityFunction(x, 4, 5).rewrite(Piecewise)
Out[4]: Piecewise(((x - 4)**5, x - 4 > 0), (0, True))

In [5]: SingularityFunction(x, 3, 2).subs(x, 6)
Out[5]: 9
  • I was reviewing  PR 11065 and have suggested some modifications. The idea of having an another argument for defining the value of Heaviside(0) is great. But at the same time, we can not allow that argument to pass values other than 1 and 1/2.

Next Week

  • Implementation of a method to integrate Singularity Functions.
  • Adding the pretty printing of the derivatives of DiracDelta.

Looking forward toward an another great week. Cheers!

Happy Coding.

GSoC Community Bonding Period Week 4

The last week of Community Bonding period was awesome. From tomorrow onwards, the coding period will begin. I am supposed to start working on my project from tomorrow, but I have done that already from the second week of the Community Bonding Period because I was supposed to take a vacation of 4 days (25 May – 29 May). Due to some issues, I have had to cancel that vacation. Now I have got some more days to work on my project. Let’s see what I have done so far…

So far

  •  PR 10863 had finally got merged.
  •  rewrite(Piecewise) :- In PR 11103, I was trying to solve the  arg = 0 part using solve functionality in sympy. But Jason suggested not to use solve as because there may arise some cases when solve will not be able to provide the desired output. So I kept  the arg = 0 part as  it is.  The story doesn’t end here. There is a confusion regarding keeping the check for whether  arg is real. Personally, I think that check should be there since both Heaviside and DiracDelta is defined only on real axis.
  • In PR 11137, I have improved the doc strings of all the methods under DiracDelta and Heaviside classes. I have added the contextual example for DiracDelta(x, k) and described the relation between fdiff() and diff() . This pull request needs a final review.
  • In PR 11139, I have added the functionality to pretty print the DiracDelta(x) as δ(x). This pull request also needs a final review.
  • Finally, almost every proposed improvement under the issue 11075 is being fulfilled.

Next Week

My plans for next weeks are:-

  • To polish PR 11103PR 11137 and PR 11139 and get them merged.
  • To start working on the implementation of Singularity Functions.

GSoC Community Bonding Period Week 3

Hi there ! This week was great. I got to learn about many new things. I have mentioned in my last post, about my goals for this week, let us see what I have done so far.

So far

  • In PR 10863, implementation of  _eval_expand_diracdelta is almost done . A final review is needed. But at the same time, I was forgetting about the fact that the   simplify  method has to be deprecated in order to make things backwards compatible. Thanks Jason for the suggestion.

I have made the simplify() method call the _eval_expand_diracdelta() method and raise a deprecation warning. I have also added the tests for this method by catching the deprecation warnings properly. The API works like this:-

In [3]: DiracDelta(x*y).simplify(x)
/home/ahappyidiot/anaconda2/bin/ipython:1: SymPyDeprecationWarning: 

simplify has been deprecated since SymPy 1.0.1. Use
expand(diracdelta=True, wrt=x) instead.

  #!/home/ahappyidiot/anaconda2/bin/python
Out[3]: DiracDelta(x)/Abs(y)

These commits are needed to be reviewed properly in order to merge PR 10863.

  •  rewrite(Piecewise) :- In PR 11103, I have implemented a new method under DiracDelta class which would successfully output a Piecewise representation of a DiracDelta Object. For this pull request also, a final review is needed. The API works as:-
In [4]: DiracDelta(x).rewrite(Piecewise)
Out[4]:
⎧  oo       for x = 0
⎨                           
⎩  0        otherwise 

In [4]: DiracDelta(x - 5).rewrite(Piecewise)
Out[4]:
⎧  oo       for x - 5 = 0
⎨                           
⎩  0        otherwise
  • I have also reviewed PR 11065, I personally think that the implementation is a great idea.

Next Week

My plans for next weeks are:-

  • Polish both PR 11103 and  PR 10863 and get these pull requests merged
  • Improve doc strings of the DircaDelta and Heaviside classes and methods.

 

I will again get back by the end of the next week. Cheers !!!

Happy Coding.

GSoC Community Bonding Period Week 2

The second week of the Community Bonding Period got over. Though this post is quite late, I will try to post updates on Fridays of every week.

So far

I had my first meeting with Jason Moore, one of my mentor, on 5th May through Google Hangouts. We had a brief discussion over my proposal. I am taking a head-start for coding along with community bonding. I have started a discussion about the first phase of my proposal. Jason has created an issue tracker for Improvements to DiracDelta and Heaviside.

  • PR 10863 is almost completed only the depreciation part is left.

Almost all the properties of DiracDelta functions has been already implemented in Sympy. But I need to check whether all of them are unit tested and well documented.

Next Week

My targets for this week are:-

  • Polish PR 10863  and get it merged.
  • Implement rewriting DircaDelta  as Piecewise.
  • Improve doc strings of the DircaDelta and Heaviside classes and methods.

I will again get back by the end of this week. Cheers !!!

Happy Coding.

Google Summer of Code with Sympy

About one and half week ago, the results of Google Summer of Code were out. I am extremely glad to inform that my project for Sympy on Implementation of Singularity Functions got selected for GSoC 2016.

Google Summer of Code

Google Summer of Code is a global annual program focused on bringing more student developers into open source software development. It is a global program that offers students stipends to write code for open source projects.

Sympy

SymPy  is a Python library for symbolic mathematics. It aims to become a full-featured Computer Algebra System (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible.

About my Project

I have proposed to work on the Implementation of a full fledged Computer Algebra System (CAS) of Singularity Functions. I will create a module to represent a Singularity Function and implement different mathematical operations. This module will be further used to create an another module which would be used for solving complicated beam bending problems.

Jason Moore, Sartaj Singh and Ondřej Čertík are going to mentor me throughout the whole program. All of them are really talented and very humble people. I have learned a lot from all of them. I am extremely lucky to work under such great people.

Now Community Bonding Period is going on. This is intended to get students ready to start contributing to their organization full time from 23rd May. I am supposed to :

  • Become familiar with the community practices and processes.
  • Participate on Mailing Lists / IRC / etc.
  • Set up your development environment.
  • Small (or large) patches/bug fixes.
  • Participate in code reviews for others.
  • Work with my mentor and other org members on refining my project plan. This might include finalizing deadlines and milestones, adding more detail, figuring out potential issues, etc.

Looking forward toward a great summer.

Cheers!!!