Skip to content

Commit

Permalink
add posibility to load opts from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
sph3rex committed Jul 5, 2019
1 parent 36c9d31 commit 30fa156
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def run_concurrent_optimize(trader: RLTrader, args):
logger = init_logger(__name__, show_debug=args.debug)
trader = RLTrader(**vars(args), logger=logger)

print(args)

if args.command == 'optimize':
run_concurrent_optimize(trader, args)
elif args.command == 'train':
Expand Down
2 changes: 2 additions & 0 deletions config/config.ini.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Defaults]
mini-batches=11
4 changes: 2 additions & 2 deletions lib/cli/RLTraderCLI.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
import os
import multiprocessing
from configparser import ConfigParser
from configparser import SafeConfigParser


class RLTraderCLI:
Expand All @@ -12,7 +12,7 @@ def __init__(self):
defaults = {}

if args.from_config:
config = ConfigParser.SafeConfigParser()
config = SafeConfigParser()
config.read([args.from_config])
defaults = dict(config.items("Defaults"))

Expand Down

0 comments on commit 30fa156

Please sign in to comment.