siat 2.13.20__py3-none-any.whl → 2.13.21__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
siat/common.py CHANGED
@@ -2294,6 +2294,7 @@ def sround(a,decimal=4):
2294
2294
  #==============================================================================
2295
2295
  if __name__=='__main__':
2296
2296
  file='stooq.py'
2297
+ package='pandas_datareader'
2297
2298
 
2298
2299
  def fix_package(file='stooq.py',package='pandas_datareader'):
2299
2300
  """
@@ -2319,7 +2320,7 @@ def fix_package(file='stooq.py',package='pandas_datareader'):
2319
2320
  srcfile=srcpath1+'/'+file
2320
2321
  else:
2321
2322
  srcpath1=srcpath
2322
- srcfile=srcpath1+'\\'+file
2323
+ srcfile=srcpath1+'/'+file
2323
2324
 
2324
2325
  #目标地址
2325
2326
  cmdstr1='import '+package
@@ -2334,7 +2335,7 @@ def fix_package(file='stooq.py',package='pandas_datareader'):
2334
2335
  objfile=objpath1+'/'+file
2335
2336
  else:
2336
2337
  objpath1=objpath
2337
- objfile=objpath1+'\\'+file
2338
+ objfile=objpath1+'/'+file
2338
2339
 
2339
2340
  #复制文件
2340
2341
  from shutil import copyfile
@@ -2345,7 +2346,7 @@ def fix_package(file='stooq.py',package='pandas_datareader'):
2345
2346
  result=copyfile(srcfile,objfile)
2346
2347
  except IOError as e:
2347
2348
  print(" #Error(fix_package): Unable to copy file. %s" % e)
2348
- print(" Program failed becos of operating system permission denied.")
2349
+ print(" Program failed most likely becos of incorrect source/target directories.")
2349
2350
  print(" Solution: manually copy the file",srcfile,"to the folder",objpath1)
2350
2351
  #exit(1)
2351
2352
  except:
siat/grafix.py CHANGED
@@ -113,8 +113,18 @@ def plot_line(df0,colname,collabel,ylabeltxt,titletxt,footnote,datatag=False, \
113
113
  ax.xaxis.set_major_formatter(mdate.DateFormatter(date_fmt))
114
114
  plt.xticks(pd.date_range(date_start,date_end,freq=date_freq))
115
115
 
116
+ if ylabeltxt != '' or ylabeltxt == "stooq_MB":
117
+ collabel=''
118
+ if ylabeltxt == "stooq_MB":
119
+ ylabeltxt=''
120
+
116
121
  plt.plot(df.index,df[colname],'-',label=collabel, \
117
122
  linestyle='-',color='blue', linewidth=2)
123
+
124
+ haveLegend=True
125
+ if collabel == '':
126
+ haveLegend=False
127
+
118
128
  #绘制数据标签
119
129
  if datatag:
120
130
  for x, y in zip(df.index, df[colname]):
@@ -137,22 +147,27 @@ def plot_line(df0,colname,collabel,ylabeltxt,titletxt,footnote,datatag=False, \
137
147
  if isinstance(zeroline,bool):#若zeroline为True
138
148
  if zeroline:
139
149
  hline=0
140
- plt.axhline(y=hline,ls=":",c="black",linewidth=2)
150
+ plt.axhline(y=hline,ls=":",c="green",linewidth=2,label="零线")
151
+ haveLegend=True
141
152
  else:
142
153
  if isinstance(zeroline,float) or isinstance(zeroline,int):
143
154
  hline=zeroline
144
- plt.axhline(y=hline,ls=":",c="black",linewidth=3,label="关键值")
155
+ plt.axhline(y=hline,ls=":",c="darkorange",linewidth=3,label="关注值")
156
+ haveLegend=True
157
+ footnote=footnote + ",关注值"+str(hline)
145
158
 
146
159
  if average_value:
147
160
  av=df[colname].mean()
148
- plt.axhline(y=av,ls="dashed",c="gray",linewidth=2,label="均值")
161
+ plt.axhline(y=av,ls="dashed",c="blueviolet",linewidth=2,label="均值")
162
+ haveLegend=True
163
+ footnote=footnote + ",均值"+str(round(av,2))
149
164
 
150
165
  #绘制趋势线
151
166
  #print("--Debug(plot_line): power=",power)
152
167
  if power > 0:
153
168
  lang=check_language()
154
- #trend_txt='趋势线'
155
- trend_txt=''
169
+ trend_txt='趋势线'
170
+ #trend_txt=''
156
171
  if lang == 'English':
157
172
  trend_txt='Trend line'
158
173
 
@@ -165,15 +180,16 @@ def plot_line(df0,colname,collabel,ylabeltxt,titletxt,footnote,datatag=False, \
165
180
  parameter = np.polyfit(df.id, df[colname], power)
166
181
  f = np.poly1d(parameter)
167
182
  plt.plot(df.index, f(df.id),"r--", label=trend_txt,linewidth=1)
183
+ haveLegend=True
168
184
  except:
169
185
  print(" Warning(plot_line): failed to converge trend line, try a smaller power.")
170
186
 
171
- if ylabeltxt != '':
172
- plt.legend(loc=loc,fontsize=legend_txt_size)
187
+ if ylabeltxt != '' or average_value or isinstance(zeroline,bool):
188
+ if haveLegend:
189
+ plt.legend(loc=loc,fontsize=legend_txt_size)
190
+
173
191
  plt.gcf().autofmt_xdate() # 优化标注(自动倾斜)
174
-
175
- if average_value:
176
- footnote=footnote + ",均值"+str(round(av,2))
192
+
177
193
  plt.ylabel(ylabeltxt,fontsize=ylabel_txt_size)
178
194
  plt.xlabel(footnote,fontsize=xlabel_txt_size)
179
195
  plt.title(titletxt,fontweight='bold',fontsize=title_txt_size)
siat/stock.py CHANGED
@@ -643,7 +643,7 @@ def security_indicator(ticker,indicator,fromdate,todate, \
643
643
  tickersplit=ticker.split('.')
644
644
  if (len(tickersplit) > 1) and (indicator == 'Close'):
645
645
  if tickersplit[1].upper() in ['M','B']:
646
- ylabeltxt=""
646
+ ylabeltxt="stooq_MB" #特殊标志,告知绘图函数不显示某些标记
647
647
 
648
648
  if 'Ret%' in indicator:
649
649
  zeroline=True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 2.13.20
3
+ Version: 2.13.21
4
4
  Summary: Securities Investment Analysis Tools (siat)
5
5
  Home-page: https://pypi.org/project/siat/
6
6
  Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
@@ -15,7 +15,7 @@ siat/bond_test.py,sha256=yUOFw7ddGU-kb1rJdnsjkJWziDNgUR7OLDA7F7Ub91A,5246
15
15
  siat/capm_beta.py,sha256=cqbmfM4mrq73Ub0bq5QjWJjmJHj9x7-dSqbmNxnEj7k,28946
16
16
  siat/capm_beta_test.py,sha256=ImR0c5mc4hIl714XmHztdl7qg8v1E2lycKyiqnFj6qs,1745
17
17
  siat/cmat_commons.py,sha256=Nj9Kf0alywaztVoMVeVVL_EZk5jRERJy8R8kBw88_Tg,38116
18
- siat/common.py,sha256=HOom7FK_U2iVcU3_Q5gF6bIuc-tt1L_sDkfTyNDXzCg,81903
18
+ siat/common.py,sha256=QOKGCaxREeCtHjvQZPNIFmBRgMyBeUA4A-gUJSYFHi0,81947
19
19
  siat/compare_cross.py,sha256=-MZzxmX8_9oFZ7X0IcR51w87EWwssbitiw-BcmHMFzQ,26228
20
20
  siat/compare_cross_test.py,sha256=xra5XYmQGEtfIZL2h-GssdH2hLdFIhG3eoCrkDrL3gY,3473
21
21
  siat/concepts_iwencai.py,sha256=m1YEDtECRT6FqtzlKm91pt2I9d3Z_XoP59BtWdRdu8I,3061
@@ -57,7 +57,7 @@ siat/future_china.py,sha256=F-HsIf2Op8Z22RzTjet1g8COzldgnMjFNSXsAkeGyWo,17595
57
57
  siat/future_china_test.py,sha256=BrSzmDVaOHki6rntOtosmRn-6dkfOBuLulJNqh7MOpc,1163
58
58
  siat/global_index_test.py,sha256=hnFp3wqqzzL-kAP8mgxDZ54Bd5Ijf6ENi5YJlGBgcXw,2402
59
59
  siat/google_authenticator.py,sha256=ZUbZR8OW0IAKDbcYtlqGqIpZdERpFor9NccFELxg9yI,1637
60
- siat/grafix.py,sha256=OoXtaqMeJyvycclViIbGsyTiMQnpjD_JVpQ0d0V4T94,68796
60
+ siat/grafix.py,sha256=NAw6VzTuxg0LIAyzJ8_lmT4X8-TNPJ8v2vAyat-y_o4,69287
61
61
  siat/grafix_test.py,sha256=kXvcpLgQNO7wd30g_bWljLj5UH7bIVI0_dUtXbfiKR0,3150
62
62
  siat/holding_risk.py,sha256=Dh4zXEw-0hnbMNorbsRS142C8mUzq4NhFjYnauWu5tc,30548
63
63
  siat/holding_risk_test.py,sha256=FRlw_9wFG98BYcg_cSj95HX5WZ1TvkGaOUdXD7-V86s,474
@@ -95,7 +95,7 @@ siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,
95
95
  siat/security_trend.py,sha256=rWYjeR-KONBdJB7Va96gVieci2bOIxkc87rvqxZ80P4,15367
96
96
  siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
97
97
  siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
98
- siat/stock.py,sha256=4E32deoCxPA-ssCQDot-qsNCLn8AwNky6pnPuO4PGhk,140270
98
+ siat/stock.py,sha256=aK9yVfb6367v7OXT81WoumMhvNksROa51mC3Taw-AC4,140334
99
99
  siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
100
100
  siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
101
101
  siat/stock_china.py,sha256=B1hbZCxJuE5GVvGGmf_rSmQodYHmEFuyiDrUvxHhg4w,83969
@@ -126,7 +126,7 @@ siat/valuation.py,sha256=3VKrO9b9xY9dOJGGuF0ZhytzB5d2pCx3kO3TtMml7mo,44025
126
126
  siat/valuation_china.py,sha256=oEQRrktJNHiOG1mJSQN1aSSQAQrwrg-ppIHyNVjMjNg,67603
127
127
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
128
128
  siat/var_model_validation.py,sha256=zB_Skk_tmzIR15l6oAW3am4HBGVIG-eZ8gJhCdXZ8Qw,14859
129
- siat-2.13.20.dist-info/METADATA,sha256=TTuIwmlqzXqIFAUJrfpByZYxXm-QK8V7Mc3uNAh8ZoA,1449
130
- siat-2.13.20.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
131
- siat-2.13.20.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
132
- siat-2.13.20.dist-info/RECORD,,
129
+ siat-2.13.21.dist-info/METADATA,sha256=o2xK5jJvotka-h75LzHUJmVCmkAxJATgohFYPgXn988,1449
130
+ siat-2.13.21.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
131
+ siat-2.13.21.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
132
+ siat-2.13.21.dist-info/RECORD,,
File without changes