GSOC Journey Blog | Week 1

Published: 06/18/2022

This week, along with the community bonding period brought a lot of learning for me. I got more aware of the vision behind out project and the details of the Codebase.  Being a total beginner to open-source, I had several doubts here and there, but @Ondrej, @Gagandeep and @Naman were extremely patient and helpful throughout.

This week I majorly focused on writing integration tests and a few functions along-side too.


cbrt and exp2 functions implemented #564

I implemented the cube root function and exp2 (exponentialize function) by taking the CPython repository as reference. I also wrote the tests for the same and studied more about writing tests.

This PR wasn’t merged however and these functions aren’t yet implemented in CPython, only their tests have been written to check for TypeError.

Tests for acos, acosh, asin, asinh, atan, atan2, atanh, cos, cosh written

I wrote detailed tests for key values and corner cases for 9 trigonometric functions. However on discussion with @gagandeep we reached the conclusion that we shouldn’t test for individual values, rather a range. 


def test_trig():

   eps: f64 = 1e-12
   assert abs(atan(1.0) - pi/4) < eps

Instead of:

def test_atan():

    assert atan(-1) == -pi/4 , f"assertion error in atan"
    assert atan(0) == 0, f"assertion error in atan"
    assert atan(1) == pi/4, f"assertion error in atan"

Implemented multiple datatypes for pow and fabs functions #581

Currently in our codebase classes or templates are not implemented. So we have to overload for multiple datatypes like i64, i32, i16, i8, f64, f32 etc. Through this I learned how to overload functions.