-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added usage case, put run.py in a function
- Loading branch information
1 parent
3800420
commit 4416ed3
Showing
2 changed files
with
52 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(description='Run EW matcher or output stats') | ||
parser.add_argument('--run', help='Run the EW matcher', action='store_true') | ||
parser.add_argument('--stats', help='Show stats', action='store_true') | ||
from .run import run_matcher | ||
from .stats import output_profit, plot_bal_time_series_graph | ||
from .output import reset_csv | ||
|
||
parser = argparse.ArgumentParser(description='Run EW matcher or output stats', | ||
prog='python3 -m matcher') | ||
parser.add_argument('-r', | ||
'--run', | ||
help='Run the EW matcher', | ||
action='store_true') | ||
parser.add_argument('-s', | ||
'--stats', | ||
help='Display stats and generate graph', | ||
action='store_true') | ||
parser.add_argument('--setup', help='Reset csv', action='store_true') | ||
args = parser.parse_args() | ||
|
||
if args.run: | ||
from .run import * | ||
run_matcher() | ||
|
||
if args.stats: | ||
from .stats import output_profit, plot_bal_time_series_graph | ||
output_profit() | ||
plot_bal_time_series_graph() | ||
|
||
if args.setup: | ||
from .output import reset_csv | ||
reset_csv() | ||
|
||
if len(sys.argv) == 1: | ||
parser.print_help() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters