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

Bugfix: correct array dimension in transform check #37

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

JJMinton
Copy link
Collaborator

@JJMinton JJMinton commented Oct 9, 2024

What?

This PR corrects a bug in an array comparison in the Shape.transform method.

Two regression smoke tests are also added to ensure this method runs through.

Why?

In the Shape.transform method, a comparison is performed to check for the identity transform. Currently, this has mismatching dimensions with the expected transform array resulting in the following error:

ValueError: operands could not be broadcast together with shapes (3,4) (4,4)

This renders this method unusable.

@JJMinton JJMinton requested a review from JoeLambourne October 9, 2024 01:57
@Late-March
Copy link

Late-March commented Oct 9, 2024 via email

Copy link
Contributor

@JoeLambourne JoeLambourne left a comment

Choose a reason for hiding this comment

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

Thank you. Yes. This is a bug. Forcing a user of the function to sanity check homogeneous matrix transforms is sensible.

src/occwl/shape.py Show resolved Hide resolved
@JJMinton JJMinton merged commit b140609 into main Oct 9, 2024
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.

3 participants