analyser_hj3415 3.3.1__py3-none-any.whl → 3.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- analyser_hj3415/analyser/compile.py +18 -16
- analyser_hj3415/cli.py +18 -11
- {analyser_hj3415-3.3.1.dist-info → analyser_hj3415-3.4.0.dist-info}/METADATA +1 -1
- {analyser_hj3415-3.3.1.dist-info → analyser_hj3415-3.4.0.dist-info}/RECORD +6 -6
- {analyser_hj3415-3.3.1.dist-info → analyser_hj3415-3.4.0.dist-info}/WHEEL +0 -0
- {analyser_hj3415-3.3.1.dist-info → analyser_hj3415-3.4.0.dist-info}/entry_points.txt +0 -0
@@ -113,20 +113,21 @@ class MICompile:
|
|
113
113
|
return mi_compile_data
|
114
114
|
|
115
115
|
@staticmethod
|
116
|
-
def
|
116
|
+
def caching_mi_compile_all(refresh: bool):
|
117
117
|
"""
|
118
|
-
모든 MI(Market Index)에 대해
|
118
|
+
모든 MI(Market Index)에 대해 MICompileData를 캐싱합니다..
|
119
119
|
|
120
120
|
매개변수:
|
121
121
|
refresh (bool): 데이터를 새로 가져올지 여부.
|
122
122
|
"""
|
123
|
-
|
124
|
-
print(f"***
|
123
|
+
mi_compile = MICompile('WTI')
|
124
|
+
print(f"*** MICompileData caching Market Index items ***")
|
125
125
|
for mi_type in MIs._fields:
|
126
|
-
|
127
|
-
print(f"{
|
128
|
-
|
129
|
-
|
126
|
+
mi_compile.mi_type = mi_type
|
127
|
+
print(f"{mi_type}")
|
128
|
+
mi_compile_data = mi_compile.get(refresh=refresh)
|
129
|
+
print(mi_compile_data)
|
130
|
+
|
130
131
|
|
131
132
|
@dataclass
|
132
133
|
class CorpCompileData:
|
@@ -214,7 +215,7 @@ class CorpCompile:
|
|
214
215
|
|
215
216
|
def get(self, refresh=False) -> CorpCompileData:
|
216
217
|
"""
|
217
|
-
기업 데이터를
|
218
|
+
기업 데이터를 컴파일하여 캐시에 저장하거나 캐시에서 가져옵니다.
|
218
219
|
|
219
220
|
매개변수:
|
220
221
|
refresh (bool): 데이터를 새로 가져올지 여부.
|
@@ -335,9 +336,9 @@ class CorpCompile:
|
|
335
336
|
raise ValueError("top 인자는 'all' 이나 int형 이어야 합니다.")
|
336
337
|
|
337
338
|
@staticmethod
|
338
|
-
def
|
339
|
+
def caching_corp_compile_topn(refresh: bool, top=40):
|
339
340
|
"""
|
340
|
-
상위 N개의 기업에 대해
|
341
|
+
상위 N개의 기업에 대해 CorpCompileData를 수집합니다..
|
341
342
|
|
342
343
|
매개변수:
|
343
344
|
refresh (bool): 데이터를 새로 가져올지 여부.
|
@@ -345,9 +346,10 @@ class CorpCompile:
|
|
345
346
|
"""
|
346
347
|
ranking_topn = CorpCompile.prophet_ranking(refresh=False, top=top)
|
347
348
|
mylogger.info(ranking_topn)
|
348
|
-
|
349
|
-
print(f"***
|
349
|
+
corp_compile = CorpCompile('005930')
|
350
|
+
print(f"*** CorpCompile redis cashing top{top} items ***")
|
350
351
|
for i, (code, _) in enumerate(ranking_topn.items()):
|
351
|
-
|
352
|
-
print(f"{i + 1}. {
|
353
|
-
|
352
|
+
corp_compile.code = code
|
353
|
+
print(f"{i + 1}. {code}")
|
354
|
+
corp_compile_data = corp_compile.get(refresh=refresh)
|
355
|
+
print(corp_compile_data)
|
analyser_hj3415/cli.py
CHANGED
@@ -10,6 +10,16 @@ def analyser_manager():
|
|
10
10
|
parser = argparse.ArgumentParser(description="Analyser Commands")
|
11
11
|
type_subparsers = parser.add_subparsers(dest='type', help='분석 타입')
|
12
12
|
|
13
|
+
# compile 명령어 서브파서
|
14
|
+
compile_parser = type_subparsers.add_parser('compile', help='Compile 타입')
|
15
|
+
compile_subparser = compile_parser.add_subparsers(dest='command', help='Compile 관련된 명령')
|
16
|
+
# compile - caching 파서
|
17
|
+
caching_parser = compile_subparser.add_parser('caching', help='lstm 랭킹 책정 및 레디스 저장')
|
18
|
+
caching_parser.add_argument('-r', '--refresh', action='store_true', help='래디스 캐시를 사용하지 않고 강제로 재계산 할지')
|
19
|
+
caching_parser.add_argument('-mi', '--market_index', action='store_true', help='Market index도 캐싱할지')
|
20
|
+
caching_parser.add_argument('-t', '--top', type=int, help='prophet ranking 몇위까지 작업을 할지')
|
21
|
+
|
22
|
+
|
13
23
|
# prophet 명령어 서브파서
|
14
24
|
prophet_parser = type_subparsers.add_parser('prophet', help='MyProphet 타입')
|
15
25
|
prophet_subparser = prophet_parser.add_subparsers(dest='command', help='prophet 관련된 명령')
|
@@ -24,11 +34,6 @@ def analyser_manager():
|
|
24
34
|
# lstm 명령어 서브파서
|
25
35
|
lstm_parser = type_subparsers.add_parser('lstm', help='MyLSTM 타입')
|
26
36
|
lstm_subparser = lstm_parser.add_subparsers(dest='command', help='lstm 관련된 명령')
|
27
|
-
# lstm - caching 파서
|
28
|
-
caching_parser = lstm_subparser.add_parser('caching', help='lstm 랭킹 책정 및 레디스 저장')
|
29
|
-
caching_parser.add_argument('-r', '--refresh', action='store_true', help='래디스 캐시를 사용하지 않고 강제로 재계산 할지')
|
30
|
-
caching_parser.add_argument('-mi', '--market_index', action='store_true', help='Market index도 캐싱할지')
|
31
|
-
caching_parser.add_argument('-t', '--top', type=int, help='prophet ranking 몇위까지 작업을 할지')
|
32
37
|
# lstm - predict 파서
|
33
38
|
lstm_get_parser = lstm_subparser.add_parser('predict', help='lstm get final prediction 시행')
|
34
39
|
lstm_get_parser.add_argument('target', type=str, help=f'종목코드 or {list(MIs._fields)}')
|
@@ -187,20 +192,22 @@ def analyser_manager():
|
|
187
192
|
print(myprophet.generate_data(refresh=args.refresh).score)
|
188
193
|
# mymongo.Logs.save('cli','INFO', f'run >> analyser prophet get {args.target}')
|
189
194
|
|
190
|
-
elif args.type == '
|
195
|
+
elif args.type == 'compile':
|
191
196
|
if args.command == 'caching':
|
192
|
-
mymongo.Logs.save('cli', 'INFO', f'run >> analyser
|
197
|
+
mymongo.Logs.save('cli', 'INFO', f'run >> analyser compile caching')
|
193
198
|
try:
|
194
199
|
if args.top:
|
195
|
-
compile.CorpCompile.
|
200
|
+
compile.CorpCompile.caching_corp_compile_topn(refresh=args.refresh, top=args.top)
|
196
201
|
else:
|
197
|
-
compile.CorpCompile.
|
202
|
+
compile.CorpCompile.caching_corp_compile_topn(refresh=args.refresh)
|
198
203
|
if args.market_index:
|
199
|
-
compile.MICompile.
|
204
|
+
compile.MICompile.caching_mi_compile_all(refresh=args.refresh)
|
200
205
|
except Exception as e:
|
201
206
|
print(e)
|
202
207
|
mymongo.Logs.save('cli','ERROR', f'analyser lstm caching 실행중 에러 - {e}')
|
203
|
-
|
208
|
+
|
209
|
+
elif args.type == 'lstm':
|
210
|
+
if args.command == 'predict':
|
204
211
|
mi_type = str(args.target).upper()
|
205
212
|
if mi_type in MIs._fields:
|
206
213
|
mylstm = tsa.MILSTM(mi_type)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
analyser_hj3415/__init__.py,sha256=jqHEUoBeihYOMaS0bPOe3nRVXBufZ0clxc6M6jxPY0o,320
|
2
|
-
analyser_hj3415/cli.py,sha256=
|
2
|
+
analyser_hj3415/cli.py,sha256=dnmhYBucWWNYsnyf0xVHcx87j7rciG7T2omD3_oGiYk,12300
|
3
3
|
analyser_hj3415/analyser/__init__.py,sha256=N0XyBfWJNpDS_6JYziKETWePO_jtFB1m7E8Qbwt1w0Q,1096
|
4
|
-
analyser_hj3415/analyser/compile.py,sha256=
|
4
|
+
analyser_hj3415/analyser/compile.py,sha256=wMTuVadcSODHjjTP5ma_GuygujqCeYDQkad2rAsCprw,12535
|
5
5
|
analyser_hj3415/analyser/eval/__init__.py,sha256=IP1d0Q3nOCAD3zK1qxrC685MkJQfUh-qaXc7xptTxk8,80
|
6
6
|
analyser_hj3415/analyser/eval/blue.py,sha256=p9_ddqLMJGq5HSn6NApuLhrX29qD--AASig9F71eb8I,10952
|
7
7
|
analyser_hj3415/analyser/eval/common.py,sha256=sNXapoofShA43ww_SLjXmIjkrAr1AhAcezdaN_X_3Us,11443
|
@@ -17,7 +17,7 @@ analyser_hj3415/workroom/mysklearn.py,sha256=wJXKz5MqqTzADdG2mqRMMzc_G9RzwYjj5_j
|
|
17
17
|
analyser_hj3415/workroom/mysklearn2.py,sha256=1lIy6EWEQHkOzDS-av8U0zQH6DuCLKWMI73dnJx5KRs,1495
|
18
18
|
analyser_hj3415/workroom/score.py,sha256=P6nHBJYmyhigGtT4qna4BmNtvt4B93b7SKyzdstJK24,17376
|
19
19
|
analyser_hj3415/workroom/trash.py,sha256=zF-W0piqkGr66UP6-iybo9EXh2gO0RP6R1FnIpsGkl8,12262
|
20
|
-
analyser_hj3415-3.
|
21
|
-
analyser_hj3415-3.
|
22
|
-
analyser_hj3415-3.
|
23
|
-
analyser_hj3415-3.
|
20
|
+
analyser_hj3415-3.4.0.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
|
21
|
+
analyser_hj3415-3.4.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
22
|
+
analyser_hj3415-3.4.0.dist-info/METADATA,sha256=NNilJQn-1nlk0lwDdKM7tlntRtg6c9Yk65iVPyofVHg,6777
|
23
|
+
analyser_hj3415-3.4.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|