You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing the arguments from ti example ... to the example scripts. e.g.:
ti example stable_fluid -S
I would like this command to pass the arg -S to the stable_fluid.py file and be parsed later.
Describe the solution you'd like (if any)
Actually, the current implementation will pass the args to the examples, however, unrecognized arguments will stop the ti example CLI program. This is because we are using ArgumentParser.parse_args():
A possible solution is: use ArgumentParser.parse_known_args() and only pass the sys.args[2:] to the downstream.
Additional comments
Note that, if we use ArgumentParser.parse_known_args(), we have to carefully check the args for ti example, since we need to give a user-friendly CLI error prompt.
The text was updated successfully, but these errors were encountered:
Concisely describe the proposed feature
Passing the arguments from
ti example ...
to the example scripts. e.g.:I would like this command to pass the arg
-S
to thestable_fluid.py
file and be parsed later.Describe the solution you'd like (if any)
Actually, the current implementation will pass the args to the examples, however, unrecognized arguments will stop the
ti example
CLI program. This is because we are usingArgumentParser.parse_args()
:taichi/python/taichi/main.py
Line 183 in a866aad
A possible solution is: use
ArgumentParser.parse_known_args()
and only pass the sys.args[2:] to the downstream.Additional comments
Note that, if we use
ArgumentParser.parse_known_args()
, we have to carefully check the args forti example
, since we need to give a user-friendly CLI error prompt.The text was updated successfully, but these errors were encountered: