vizflow 0.5.8__py3-none-any.whl → 0.5.10__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.
vizflow/ops.py
CHANGED
|
@@ -216,11 +216,12 @@ def forward_return(
|
|
|
216
216
|
)
|
|
217
217
|
|
|
218
218
|
# Add forward price and calculate return (guard against zero price)
|
|
219
|
+
# Explicitly cast to Float64 to ensure consistent schema across dates
|
|
219
220
|
trade = joined.with_columns([
|
|
220
|
-
pl.col("_forward_price").alias(forward_col),
|
|
221
|
+
pl.col("_forward_price").cast(pl.Float64).alias(forward_col),
|
|
221
222
|
pl.when(pl.col(price_col) != 0)
|
|
222
223
|
.then((pl.col("_forward_price") - pl.col(price_col)) / pl.col(price_col))
|
|
223
|
-
.otherwise(pl.lit(None))
|
|
224
|
+
.otherwise(pl.lit(None, dtype=pl.Float64))
|
|
224
225
|
.alias(return_col),
|
|
225
226
|
]).drop(["_forward_time", "_alpha_time", "_forward_price"])
|
|
226
227
|
|
vizflow/schema_evolution.py
CHANGED
|
@@ -337,6 +337,8 @@ JYAO_V20251114 = SchemaEvolution(
|
|
|
337
337
|
# Symbol column - parse_dtype for CSV, cast_dtype for feather/IPC
|
|
338
338
|
# (feather files have embedded types, so cast is needed post-load)
|
|
339
339
|
"ukey": ColumnSpec(parse_dtype=pl.Int64, cast_dtype=pl.Int64),
|
|
340
|
+
# Time columns
|
|
341
|
+
"ticktime": ColumnSpec(parse_dtype=pl.Int64, cast_dtype=pl.Int64),
|
|
340
342
|
# Quote columns
|
|
341
343
|
"BidPrice1": ColumnSpec(rename_to="bid_px0", parse_dtype=pl.Float64),
|
|
342
344
|
"AskPrice1": ColumnSpec(rename_to="ask_px0", parse_dtype=pl.Float64),
|
|
@@ -417,6 +419,33 @@ JYAO_UNIV_V20251230 = SchemaEvolution(
|
|
|
417
419
|
)
|
|
418
420
|
|
|
419
421
|
|
|
422
|
+
# =============================================================================
|
|
423
|
+
# SIM Standard Format (standard column names, type conversion only)
|
|
424
|
+
# =============================================================================
|
|
425
|
+
|
|
426
|
+
SIM_STANDARD = SchemaEvolution(
|
|
427
|
+
columns={
|
|
428
|
+
# ID
|
|
429
|
+
"ukey": ColumnSpec(parse_dtype=pl.Int64),
|
|
430
|
+
# Order info
|
|
431
|
+
"order_id": ColumnSpec(parse_dtype=pl.Int64),
|
|
432
|
+
"order_side": ColumnSpec(parse_dtype=pl.String), # "B" / "S"
|
|
433
|
+
"order_qty": ColumnSpec(parse_dtype=pl.Float64, cast_dtype=pl.Int64),
|
|
434
|
+
"order_price": ColumnSpec(parse_dtype=pl.Float64),
|
|
435
|
+
"order_filled_qty": ColumnSpec(parse_dtype=pl.Float64, cast_dtype=pl.Int64),
|
|
436
|
+
# Timestamps
|
|
437
|
+
"create_exchange_ts": ColumnSpec(parse_dtype=pl.Int64),
|
|
438
|
+
"update_exchange_ts": ColumnSpec(parse_dtype=pl.Int64),
|
|
439
|
+
# Queue position
|
|
440
|
+
"qty_ahead": ColumnSpec(parse_dtype=pl.Float64, cast_dtype=pl.Int64),
|
|
441
|
+
"qty_behind": ColumnSpec(parse_dtype=pl.Float64, cast_dtype=pl.Int64),
|
|
442
|
+
# Event
|
|
443
|
+
"order_curr_state": ColumnSpec(parse_dtype=pl.String), # "New", "Filled", etc.
|
|
444
|
+
},
|
|
445
|
+
null_values=["", "NA", "null"],
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
|
|
420
449
|
# =============================================================================
|
|
421
450
|
# Schema Registry
|
|
422
451
|
# =============================================================================
|
|
@@ -425,6 +454,7 @@ SCHEMAS: dict[str, SchemaEvolution] = {
|
|
|
425
454
|
"ylin_v20251204": YLIN_V20251204,
|
|
426
455
|
"jyao_v20251114": JYAO_V20251114,
|
|
427
456
|
"jyao_univ_v20251230": JYAO_UNIV_V20251230,
|
|
457
|
+
"sim_standard": SIM_STANDARD,
|
|
428
458
|
}
|
|
429
459
|
|
|
430
460
|
|
|
@@ -2,10 +2,10 @@ vizflow/__init__.py,sha256=KGksMU9wGsdGSbd2OgSHM2ofMZbTwgaCN92ZDEgASwU,614
|
|
|
2
2
|
vizflow/config.py,sha256=nPZPXlqQbaY8u_FAdtPShvb0mdx3e2TRaQ2CILzliAU,7192
|
|
3
3
|
vizflow/io.py,sha256=1T7t-L1ijrfEkE-gr4f45yiupJKA4-DxbJhsyN_tLnI,11939
|
|
4
4
|
vizflow/market.py,sha256=MtNz_nnZxC66Aq-i2PXEwaFCTknijFWYZUUv6798k2s,2493
|
|
5
|
-
vizflow/ops.py,sha256=
|
|
5
|
+
vizflow/ops.py,sha256=cUFeDdWfMk2hG8hpevTz_Dfnzk3fnhTI79UwMGzUkHw,10534
|
|
6
6
|
vizflow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
vizflow/schema_evolution.py,sha256=
|
|
7
|
+
vizflow/schema_evolution.py,sha256=IPUzdtRWAOpDboAxWIFHInGyFUzhg6Bt7Ye5Ile0bPI,17668
|
|
8
8
|
vizflow/viz.py,sha256=dzcY72hWMVbxWIyjwfUW3Ot3CunaP7O4GLVUzzOjkbY,1212
|
|
9
|
-
vizflow-0.5.
|
|
10
|
-
vizflow-0.5.
|
|
11
|
-
vizflow-0.5.
|
|
9
|
+
vizflow-0.5.10.dist-info/METADATA,sha256=717CUcTl_UEPFqHUGRKAKg91fz5OHB1mA9mImlBP4OU,389
|
|
10
|
+
vizflow-0.5.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
vizflow-0.5.10.dist-info/RECORD,,
|
|
File without changes
|