New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Tests for Geometry module #18954
Conversation
✅ Hi, I am the SymPy bot (v158). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.
Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
|
Codecov Report
@@ Coverage Diff @@
## master #18954 +/- ##
=============================================
- Coverage 75.741% 67.704% -8.038%
=============================================
Files 647 647
Lines 168584 168623 +39
Branches 39723 39734 +11
=============================================
- Hits 127688 114165 -13523
- Misses 35344 48896 +13552
- Partials 5552 5562 +10 |
@@ -477,6 +477,10 @@ def test_section_modulus_and_polar_second_moment_of_area(): | |||
assert e.section_modulus() == (18*pi, 6*pi) | |||
assert e.polar_second_moment_of_area() == 120*pi | |||
|
|||
e = Ellipse(Point(0, 0), 2, 2) | |||
assert e.section_modulus() == (2*pi, 2*pi) | |||
assert e.section_modulus(Point(2, 2)) == (2*pi, 2*pi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could test that this method accepts a 2-element tuple with e.section_modulus((2,2))
...after making the change to Ellipse.section_modulus:
else:
# taking x and y as distances of the given point from the center
point = Point(point)
y = point.y - y_c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a nice suggestion, done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smichr I tried this suggestion (commit above) but it altered something in the output, it passes the tests on local but not on Travis CI, could you take a look at it and tell me if you see anything wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in this line, can you correct that also?
Co-Authored-By: Naman Gera <namangera15@gmail.com>
Thanks, this is in. |
There's still a typo here, will deal with it in the next PR. |
Brief description of what is fixed or changed
This adds tests to the Geometry module to increase the test coverage.
Release Notes
NO ENTRY