analyser_hj3415 2.7.3__tar.gz → 2.7.5__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/PKG-INFO +1 -1
  2. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/eval.py +14 -7
  3. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/pyproject.toml +1 -1
  4. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.DS_Store +0 -0
  5. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.gitattributes +0 -0
  6. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.gitignore +0 -0
  7. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.idea/.gitignore +0 -0
  8. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.idea/analyser-hj3415.iml +0 -0
  9. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  10. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.idea/misc.xml +0 -0
  11. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.idea/modules.xml +0 -0
  12. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/.idea/vcs.xml +0 -0
  13. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/LICENSE +0 -0
  14. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/README.md +0 -0
  15. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/.DS_Store +0 -0
  16. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/__init__.py +0 -0
  17. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/cli.py +0 -0
  18. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/__init__.py +0 -0
  19. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/lstm.py +0 -0
  20. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/myprophet.py +0 -0
  21. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/mysklearn.py +0 -0
  22. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/mysklearn2.py +0 -0
  23. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/score.py +0 -0
  24. {analyser_hj3415-2.7.3 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/trash.py +0 -0
@@ -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
@@ -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
 
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "analyser_hj3415"
7
- version = "2.7.3"
7
+ version = "2.7.5"
8
8
  authors = [{name = "Hyungjin Kim", email = "hj3415@gmail.com"}]
9
9
  description = "Stock analyser and database processing programs"
10
10
  readme = "README.md"
File without changes