-
Notifications
You must be signed in to change notification settings - Fork 601
add tests for BaseGeometry._repr_svg_ #1311
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
base: main
Are you sure you want to change the base?
Conversation
@sgillies I prepared this PR so we can get some tests in before changing the SVG functionality. |
Pull Request Test Coverage Report for Build 1813929098
💛 - Coveralls |
import xml.etree.ElementTree as ET | ||
|
||
from . import unittest | ||
from shapely.geometry import Point, MultiPoint, LineString, MultiLineString,\ |
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.
Nit: black would eliminate the forward slash and turn these into a list.
'width="100.0" height="100.0" ' | ||
'viewBox="2.88 3.88 3.24 3.24" preserveAspectRatio="xMinYMin meet">' | ||
'<g transform="matrix(1,0,0,-1,0,11.0)"><g>' | ||
'<circle cx="6.0" cy="7.0" r="0.09720000000000001" ' |
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.
When I see something like that r
value, I worry that it will be platform dependent. On a different system it might be "0.09720000000000002"
.
The most important thing might be to check that we have two circle elements and that their radii are roughly correct?
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.
@jreiberkyle these tests will help a lot! My only concern is that asserting on string representations of floats could be a bit flaky.
This PR adds tests for
BaseGeometry._repr_svg_()
in preparation for changes to the function in #1295.