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

invalid kwargs specification should throw an error now #99

Merged
merged 7 commits into from
Nov 14, 2023
Merged

Conversation

behinger
Copy link
Member

@behinger behinger commented Nov 13, 2023

this should introduce an error when running something like
plot_abc(...;visual = (bla=blub))
that is, not providing a NamedTuple because you forgot the ;

@behinger behinger requested a review from vladdez November 13, 2023 18:31
@behinger
Copy link
Member Author

mhh CI fails. maybe there are some special cases we have to manually loop the kwarg through

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would propose the following message:

Keyword argument specification (kwargs...) Specified config groups must be NamedTuples', but $(keys(kwargs)[.!is_namedtuple]) was not.
Maybe you forgot the semicolon (;) at the beginning of your specification? Compare these strings:

plot_example(...; layout = (; showColorbar=true))

plot_example(...; layout = (showColorbar=true))
 
 The first is correct and creates a NamedTuple as required. The second is wrong and is ignored.`

@vladdez
Copy link
Collaborator

vladdez commented Nov 14, 2023

I will merge because the problem is test_all and it is solved in main version (I hope)

@vladdez vladdez merged commit 859da2b into main Nov 14, 2023
1 of 2 checks passed
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.

2 participants