Amit Kumar : Life Is Learning!

GSoC : This week in SymPy #4 & #5


Hi there! It’s been five weeks into GSoC, This week, I worked on polishing my previous PR’s to improve coverage and fixing some bugs.

  Progress of Week 4 & 5

During the last couple of weeks my ComplexPlane Class PR #9438 finally got Merged thanks to Harsh for thoroughly reviewing it and suggesting constructive changes.

For this I Managed to improve it’s coverage to perfect 100%, which is indeed satisfying, as it depicts all the new code being pushed is completely tested.

This week I also improved the Exception handling and coverage in my linsolve PR, It also have a 100% coverage.

Coverage Report

  • [1] gauss_jordan_solve 100 %
  • [2] linsolve : 100: %

Ref:

It’s good to be Merged now.

Blocking Issue: Intersection’s of FiniteSet with symbolic elements

During Week 5, While working on transcendental equation solver in solveset.py, I discovered a blocking issue in FiniteSets, which is with the Intersection of FiniteSet containing symbolic elements, for example:

In [2] a = Symbol('a', real=True)

In [3]: FiniteSet(log(a)).intersect(S.Reals)
Out[3]: EmptySet()

Currently, either FiniteSet is able to evaluate intersection otherwise it, returns an EmptySet(). (See 9536 & 8217).

To fix this, I have opened the PR #9540. Currently It fixes both the issues (9536 & 8217), but there are some failing tests using the current behaviour of FiniteSet.

####For example:

In [16]: x, y, z = symbols('x y z', integer=True)

In [19]: f1 = FiniteSet(x, y)

In [20]: f2 = FiniteSet(x, z)
  • In Master:
In [23]: f1.intersect(f2)
Out[23]: {x}
  • It should rather be:
In [5]: f1.intersect(f2)
Out[5]: {x} U Intersection({y}, {x, z})

The current behavior of FiniteSet in Master is non-acceptable, since in the above example x, y, z are integer symbols, so they can be any integer, but in the Master , they are assumed to be distinct, which is wrong. There are such failing tests in test_wester.py here, which is updated here: aktech@e8e6a0b to incorporate with the right behaviour.

As of now there are a couple of failing tests, which needs to passed, before we can Merge #9540

####TODO Failing Tests:

from __future__ import plan Week #6:

This week I plan to Fix Intersection’s of FiniteSet with symbolic elements & start working on LambertW solver in solveset.

$ git log

  PR #9540 : Intersection’s of FiniteSet with symbolic elements

That’s all for now, looking forward for week #6. :grinning: