Taichi: [CLI] Run examples from CLI (e.g. `python3 -m taichi example mpm88`)

Created on 14 Apr 2020  路  7Comments  路  Source: taichi-dev/taichi

Concisely describe the proposed feature
While implementing #740, I realized maybe it will be helpful for users to directly run the examples after they install taichi, without download any other files. This can be implemented via something like

python3 -m taichi example game_of_life
python3 -m taichi example stable_fluids
python3 -m taichi example mpm88
feature request welcome contribution

All 7 comments

I guess ln -s ../examples python/?
Btw, how about also taichi.tests.XXX?

I think it's easier if we simply add an example command toti/python -m taichi.

We also want user able to see/modify the example codes for better convinence.

I think it's easier if we simply add an example command toti/python -m taichi.

It sounds like a good starting point for me to understand how Taichi CLI is engineered, so I'd like to pick up this task if it's not taken yet.

I think it's easier if we simply add an example command toti/python -m taichi.

It sounds like a good starting point for me to understand how Taichi CLI is engineered, so I'd like to pick up this task if it's not taken yet.

Thank you for helping with this! This will simplify how end-users run Taichi examples. Just two notes:

Thanks for the pointers!!

Yeah, it's probably better to move away from the elif cases and take advantage of the built-in argparse, and let it populate the help messages for us... For examples, i was thinking about using the data_files originally, let me take a closer look into build.py. Also, I will make sure to open draft PR at the early stage so folks can stop me before it's going off normal :)

Finally we can close this, thanks to the great contribution by @rexwangcc.

Was this page helpful?
0 / 5 - 0 ratings