Phase 1 of my GSoC Project: The Conical Wrapping Geometry: First PR
Meet with Mentor
The primary mentor assigned to me for my GSoC project is Hwayeon Kang, a well-established contributor and maintainer of SymPy who started off as a GSoC 2024 contributor too! We planned our first meeting through email, and it was a success!
We decided that it would be better to start implementation earlier, as the math research in later phases may take extra time, and also because my proposal did not contain every detail about how I would code my ideas.
Phase 1 : Geodesics on a Cone
This phase involves implementing the first of the three classes, the WrappingCone
class. As you can guess from the name, this class allows forces to follow the path on the surface of a cone.
The good thing about a right circular cone is that it is a developable surface: one that can be unfolded isometrically into a 2D plane. Thus, the geodesic length has a closed form: the distance between any two points on the cone is just the straight-line distance between those points when projected onto that plane. The challenge is only in getting the math right.
So I started with the class, inheriting from WrappingGeometryBase
. I noticed something interesting: this abstract base class had a property called point
, meant to be “the point with which this geometry is associated.” But for a cone, I prefer to think of that as the apex. Still, I had to implement the point
property even though the name felt off. It reminded me that real-world inheritance hierarchies rarely match the tidy theory we learn in textbooks.
I put up my first PR, in which I set up the basic class structure and implemented the point_on_surface(point)
method. In it, I check whether a point satisfies the cone equation:
\[ x^2 + y^2 = z^2 \tan^2(\alpha) \]
I also tested all my code by writing a test class TestWrappingCone
, which introduced me to pytest and its wonderful “parametric testing” which really reduced the repetitive testing code that I was initially expecting.