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

immutable points #40

Closed
shimwell opened this issue Jul 21, 2021 · 2 comments
Closed

immutable points #40

shimwell opened this issue Jul 21, 2021 · 2 comments
Assignees

Comments

@shimwell
Copy link
Member

Currently the points are manipulated after input by the user. An end point the same as the first point is added and in some cases connection types are added.

The consequences are that if a variable called points are use to create a shape then the Shape.points will not be equal to the input points.

This limits the reuse of points across components.

A simple test was created that currently fails.

  def test_reuse_points(self):
      """Checks that points can be reused between shapes"""
      points = [
          (100, 0),
          (200, 0),
          (250, 50),
          (200, 100),
      ]
      test_shape = paramak.Shape(
          points=points
      )
      
      assert test_shape.points == [
          (100, 0),
          (200, 0),
          (250, 50),
          (200, 100),
      ]

The input points should not be changed and the a second processed_points can be used internally

@shimwell shimwell self-assigned this Jul 21, 2021
@shimwell shimwell mentioned this issue Jul 21, 2021
10 tasks
@shimwell
Copy link
Member Author

def test_reuse_points(self):
"""Checks that points can be reused between shapes"""
points = [
(100, 0),
(200, 0),
(250, 50),
(200, 100),
]
test_shape = paramak.RotateStraightShape(
points=points,
)

assert test_shape.points == [
(100, 0),
(200, 0),
(250, 50),
(200, 100),
]

@shimwell
Copy link
Member Author

solved with #41

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 a pull request may close this issue.

1 participant