analyser_hj3415 2.9.14__tar.gz → 2.9.16__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.14
3
+ Version: 2.9.16
4
4
  Summary: Stock analyser and database processing programs
5
5
  Requires-Python: >=3.6
6
6
  Description-Content-Type: text/markdown
@@ -235,7 +235,7 @@ class MyProphet:
235
235
  if isinstance(top, int):
236
236
  return OrderedDict(list(ranking.items())[:top])
237
237
  else:
238
- raise ValueError("top 인자는 int 형이어야 합니다.")
238
+ raise ValueError("top 인자는 'all' 이나 int 이어야 합니다.")
239
239
 
240
240
  @dataclass
241
241
  class LSTMData:
@@ -671,9 +671,21 @@ class MyLSTM:
671
671
  plt.title('Stock Price Prediction with LSTM Ensemble')
672
672
  plt.show()"""
673
673
 
674
+ def is_up(self)-> Optional[bool]:
675
+ # 튜플의 [0]은 날짜 [1]은 값 배열
676
+ if myredis.Base.exists(f'{self.code}_mylstm_predictions'):
677
+ data = self.get_final_predictions(refresh=False, expire_time_h=24)[1]
678
+ # 데이터를 1D 배열로 변환
679
+ flattened_data = data.flatten()
680
+ tsa_logger.debug(f"flattened_data : {flattened_data}")
681
+ # 증가 여부 확인
682
+ return all(flattened_data[i] < flattened_data[i + 1] for i in range(len(flattened_data) - 1))
683
+ else:
684
+ return None
685
+
674
686
  @staticmethod
675
687
  def caching_based_on_prophet_ranking(refresh: bool, expire_time_h: int, top=20):
676
- ranking_topn = OrderedDict(itertools.islice(MyProphet.ranking(refresh=False).items(), top))
688
+ ranking_topn = MyProphet.ranking(refresh=False, top=top)
677
689
  tsa_logger.info(ranking_topn)
678
690
  mylstm = MyLSTM('005930')
679
691
  print(f"*** LSTM prediction redis cashing top{top} items ***")
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
5
5
 
6
6
  [project]
7
7
  name = "analyser_hj3415"
8
- version = "2.9.14"
8
+ version = "2.9.16"
9
9
  description = "Stock analyser and database processing programs"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.6"