Skip to content

Commit

Permalink
Merge pull request #173 from meerk40t/issue-172
Browse files Browse the repository at this point in the history
Fix Issue #172, .github directory
  • Loading branch information
tatarize authored Mar 22, 2022
2 parents 177cf99 + c6b50c5 commit 7a7f419
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 288 deletions.
5 changes: 0 additions & 5 deletions .github/CODEOWNERS

This file was deleted.

68 changes: 0 additions & 68 deletions .github/CODE_OF_CONDUCT.md

This file was deleted.

39 changes: 0 additions & 39 deletions .github/CONTRIBUTING.md

This file was deleted.

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [tatarize]
45 changes: 0 additions & 45 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

91 changes: 0 additions & 91 deletions .github/ISSUE_TEMPLATE/bug_report.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/labeler.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/pull-request-labeler.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ matrix.os }}-python-${{ steps.full-python-version.outputs.version }}
key: new-${{ matrix.os }}-python-${{ steps.full-python-version.outputs.version }}

- name: Install Python dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = svgelements
version = 1.6.10
version = 1.6.11
description = Svg Elements Parsing
long_description_content_type=text/markdown
long_description = file: README.md
Expand Down
6 changes: 3 additions & 3 deletions svgelements/svgelements.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
and the Arc can do exact arc calculations if scipy is installed.
"""

SVGELEMENTS_VERSION = "1.6.10"
SVGELEMENTS_VERSION = "1.6.11"

MIN_DEPTH = 5
ERROR = 1e-12
Expand Down Expand Up @@ -4573,7 +4573,7 @@ def _abs_derivative(t):
return abs(
3 * (p1 - p0) * (1 - t) ** 2
+ 6 * (p2 - p1) * (1 - t) * t
+ 3 * (p3 - p2) * t ** 2
+ 3 * (p3 - p2) * t**2
)

return quad(_abs_derivative, 0.0, 1.0, epsabs=error, limit=1000)[0]
Expand Down Expand Up @@ -7113,7 +7113,7 @@ def _init_points(self, points):
self.points = list()
return
try:
if len(points) == 1:
if len(points) == 1 and isinstance(points[0], (list, tuple, str)):
points = points[0]
except TypeError:
pass
Expand Down
13 changes: 13 additions & 0 deletions test/test_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,19 @@ def test_issue_104(self):
m = SVG.parse(q)
self.assertEqual(len(m), 0)

def test_issue_172(self):
"""
Polylines were checked whether the payload had a length of one and replaced them. However that was wrong
as when the payload was *actually* 1 it made it a point and then did not produce the single point.
"""
p = Polyline(0,0)
q = Polyline(p)
self.assertEqual(len(q), 1)

p = Polygon(0, 0)
q = Polygon(p)
self.assertEqual(len(q), 1)

def test_rect_strict(self):
values = {
'tag': 'rect',
Expand Down

0 comments on commit 7a7f419

Please sign in to comment.