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

Transfer of Chemist #302: Better change_input API #264

Closed
ryanmrichard opened this issue Aug 18, 2022 · 1 comment
Closed

Transfer of Chemist #302: Better change_input API #264

ryanmrichard opened this issue Aug 18, 2022 · 1 comment

Comments

@ryanmrichard
Copy link
Member

I think this issue makes more sense here so I copy/pasted it (and I guess you can't use the transfer issue API to move an issue from a private repo to a public repo).

The C++ signature is: template <typename T> void Module::change_input(const std::string&, T&& value). T is an implicit template type parameter (i.e., C++ doesn't require you to specify it). So in C++ I can do something like:

mod.change_input("Number of iterations", 100);

But from Python I need to do:

mod.change_input["unsigned int"]("Number of iterations", 100)

The need to implicitly set the type is very non-Pythonic.

@wadejong
Copy link
Contributor

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

No branches or pull requests

2 participants