analyser_hj3415 2.7.3__py2.py3-none-any.whl → 2.7.5__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
analyser_hj3415/eval.py CHANGED
@@ -10,6 +10,7 @@ import logging
10
10
 
11
11
  analyser_logger = helpers.setup_logger('analyser_logger', logging.WARNING)
12
12
 
13
+ expire_time = 3600 * 12
13
14
 
14
15
  class Tools:
15
16
  @staticmethod
@@ -331,16 +332,18 @@ class Red:
331
332
  """
332
333
  redis_name = f"{self.code}_red"
333
334
  analyser_logger.info(f"{self} RedData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
335
+ expire_time = 3600 * 12
336
+ print(f"{self} redisname: '{redis_name}' / expect_earn: {Red.expect_earn} / refresh : {refresh} / expire_time : {expire_time/3600}h")
334
337
 
335
338
  def fetch_generate_data(refresh_in: bool) -> dict:
336
339
  return asdict(self._generate_data(refresh_in))
337
340
 
338
- return RedData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
341
+ return RedData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
339
342
 
340
343
  @classmethod
341
344
  def ranking(cls, expect_earn: float = None, refresh = False) -> OrderedDict:
342
345
  """
343
- redis를 사용하며 red score를 계산해서 0이상의 값을 가지는 종목을 순서대로 저장하여 반환한다.(캐시 유효시간 12시간)
346
+ redis를 사용하며 red score를 계산해서 0이상의 값을 가지는 종목을 순서대로 저장하여 반환한다.
344
347
  :param expect_earn: 기대수익률(일반적으로 0.06 - 0.10)
345
348
  :param refresh: 캐시를 사용하지 않고 강제로 다시 계산
346
349
  :return: OrderedDict([('023590', 101),
@@ -359,7 +362,8 @@ class Red:
359
362
  refresh = True
360
363
 
361
364
  redis_name = 'red_ranking'
362
- print(f"redisname: '{redis_name}' / refresh : {refresh}")
365
+
366
+ print(f"redisname: '{redis_name}' / expect_earn: {expect_earn} / refresh : {refresh} / expire_time : {expire_time/3600}h")
363
367
 
364
368
  def fetch_ranking(expect_earn_in: float, refresh_in: bool) -> dict:
365
369
  data = {}
@@ -378,7 +382,7 @@ class Red:
378
382
  Red.expect_earn = ee_orig
379
383
  return data
380
384
 
381
- data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, expect_earn, refresh, timer=3600 * 12)
385
+ data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, expect_earn, refresh, timer=expire_time)
382
386
 
383
387
  return OrderedDict(sorted(data_dict.items(), key=lambda item: item[1], reverse=True))
384
388
 
@@ -635,11 +639,12 @@ class Mil:
635
639
  """
636
640
  redis_name = f"{self.code}_mil"
637
641
  analyser_logger.info(f"{self} MilData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
642
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
638
643
 
639
644
  def fetch_generate_data(refresh_in: bool) -> dict:
640
645
  return asdict(self._generate_data(refresh_in))
641
646
 
642
- return MilData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
647
+ return MilData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
643
648
 
644
649
 
645
650
  @dataclass()
@@ -806,11 +811,12 @@ class Blue:
806
811
  """
807
812
  redis_name = f"{self.code}_blue"
808
813
  analyser_logger.info(f"{self} BlueData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
814
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
809
815
 
810
816
  def fetch_generate_data(refresh_in: bool) -> dict:
811
817
  return asdict(self._generate_data(refresh_in))
812
818
 
813
- return BlueData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
819
+ return BlueData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
814
820
 
815
821
 
816
822
 
@@ -904,11 +910,12 @@ class Growth:
904
910
  """
905
911
  redis_name = f"{self.code}_growth"
906
912
  analyser_logger.info(f"{self} GrowthData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
913
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
907
914
 
908
915
  def fetch_generate_data(refresh_in: bool) -> dict:
909
916
  return asdict(self._generate_data(refresh_in))
910
917
 
911
- return GrowthData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
918
+ return GrowthData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
912
919
 
913
920
 
914
921
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: analyser_hj3415
3
- Version: 2.7.3
3
+ Version: 2.7.5
4
4
  Summary: Stock analyser and database processing programs
5
5
  Author-email: Hyungjin Kim <hj3415@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  analyser_hj3415/.DS_Store,sha256=qr9-0FPn5CFKe6kEu8_dWCNhzQ0sN7bwQgffKsaJEEo,6148
2
2
  analyser_hj3415/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  analyser_hj3415/cli.py,sha256=IAABc8Q6thB8FhHUeWsA2m6sW3iHtlqNEm80tpgiyCs,11075
4
- analyser_hj3415/eval.py,sha256=0IWTPxf-XG1l0sTwTaF6Jv0Oi8_yIQxPWf6beqc7bnk,38253
4
+ analyser_hj3415/eval.py,sha256=sNvDTLK7V4Bko6KHmbQaW3PWhAll5UDZTEFu_Vr-OQg,38892
5
5
  analyser_hj3415/workroom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  analyser_hj3415/workroom/lstm.py,sha256=O_VYURGNsLw6q_7Yi0nH4Y6nKbVBwzMojDN446cyJKM,4078
7
7
  analyser_hj3415/workroom/myprophet.py,sha256=xGbs4_cCeSNAX62H6rG-bUz6_rUOyO6787WAjLexMkw,1855
@@ -9,8 +9,8 @@ analyser_hj3415/workroom/mysklearn.py,sha256=wJXKz5MqqTzADdG2mqRMMzc_G9RzwYjj5_j
9
9
  analyser_hj3415/workroom/mysklearn2.py,sha256=1lIy6EWEQHkOzDS-av8U0zQH6DuCLKWMI73dnJx5KRs,1495
10
10
  analyser_hj3415/workroom/score.py,sha256=P6nHBJYmyhigGtT4qna4BmNtvt4B93b7SKyzdstJK24,17376
11
11
  analyser_hj3415/workroom/trash.py,sha256=zF-W0piqkGr66UP6-iybo9EXh2gO0RP6R1FnIpsGkl8,12262
12
- analyser_hj3415-2.7.3.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
13
- analyser_hj3415-2.7.3.dist-info/LICENSE,sha256=QVKTp0dTnB5xG8RLgG17LwSWCKNEzYoVVM6KjoCPKc0,1079
14
- analyser_hj3415-2.7.3.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
15
- analyser_hj3415-2.7.3.dist-info/METADATA,sha256=81ZgZ02EDV8eSOlkF9sFuzMXVMlXEiry65m7RONRKWc,6417
16
- analyser_hj3415-2.7.3.dist-info/RECORD,,
12
+ analyser_hj3415-2.7.5.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
13
+ analyser_hj3415-2.7.5.dist-info/LICENSE,sha256=QVKTp0dTnB5xG8RLgG17LwSWCKNEzYoVVM6KjoCPKc0,1079
14
+ analyser_hj3415-2.7.5.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
15
+ analyser_hj3415-2.7.5.dist-info/METADATA,sha256=hRDaUXQFor19fIf0dnIF0GuAfR2eCQK6zbMegNFxd8o,6417
16
+ analyser_hj3415-2.7.5.dist-info/RECORD,,