analyser_hj3415 2.7.4__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.4 → analyser_hj3415-2.7.5}/PKG-INFO +1 -1
  2. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/eval.py +14 -11
  3. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/pyproject.toml +1 -1
  4. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.DS_Store +0 -0
  5. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.gitattributes +0 -0
  6. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.gitignore +0 -0
  7. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.idea/.gitignore +0 -0
  8. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.idea/analyser-hj3415.iml +0 -0
  9. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  10. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.idea/misc.xml +0 -0
  11. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.idea/modules.xml +0 -0
  12. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/.idea/vcs.xml +0 -0
  13. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/LICENSE +0 -0
  14. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/README.md +0 -0
  15. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/.DS_Store +0 -0
  16. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/__init__.py +0 -0
  17. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/cli.py +0 -0
  18. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/__init__.py +0 -0
  19. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/lstm.py +0 -0
  20. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/myprophet.py +0 -0
  21. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/mysklearn.py +0 -0
  22. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/mysklearn2.py +0 -0
  23. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.5}/analyser_hj3415/workroom/score.py +0 -0
  24. {analyser_hj3415-2.7.4 → 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.4
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,17 +332,18 @@ class Red:
331
332
  """
332
333
  redis_name = f"{self.code}_red"
333
334
  analyser_logger.info(f"{self} RedData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
334
- print(f"{self} redisname: '{redis_name}' / expect_earn: {Red.expect_earn} / 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")
335
337
 
336
338
  def fetch_generate_data(refresh_in: bool) -> dict:
337
339
  return asdict(self._generate_data(refresh_in))
338
340
 
339
- 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))
340
342
 
341
343
  @classmethod
342
344
  def ranking(cls, expect_earn: float = None, refresh = False) -> OrderedDict:
343
345
  """
344
- redis를 사용하며 red score를 계산해서 0이상의 값을 가지는 종목을 순서대로 저장하여 반환한다.(캐시 유효시간 12시간)
346
+ redis를 사용하며 red score를 계산해서 0이상의 값을 가지는 종목을 순서대로 저장하여 반환한다.
345
347
  :param expect_earn: 기대수익률(일반적으로 0.06 - 0.10)
346
348
  :param refresh: 캐시를 사용하지 않고 강제로 다시 계산
347
349
  :return: OrderedDict([('023590', 101),
@@ -360,7 +362,8 @@ class Red:
360
362
  refresh = True
361
363
 
362
364
  redis_name = 'red_ranking'
363
- print(f"redisname: '{redis_name}' / expect_earn: {expect_earn} / refresh : {refresh}")
365
+
366
+ print(f"redisname: '{redis_name}' / expect_earn: {expect_earn} / refresh : {refresh} / expire_time : {expire_time/3600}h")
364
367
 
365
368
  def fetch_ranking(expect_earn_in: float, refresh_in: bool) -> dict:
366
369
  data = {}
@@ -379,7 +382,7 @@ class Red:
379
382
  Red.expect_earn = ee_orig
380
383
  return data
381
384
 
382
- 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)
383
386
 
384
387
  return OrderedDict(sorted(data_dict.items(), key=lambda item: item[1], reverse=True))
385
388
 
@@ -636,12 +639,12 @@ class Mil:
636
639
  """
637
640
  redis_name = f"{self.code}_mil"
638
641
  analyser_logger.info(f"{self} MilData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
639
- print(f"{self} redisname: '{redis_name}' / refresh : {refresh}")
642
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
640
643
 
641
644
  def fetch_generate_data(refresh_in: bool) -> dict:
642
645
  return asdict(self._generate_data(refresh_in))
643
646
 
644
- 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))
645
648
 
646
649
 
647
650
  @dataclass()
@@ -808,12 +811,12 @@ class Blue:
808
811
  """
809
812
  redis_name = f"{self.code}_blue"
810
813
  analyser_logger.info(f"{self} BlueData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
811
- print(f"{self} redisname: '{redis_name}' / refresh : {refresh}")
814
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
812
815
 
813
816
  def fetch_generate_data(refresh_in: bool) -> dict:
814
817
  return asdict(self._generate_data(refresh_in))
815
818
 
816
- 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))
817
820
 
818
821
 
819
822
 
@@ -907,12 +910,12 @@ class Growth:
907
910
  """
908
911
  redis_name = f"{self.code}_growth"
909
912
  analyser_logger.info(f"{self} GrowthData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
910
- print(f"{self} redisname: '{redis_name}' / refresh : {refresh}")
913
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
911
914
 
912
915
  def fetch_generate_data(refresh_in: bool) -> dict:
913
916
  return asdict(self._generate_data(refresh_in))
914
917
 
915
- 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))
916
919
 
917
920
 
918
921
 
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "analyser_hj3415"
7
- version = "2.7.4"
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