Update doc (#20)
* Add list.py and desc * add operations * add structure * update readme * format * update readme
This commit is contained in:
33
scenarionet/list.py
Normal file
33
scenarionet/list.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import pkgutil
|
||||
import importlib
|
||||
import argparse
|
||||
|
||||
desc = "List all available operations"
|
||||
|
||||
|
||||
def list_modules(package):
|
||||
ret = [name for _, name, _ in pkgutil.iter_modules(package.__path__)]
|
||||
ret.remove("builder")
|
||||
ret.remove("converter")
|
||||
ret.remove("verifier")
|
||||
ret.remove("common_utils")
|
||||
return ret
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import scenarionet
|
||||
|
||||
# exclude current path
|
||||
# print(d)
|
||||
parser = argparse.ArgumentParser(description=desc)
|
||||
parser.parse_args()
|
||||
modules = list_modules(scenarionet)
|
||||
print("\nAvailable operations (usage python -m scenarionet.operation): \n")
|
||||
for module in modules:
|
||||
# module="convert_nuplan"
|
||||
print(
|
||||
"{}scenarionet.{}: {} \n".format(
|
||||
" " * 5, module,
|
||||
importlib.import_module("scenarionet.{}".format(module)).desc
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user