Skip to content

Commit ec7ccbf

Browse files
author
zhangyongsheng
committed
fix python2 pip安装失败
1 parent c86eef8 commit ec7ccbf

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2019-03-18
2+
- MANIFEST.in添加md文件
3+
14
# 2019-03-12
25
- 添加因子分层效果接口
36
- 添加通用请求接口

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
include *.txt
2+
include *.md

jqdatasdk/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def auth_by_token(token, host="39.107.190.114", port=7000):
2121
JQDataClient.set_auth_params(host=host, port=port, token=token)
2222

2323

24-
__version__ = "1.6.0"
24+
__version__ = "1.6.1"
2525

2626
__all__ = ["auth", "auth_by_token", "alpha101", "alpha191", "technical_analysis", "__version__"]
2727
__all__.extend(api.__all__)

tests/test_api.py

+23-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
import pytest
66
import numpy as np
77
import pandas as pd
8-
from pandas.tslib import Timestamp
98
from jqdatasdk import *
109

1110
logging.basicConfig()
1211
log = logging
1312

1413

1514
with open("/home/server/etc/jqdatasdk/import_debug_account.py") as f:
16-
exec(f.read())
15+
exec(f.read())
1716

1817
def test_get_index_stocks():
1918
assert len(get_index_stocks('000300.XSHG')) == 300
@@ -575,7 +574,7 @@ def test_ticks():
575574
assert len(get_ticks("NI1804.XSGE", end_dt="2018-03-16", count=100)) == 100
576575
assert get_ticks("NI1804.XSGE", end_dt="2018-03-16", count=10, fields=["current", "volume", "position", "a1_v", "a1_p", "b1_v", "b1_p"]).shape == (10, 7)
577576
assert len(get_ticks("000001.XSHE", end_dt="2018-03-16", count=10)) == 10
578-
assert get_ticks("SM1809.XZCE", '2018-07-06', '2018-07-07').iloc[3][0] == Timestamp('2018-07-06 09:00:01.500000')
577+
assert str(get_ticks("SM1809.XZCE", '2018-07-06', '2018-07-07').iloc[3][0]) == '2018-07-06 09:00:01.500000'
579578
assert get_ticks("000001.XSHE", end_dt="2018-03-16", count=10, fields=["a1_v", "a2_v", "a3_v", "a4_v", "a5_v", "b1_v", "b2_v", "b3_v", "b4_v", "b5_v"]).shape == (10, 10)
580579

581580

@@ -640,6 +639,26 @@ def test_finance_tables():
640639
assert finance.STK_MONEY_FLOW != None
641640
with pytest.raises(Exception, message='finance 没有该表'):
642641
finance.STK
642+
df = finance.run_query(query(finance.STK_STATUS_CHANGE))
643+
stk_status_change_columns = ["id", "company_id", "code", "name",
644+
"pub_date", "change_date", "change_reason",
645+
"change_type_id", "change_type", "comments",
646+
"public_status_id", "public_status"]
647+
assert set(stk_status_change_columns) - set(df.columns) == set()
648+
df = finance.run_query(query(finance.STK_FIN_FORCAST))
649+
stk_fin_forcast_columns = ["id", "company_id", "code", "name",
650+
"end_date", "report_type_id", "report_type",
651+
"pub_date", "type_id", "type", "profit_min",
652+
"profit_max", "profit_last", "profit_ratio_min",
653+
"profit_ratio_max", "content",]
654+
assert set(stk_fin_forcast_columns) - set(df.columns) == set()
655+
df = finance.run_query(query(finance.STK_LIST))
656+
stk_list_columns = ["id", "code", "name", "short_name",
657+
"category", "exchange", "start_date",
658+
"end_date", "company_id", "company_name",
659+
"ipo_shares", "book_price", "par_value",
660+
"state_id", "state", "status"]
661+
assert set(stk_list_columns) - set(df.columns) == set(["status"])
643662

644663

645664
def test_get_factor_values():
@@ -835,4 +854,4 @@ def test_get_data():
835854
def test_api_limit():
836855
alpha191.alpha_001("000001.XSHE", end_date="2018-03-10")
837856
with pytest.raises(Exception) as e:
838-
alpha191.alpha_001("000001.XSHE", end_date="2018-03-10")
857+
alpha191.alpha_001("000001.XSHE", end_date="2018-03-10")

0 commit comments

Comments
 (0)