analyser_hj3415 2.9.6__tar.gz → 2.9.7__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: analyser_hj3415
3
- Version: 2.9.6
3
+ Version: 2.9.7
4
4
  Summary: Stock analyser and database processing programs
5
5
  Requires-Python: >=3.6
6
6
  Description-Content-Type: text/markdown
@@ -55,6 +55,7 @@ def analyser_manager():
55
55
  # caching 파서
56
56
  caching_parser = lstm_subparser.add_parser('caching', help='lstm 랭킹 책정 및 레디스 저장')
57
57
  caching_parser.add_argument('-r', '--refresh', action='store_true', help='래디스 캐시를 사용하지 않고 강제로 재계산 할지')
58
+ caching_parser.add_argument('-t', '--top', type=int, help='prophet ranking 몇위까지 작업을 할지')
58
59
  caching_parser.add_argument('-n', '--noti', action='store_true', help='작업 완료 후 메시지 전송 여부')
59
60
  # red - get 파서
60
61
  lstm_get_parser = lstm_subparser.add_parser('get', help='lstm get 책정 및 레디스 저장')
@@ -224,9 +225,12 @@ def analyser_manager():
224
225
  noti.telegram_to('manager', "오늘의 prophet ranking을 레디스캐시에 저장했습니다.(유효 24시간)")
225
226
  elif args.type == 'lstm':
226
227
  if args.command == 'caching':
227
- result = tsa.MyLSTM('005930').caching_based_on_prophet_ranking(refresh=args.refresh)
228
+ if args.top:
229
+ tsa.MyLSTM.caching_based_on_prophet_ranking(refresh=args.refresh, top=args.top)
230
+ else:
231
+ tsa.MyLSTM.caching_based_on_prophet_ranking(refresh=args.refresh)
228
232
  if args.noti:
229
- noti.telegram_to('manager', "오늘의 lstm caching을 레디스캐시에 저장했습니다.(유효 24시간)")
233
+ noti.telegram_to('manager', f"오늘의 lstm caching(top={args.top if args.top else 20})을 레디스캐시에 저장했습니다.(유효 24시간)")
230
234
  elif args.command == 'get':
231
235
  assert utils.is_6digit(args.code), "code 인자는 6자리 숫자이어야 합니다."
232
236
  result = tsa.MyLSTM(args.code).get_final_predictions(refresh=args.refresh)
@@ -661,14 +661,16 @@ class MyLSTM:
661
661
  plt.title('Stock Price Prediction with LSTM Ensemble')
662
662
  plt.show()"""
663
663
 
664
- def caching_based_on_prophet_ranking(self, refresh: bool, top=20):
664
+ @staticmethod
665
+ def caching_based_on_prophet_ranking(refresh: bool, top=20):
665
666
  ranking_topn = OrderedDict(itertools.islice(MyProphet.ranking().items(), top))
666
667
  tsa_logger.info(ranking_topn)
668
+ mylstm = MyLSTM('005930')
667
669
  print(f"*** LSTM prediction redis cashing top{top} items ***")
668
670
  for i, (code, _) in enumerate(ranking_topn.items()):
669
- print(f"{i+1}. {self.code}/{self.name}")
670
- self.code = code
671
- self.get_final_predictions(refresh=refresh, num=5)
671
+ mylstm.code = code
672
+ print(f"{i+1}. {mylstm.code}/{mylstm.name}")
673
+ mylstm.get_final_predictions(refresh=refresh, num=5)
672
674
 
673
675
 
674
676
 
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
5
5
 
6
6
  [project]
7
7
  name = "analyser_hj3415"
8
- version = "2.9.6"
8
+ version = "2.9.7"
9
9
  description = "Stock analyser and database processing programs"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.6"