-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add some more __str__ function to geometry classes for pretty print #1289
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4dd2def
Add __str__ to frame and plane
yck011522 073a2ab
Fixes broken Pointcloud.from_box
yck011522 d7c3dd5
Fixes ValueError:
yck011522 e4d965e
Update __repr__ and __str__ methods in Color, Pointcloud, Polygon, an…
yck011522 cef3f8e
black and lint
yck011522 5b3a267
Add __str__ method to Quaternion class
yck011522 d2b2f65
Use str() instead of calling dunder within dunder
yck011522 03f79a9
changelog
yck011522 ac0e8ce
pointcloud
yck011522 bc0c649
Merge branch 'main' into yck011522/issue1287
yck011522 25d1d70
Update CHANGELOG.md
yck011522 af7720c
Update CHANGELOG.md
yck011522 4d325f6
Merge branch 'main' into yck011522/issue1287
yck011522 f5fa387
black
yck011522 13e77de
Fix Quaternion comparison test in test_quaternion_other_methods
yck011522 7c52617
test pointcloud
yck011522 2f3c0c2
bug
yck011522 bf90aba
tests for str and repr
yck011522 3d25912
Test __str___ but not __repr__
yck011522 31224fa
remove __str__ tests,
yck011522 7d65bbb
ipy special
yck011522 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
import json | ||
import compas | ||
from random import random | ||
from compas.geometry import Point | ||
from compas.geometry import Polyhedron | ||
from compas.itertools import pairwise | ||
|
||
|
||
def test_polyhedron(): | ||
vertices = [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]] | ||
faces = [[0, 1, 2, 3]] | ||
name = "Test Polyhedron" | ||
polyhedron = Polyhedron(vertices, faces, name) | ||
|
||
assert polyhedron.vertices == vertices | ||
assert polyhedron.faces == faces | ||
assert polyhedron.name == name | ||
assert polyhedron.points == vertices | ||
assert polyhedron.lines == [(a, b) for a, b in pairwise(vertices + vertices[:1])] | ||
assert polyhedron.points[0] == vertices[0] | ||
assert polyhedron.points[-1] != polyhedron.points[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This change is not related to the str stuff, is it?
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.
The change is there because I couldn't actually run tests without fixing the broken functions.