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

Change tuples of kwargs to lists #124

Merged
merged 2 commits into from
Jun 28, 2024
Merged

Change tuples of kwargs to lists #124

merged 2 commits into from
Jun 28, 2024

Conversation

connoramoreno
Copy link
Collaborator

Changes the tuple of strings against which keyword arguments are checked to a list format.

Fixes #123.

@gonuke
Copy link
Member

gonuke commented Jun 28, 2024

Since these are all read only, this shouldn't make a difference

@@ -95,7 +95,7 @@ def __init__(

self.scale = m2cm

for name in kwargs.keys() & ('scale'):
for name in kwargs.keys() & ['scale']:
Copy link
Member

Choose a reason for hiding this comment

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

Sometimes single strings are treated as lists... not sure if that's the problem, but if it is, I don't think this will fix it.

One fix is to add a dangling comma after the string, inside the list/tuple

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can confirm that changing the tuple to a list fixes the issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding a trailing comma also works though.

Copy link
Member

Choose a reason for hiding this comment

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

I think I like the tuple better because of the way it communicates immutability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fair enough, I've reverted to tuples but used a trailing comma for SourceMesh.

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Thanks for finding/fixing this @connoramoreno - looks like we need more testing :)

@gonuke gonuke merged commit ed476a3 into main Jun 28, 2024
1 check passed
@connoramoreno connoramoreno deleted the kwargs-hotfix branch July 8, 2024 18:20
connoramoreno pushed a commit that referenced this pull request Sep 10, 2024
Change tuples of `kwargs` to lists
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.

scale not properly set for SourceMesh
2 participants