Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rqalpha的2.1.4版本无法再cmd使用plot参数画图 #109

Closed
xtsfullstack opened this issue Apr 26, 2017 · 3 comments
Closed

rqalpha的2.1.4版本无法再cmd使用plot参数画图 #109

xtsfullstack opened this issue Apr 26, 2017 · 3 comments
Assignees

Comments

@xtsfullstack
Copy link

xtsfullstack commented Apr 26, 2017

rqalpha的2.1.4

python 2.x

问题描述:
在了使用 生成的pkl文件进行画图的时候,报找不到pkl文件的问题,希望得到解答,谢谢。
在使用 0.3.x版本的时候,这个功能还是很正常的

在Windows和Linux都尝试过

我的执行命令

rqalpha plot ./1.pkl --show

错误日志

Traceback (most recent call last):
  File "c:\programdata\anaconda2\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\programdata\anaconda2\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
         │       └ {'__builtins__': <module '__builtin__' (built-in)>, '__file__': 'C:\ProgramData\Anaconda2\Scripts\rqalpha.exe\__main__.py',...
qalpha.exe\__main__.py", line 2>> at 0256EA40, file "C:\ProgramData\Anaconda2\Scripts
  File "C:\ProgramData\Anaconda2\Scripts\rqalpha.exe\__main__.py", line 9, in <module>
    sys.exit(entry_point())
    │        └ <function entry_point at 0x047D1CF0>
    └ <module 'sys' (built-in)>
  File "c:\programdata\anaconda2\lib\site-packages\rqalpha\__main__.py", line 66, in entry_point
    cli(obj={})
    └ <click.core.Group object at 0x047CFE90>
  File "c:\programdata\anaconda2\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
           │          │       └ {'obj': {'VERBOSE': 0}}
           │          └ ()
           └ <click.core.Group object at 0x047CFE90>
  File "c:\programdata\anaconda2\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
         │           └ <click.core.Context object at 0x0482CC10>
         └ <click.core.Group object at 0x047CFE90>
  File "c:\programdata\anaconda2\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
           │               │                      └ <click.core.Context object at 0x0482CE50>
           │               └ <click.core.Context object at 0x0482CE50>
           └ <function _process_result at 0x0482D5B0>
  File "c:\programdata\anaconda2\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           │          │                └ <click.core.Context object at 0x0482CE50>
           │          └ <click.core.Command object at 0x0482CF50>
           └ <click.core.Context object at 0x0482CE50>
  File "c:\programdata\anaconda2\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
           │         │       └ {'result_pickle_file_path': u'./1.pkl', 'plot_save_file': None, 'show': True}
           │         └ ()
           └ <function plot at 0x0482D830>
TypeError: plot() got an unexpected keyword argument 'result_pickle_file_path'
@wh1100717 wh1100717 added the bug label Apr 26, 2017
@wh1100717
Copy link
Member

wh1100717 commented Apr 26, 2017

确认是个bug

rqlpah/mod/rqalpha_mod_sys_analyser/__init__.py 文件中

@cli.command()
@click.argument('result_pickle_file_path', type=click.Path(exists=True), required=True)
@click.option('--show/--hide', 'show', default=True)
@click.option('--plot-save', 'plot_save_file', default=None, type=click.Path(), help="save plot result to file")
def plot(result_dict_file, show, plot_save_file):
    """
    [sys_analyser] draw result DataFrame
    """
    import pandas as pd
    from .plot import plot_result

    result_dict = pd.read_pickle(result_dict_file)
    plot_result(result_dict, show, plot_save_file)

其中 plot 的函数输入参数有误,应该改为 result_pickle_file_path

@wh1100717
Copy link
Member

@xtsfullstack 已修复并提交到develop 分支 下一个版本会发布会修复这个问题

@wh1100717 wh1100717 self-assigned this Apr 27, 2017
@wh1100717
Copy link
Member

2.2.0 已发布

@wh1100717 wh1100717 added the fixed label May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants