ygo 1.0.11__py3-none-any.whl → 1.1.1__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.

Potentially problematic release.


This version of ygo might be problematic. Click here for more details.

ycat/qdf/__init__.py DELETED
@@ -1,530 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- ---------------------------------------------
4
- Created on 2025/3/5 21:40
5
- @author: ZhangYundi
6
- @email: yundi.xxii@outlook.com
7
- ---------------------------------------------
8
- """
9
- from __future__ import annotations
10
-
11
- import math
12
- from functools import wraps
13
-
14
- import polars as pl
15
-
16
- from .qdf import QDF
17
-
18
-
19
- def signature(function):
20
- @wraps(function)
21
- def wrapper(*args, **kwargs):
22
- args = [str(arg) for arg in args]
23
- for k, v in kwargs.items():
24
- args.append(f"{k}={v}")
25
- string = f"{function.__name__}({', '.join(args)})"
26
- return string
27
-
28
- return wrapper
29
-
30
-
31
- def from_polars(df: pl.DataFrame, index: tuple[str] = ("date", "time", "asset"), align: bool = True, ) -> QDF:
32
- """polars dataframe 转为 表达式数据库"""
33
- return QDF(df, index, align,)
34
-
35
-
36
- @signature
37
- def abs(expr: str): ...
38
-
39
-
40
- @signature
41
- def log(expr: str, base=math.e): ...
42
-
43
-
44
- @signature
45
- def sqrt(expr: str): ...
46
-
47
-
48
- @signature
49
- def square(expr: str): ...
50
-
51
-
52
- @signature
53
- def cube(expr: str): ...
54
-
55
-
56
- @signature
57
- def cbrt(expr: str): ...
58
-
59
-
60
- @signature
61
- def sin(expr: str): ...
62
-
63
-
64
- @signature
65
- def sinh(expr: str): ...
66
-
67
-
68
- @signature
69
- def arcsin(expr: str): ...
70
-
71
-
72
- @signature
73
- def arcsinh(expr: str): ...
74
-
75
-
76
- @signature
77
- def cos(expr: str): ...
78
-
79
-
80
- @signature
81
- def cosh(expr: str): ...
82
-
83
-
84
- @signature
85
- def arccos(expr: str): ...
86
-
87
-
88
- @signature
89
- def arccosh(expr: str): ...
90
-
91
-
92
- @signature
93
- def tan(expr: str): ...
94
-
95
-
96
- @signature
97
- def tanh(expr: str): ...
98
-
99
-
100
- @signature
101
- def arctan(expr: str): ...
102
-
103
-
104
- @signature
105
- def arctanh(expr: str): ...
106
-
107
-
108
- @signature
109
- def sign(expr: str): ...
110
-
111
-
112
- @signature
113
- def sigmoid(expr: str): ...
114
-
115
-
116
- @signature
117
- def cot(expr: str): ...
118
-
119
-
120
- @signature
121
- def degrees(expr: str): ...
122
-
123
-
124
- @signature
125
- def ind_entropy(expr: str, windows: int): ...
126
-
127
- @signature
128
- def d_entropy(expr: str, windows: int): ...
129
-
130
- @signature
131
- def cs_entropy(expr: str, windows: int): ...
132
-
133
- @signature
134
- def ts_entropy(expr: str, windows: int): ...
135
-
136
-
137
- @signature
138
- def exp(expr: str): ...
139
-
140
-
141
- @signature
142
- def log1p(expr: str): ...
143
-
144
-
145
- @signature
146
- def clip(expr: str, lower_bound, upper_bound): ...
147
-
148
-
149
- @signature
150
- def cs_ufit(expr: str): ...
151
-
152
-
153
- @signature
154
- def cs_rank(expr: str): ...
155
-
156
-
157
- @signature
158
- def cs_demean(expr: str): ...
159
-
160
-
161
- @signature
162
- def cs_mean(expr: str): ...
163
-
164
-
165
- @signature
166
- def cs_mid(expr: str): ...
167
-
168
-
169
- @signature
170
- def cs_moderate(expr: str): ...
171
-
172
-
173
- @signature
174
- def cs_qcut(expr: str, N: int = 10): ...
175
-
176
-
177
- @signature
178
- def cs_ic(left: str, right: str): ...
179
-
180
-
181
- @signature
182
- def cs_corr(left: str, right: str): ...
183
-
184
-
185
- @signature
186
- def cs_std(expr: str): ...
187
-
188
-
189
- @signature
190
- def cs_var(expr: str): ...
191
-
192
-
193
- @signature
194
- def cs_skew(expr: str): ...
195
-
196
-
197
- @signature
198
- def cs_slope(left: str, right: str): ...
199
-
200
-
201
- @signature
202
- def cs_resid(left: str, right: str): ...
203
-
204
-
205
- @signature
206
- def cs_zscore(expr: str): ...
207
-
208
-
209
- @signature
210
- def cs_midby(expr: str, *by: str): ...
211
-
212
-
213
- @signature
214
- def cs_meanby(expr: str, *by: str): ...
215
-
216
-
217
- @signature
218
- def cs_max(expr: str): ...
219
-
220
-
221
- @signature
222
- def cs_min(expr: str): ...
223
-
224
-
225
- @signature
226
- def cs_peakmax(expr: str): ...
227
-
228
-
229
- @signature
230
- def cs_peakmin(expr: str): ...
231
-
232
-
233
- @signature
234
- def ts_mean(expr: str, windows: int): ...
235
-
236
-
237
- @signature
238
- def ts_std(expr: str, windows: int): ...
239
-
240
-
241
- @signature
242
- def ts_sum(expr: str, windows: int): ...
243
-
244
-
245
- @signature
246
- def ts_var(expr: str, windows: int): ...
247
-
248
-
249
- @signature
250
- def ts_skew(expr: str, windows: int): ...
251
-
252
-
253
- @signature
254
- def ts_ref(expr: str, windows: int): ...
255
-
256
-
257
- @signature
258
- def ts_mid(expr: str, windows: int): ...
259
-
260
-
261
- @signature
262
- def ts_mad(expr: str, windows: int): ...
263
-
264
-
265
- @signature
266
- def ts_rank(expr: str, windows: int): ...
267
-
268
-
269
- @signature
270
- def ts_max(expr: str, windows: int): ...
271
-
272
-
273
- @signature
274
- def ts_min(expr: str, windows: int): ...
275
-
276
-
277
- @signature
278
- def ts_ewmmean(expr: str, com=None, span=None, half_life=None, alpha=None): ...
279
-
280
-
281
- @signature
282
- def ts_ewmstd(expr: str, com=None, span=None, half_life=None, alpha=None): ...
283
-
284
-
285
- @signature
286
- def ts_ewmvar(expr: str, com=None, span=None, half_life=None, alpha=None): ...
287
-
288
-
289
- @signature
290
- def ts_cv(expr: str, windows: int): ...
291
-
292
-
293
- @signature
294
- def ts_snr(expr: str, windows: int): ...
295
-
296
-
297
- @signature
298
- def ts_diff(expr: str, windows: int): ...
299
-
300
-
301
- @signature
302
- def ts_pct(expr: str, windows: int): ...
303
-
304
-
305
- @signature
306
- def ts_slope(left: str, right: str, windows: int): ...
307
-
308
-
309
- @signature
310
- def ts_corr(left: str, right: str, windows: int): ...
311
-
312
-
313
- @signature
314
- def ts_cov(left: str, right: str, windows: int): ...
315
-
316
-
317
- @signature
318
- def ts_resid(left: str, right: str, windows: int): ...
319
-
320
-
321
- @signature
322
- def ts_quantile(expr: str, windows: int, q: float): ...
323
-
324
-
325
- @signature
326
- def ts_prod(expr: str, windows: int): ...
327
-
328
-
329
- @signature
330
- def d_mean(expr: str, windows: int): ...
331
-
332
-
333
- @signature
334
- def d_std(expr: str, windows: int): ...
335
-
336
-
337
- @signature
338
- def d_sum(expr: str, windows: int): ...
339
-
340
-
341
- @signature
342
- def d_var(expr: str, windows: int): ...
343
-
344
-
345
- @signature
346
- def d_skew(expr: str, windows: int): ...
347
-
348
-
349
- @signature
350
- def d_ref(expr: str, windows: int): ...
351
-
352
-
353
- @signature
354
- def d_mid(expr: str, windows: int): ...
355
-
356
-
357
- @signature
358
- def d_mad(expr: str, windows: int): ...
359
-
360
-
361
- @signature
362
- def d_rank(expr: str, windows: int): ...
363
-
364
-
365
- @signature
366
- def d_max(expr: str, windows: int): ...
367
-
368
-
369
- @signature
370
- def d_min(expr: str, windows: int): ...
371
-
372
-
373
- @signature
374
- def d_ewmmean(expr: str, com=None, span=None, half_life=None, alpha=None): ...
375
-
376
-
377
- @signature
378
- def d_ewmstd(expr: str, com=None, span=None, half_life=None, alpha=None): ...
379
-
380
-
381
- @signature
382
- def d_ewmvar(expr: str, com=None, span=None, half_life=None, alpha=None): ...
383
-
384
-
385
- @signature
386
- def d_cv(expr: str, windows: int): ...
387
-
388
-
389
- @signature
390
- def d_snr(expr: str, windows: int): ...
391
-
392
-
393
- @signature
394
- def d_diff(expr: str, windows: int): ...
395
-
396
-
397
- @signature
398
- def d_pct(expr: str, windows: int): ...
399
-
400
-
401
- @signature
402
- def d_slope(left: str, right: str, windows: int): ...
403
-
404
-
405
- @signature
406
- def d_corr(left: str, right: str, windows: int): ...
407
-
408
-
409
- @signature
410
- def d_cov(left: str, right: str, windows: int): ...
411
-
412
-
413
- @signature
414
- def d_resid(left: str, right: str, windows: int): ...
415
-
416
-
417
- @signature
418
- def d_quantile(expr: str, windows: int, q: float): ...
419
-
420
-
421
- @signature
422
- def d_prod(expr: str, windows: int): ...
423
-
424
-
425
- @signature
426
- def ind_mean(expr: str, windows: int): ...
427
-
428
-
429
- @signature
430
- def ind_std(expr: str, windows: int): ...
431
-
432
-
433
- @signature
434
- def ind_sum(expr: str, windows: int): ...
435
-
436
-
437
- @signature
438
- def ind_var(expr: str, windows: int): ...
439
-
440
-
441
- @signature
442
- def ind_skew(expr: str, windows: int): ...
443
-
444
-
445
- @signature
446
- def ind_ref(expr: str, windows: int): ...
447
-
448
-
449
- @signature
450
- def ind_mid(expr: str, windows: int): ...
451
-
452
-
453
- @signature
454
- def ind_mad(expr: str, windows: int): ...
455
-
456
-
457
- @signature
458
- def ind_rank(expr: str, windows: int): ...
459
-
460
-
461
- @signature
462
- def ind_max(expr: str, windows: int): ...
463
-
464
-
465
- @signature
466
- def ind_min(expr: str, windows: int): ...
467
-
468
-
469
- @signature
470
- def ind_ewmmean(expr: str, com=None, span=None, half_life=None, alpha=None): ...
471
-
472
-
473
- @signature
474
- def ind_ewmstd(expr: str, com=None, span=None, half_life=None, alpha=None): ...
475
-
476
-
477
- @signature
478
- def ind_ewmvar(expr: str, com=None, span=None, half_life=None, alpha=None): ...
479
-
480
-
481
- @signature
482
- def ind_cv(expr: str, windows: int): ...
483
-
484
-
485
- @signature
486
- def ind_snr(expr: str, windows: int): ...
487
-
488
-
489
- @signature
490
- def ind_diff(expr: str, windows: int): ...
491
-
492
-
493
- @signature
494
- def ind_pct(expr: str, windows: int): ...
495
-
496
-
497
- @signature
498
- def ind_slope(left: str, right: str, windows: int): ...
499
-
500
-
501
- @signature
502
- def ind_corr(left: str, right: str, windows: int): ...
503
-
504
-
505
- @signature
506
- def ind_cov(left: str, right: str, windows: int): ...
507
-
508
-
509
- @signature
510
- def ind_resid(left: str, right: str, windows: int): ...
511
-
512
-
513
- @signature
514
- def ind_quantile(expr: str, windows: int, q: float): ...
515
-
516
-
517
- @signature
518
- def ind_prod(expr: str, windows: int): ...
519
-
520
-
521
- @signature
522
- def max(*exprs: str): ...
523
-
524
-
525
- @signature
526
- def min(*exprs: str): ...
527
-
528
-
529
- @signature
530
- def sum(*exprs: str): ...
ycat/qdf/errors.py DELETED
@@ -1,65 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- ---------------------------------------------
4
- Created on 2025/5/16 10:47
5
- @author: ZhangYundi
6
- @email: yundi.xxii@outlook.com
7
- ---------------------------------------------
8
- """
9
-
10
- from dataclasses import dataclass
11
-
12
- @dataclass
13
- class ParseError(Exception):
14
- message: str
15
-
16
- def __str__(self):
17
- return self.message
18
-
19
- def __repr__(self):
20
- return self.__str__()
21
-
22
- @dataclass
23
- class CalculateError(Exception):
24
- message: str
25
-
26
- def __str__(self):
27
- return self.message
28
-
29
- def __repr__(self):
30
- return self.__str__()
31
-
32
- @dataclass
33
- class CompileError(Exception):
34
- message: str
35
-
36
- def __str__(self):
37
- return self.message
38
-
39
- def __repr__(self):
40
- return self.__str__()
41
-
42
- @dataclass
43
- class PolarsError(Exception):
44
- message: str
45
-
46
- def __str__(self):
47
- return self.message
48
-
49
- def __repr__(self):
50
- return self.__str__()
51
-
52
- @dataclass
53
- class FailError:
54
- expr: str
55
- error: Exception
56
-
57
- def __str__(self):
58
- return f"""
59
- [失败表达式]: {self.expr}
60
- [错误类型]: {self.error.__class__.__name__}
61
- [错误信息]: \n{self.error}
62
- """
63
-
64
- def __repr__(self):
65
- return self.__str__()