Skip to content
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

DM-31254: Update polygon test and add explanation. #615

Merged
merged 1 commit into from Nov 5, 2021

Conversation

erykoff
Copy link
Contributor

@erykoff erykoff commented Nov 5, 2021

No description provided.

disp.line((p1, p2))
# Some computations of the image area have such large aliasing
# in boost::intersection that the precision required here is 0.025.
self.assertAlmostEqual(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expressing this as assertFloatsAlmostEqual with rtol would allow you to get both areas printed in case of a failure, wouldn't it?

@@ -121,7 +121,12 @@ void addSubSampledEdge(std::vector<LsstPoint>& vertices, // Vector of points to
/// @internal Calculate area of overlap between polygon and pixel
double pixelOverlap(BoostPolygon const& poly, int const x, int const y) {
std::vector<BoostPolygon> overlap; // Overlap between pixel and polygon
LsstBox const pixel(lsst::geom::Point2D(x - 0.5, y - 0.5), lsst::geom::Point2D(x + 0.5, y + 0.5));
LsstBox const pixel(lsst::geom::Point2D((double) x - 0.5, (double) y - 0.5),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use C++ style static_cast<double>(x).

@erykoff erykoff merged commit 816bf87 into master Nov 5, 2021
@erykoff erykoff deleted the tickets/DM-31254 branch November 5, 2021 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants