summaryrefslogtreecommitdiffstats
path: root/estimate.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-23 21:28:52 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-23 21:28:52 +0800
commit4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a (patch)
treeef3aa9a083ec59ec17928f90aade1f79e7e16ba3 /estimate.py
parentf06159167fc105e9433e52a0d1eec410ccbaf71d (diff)
downloadtrainer-4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a.tar.gz
trainer-4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a.tar.xz
trainer-4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a.zip
add main to estimate.py
Diffstat (limited to 'estimate.py')
-rwxr-xr-x[-rw-r--r--]estimate.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/estimate.py b/estimate.py
index 6ba0471..3ca48db 100644..100755
--- a/estimate.py
+++ b/estimate.py
@@ -59,7 +59,10 @@ def walkThroughModels(path):
for onefile in files:
filepath = os.path.join(root, onefile)
if onefile.endswith(config.getModelPostfix()):
+ subpath = os.path.relpath(filepath, path)
+ print("Processing " + subpath)
handleOneModel(filepath)
+ print("Processed " + subpath)
elif onefile.endswith(config.getStatusPostfix()):
pass
elif onefile.endswith(config.getIndexPostfix()):
@@ -134,4 +137,20 @@ def sortModels(indexname, sortedindexname):
utils.store_status(sortedindexfilestatuspath, sortedindexfilestatus)
if __name__ == '__main__':
- pass
+ parser = ArgumentParser(description='Estimate model candidates.')
+ parser.add_argument('--modeldir', action='store', \
+ help='model directory', \
+ default=config.getModelDir())
+
+ args = parser.parse_args()
+ print(args)
+ print("estimating")
+ walkThroughModels(args.modeldir)
+ print("gathering")
+ indexname = os.path.join(args.modeldir, config.getEstimateIndex())
+ gatherModels(args.modeldir, indexname)
+ print("sorting")
+ sortedindexname = os.path.join(args.modeldir, \
+ config.getSortedEstimateIndex())
+ sortModels(indexname, sortedindexname)
+ print("done")