diff --git a/nautilus_trader/config/backtest.py b/nautilus_trader/config/backtest.py index 6d34496f4ef4..e12e078fcb1a 100644 --- a/nautilus_trader/config/backtest.py +++ b/nautilus_trader/config/backtest.py @@ -77,7 +77,6 @@ class BacktestDataConfig(NautilusConfig, frozen=True): client_id: Optional[str] = None metadata: Optional[dict] = None bar_spec: Optional[str] = None - use_rust: Optional[bool] = False batch_size: Optional[int] = 10_000 @property @@ -104,7 +103,6 @@ def query(self) -> dict[str, Any]: "end": self.end_time, "filter_expr": parse_filters_expr(filter_expr), "metadata": self.metadata, - "use_rust": self.use_rust, } @property diff --git a/nautilus_trader/config/common.py b/nautilus_trader/config/common.py index 56af08031829..4efe534d7dce 100644 --- a/nautilus_trader/config/common.py +++ b/nautilus_trader/config/common.py @@ -349,15 +349,12 @@ class DataCatalogConfig(NautilusConfig, frozen=True): The fsspec file system protocol for the data catalog. fs_storage_options : dict, optional The fsspec storage options for the data catalog. - use_rust : bool, default False - If queries will be for Rust schema versions (when implemented). """ path: str fs_protocol: Optional[str] = None fs_storage_options: Optional[dict] = None - use_rust: bool = False class ActorConfig(NautilusConfig, kw_only=True, frozen=True): diff --git a/nautilus_trader/data/engine.pxd b/nautilus_trader/data/engine.pxd index c8c5520eb1b8..bdeaec7f51ee 100644 --- a/nautilus_trader/data/engine.pxd +++ b/nautilus_trader/data/engine.pxd @@ -48,7 +48,6 @@ cdef class DataEngine(Component): cdef readonly Cache _cache cdef readonly DataClient _default_client cdef readonly object _catalog - cdef readonly bint _use_rust cdef readonly dict _clients cdef readonly dict _routing_map diff --git a/nautilus_trader/data/engine.pyx b/nautilus_trader/data/engine.pyx index d5a772beef0b..18524177cc64 100644 --- a/nautilus_trader/data/engine.pyx +++ b/nautilus_trader/data/engine.pyx @@ -131,7 +131,6 @@ cdef class DataEngine(Component): self._routing_map: dict[Venue, DataClient] = {} self._default_client: Optional[DataClient] = None self._catalog: Optional[ParquetDataCatalog] = None - self._use_rust: bool = False self._order_book_intervals: dict[(InstrumentId, int), list[Callable[[Bar], None]]] = {} self._bar_aggregators: dict[BarType, BarAggregator] = {} self._synthetic_quote_feeds: dict[InstrumentId, list[SyntheticInstrument]] = {} @@ -229,7 +228,7 @@ cdef class DataEngine(Component): # --REGISTRATION ---------------------------------------------------------------------------------- - def register_catalog(self, catalog: ParquetDataCatalog, bint use_rust=False) -> None: + def register_catalog(self, catalog: ParquetDataCatalog) -> None: """ Register the given data catalog with the engine. @@ -242,7 +241,6 @@ cdef class DataEngine(Component): Condition.not_none(catalog, "catalog") self._catalog = catalog - self._use_rust = use_rust cpdef void register_client(self, DataClient client): """ @@ -1302,25 +1300,18 @@ cdef class DataEngine(Component): if instrument_id is None: data = self._catalog.instruments(as_nautilus=True) else: - data = self._catalog.instruments( - instrument_ids=[str(instrument_id)], - as_nautilus=True, - ) + data = self._catalog.instruments(instrument_ids=[str(instrument_id)]) elif request.data_type.type == QuoteTick: data = self._catalog.quote_ticks( instrument_ids=[str(request.data_type.metadata.get("instrument_id"))], start=ts_start, end=ts_end, - as_nautilus=True, - use_rust=self._use_rust, ) elif request.data_type.type == TradeTick: data = self._catalog.trade_ticks( instrument_ids=[str(request.data_type.metadata.get("instrument_id"))], start=ts_start, end=ts_end, - as_nautilus=True, - use_rust=self._use_rust, ) elif request.data_type.type == Bar: bar_type = request.data_type.metadata.get("bar_type") @@ -1332,16 +1323,12 @@ cdef class DataEngine(Component): bar_type=str(bar_type), start=ts_start, end=ts_end, - as_nautilus=True, - use_rust=False, # Until implemented ) elif request.data_type.type == InstrumentClose: data = self._catalog.instrument_closes( instrument_ids=[str(request.data_type.metadata.get("instrument_id"))], start=ts_start, end=ts_end, - as_nautilus=True, - use_rust=False, # Until implemented ) else: data = self._catalog.generic_data( @@ -1349,7 +1336,6 @@ cdef class DataEngine(Component): metadata=request.data_type.metadata, start=ts_start, end=ts_end, - as_nautilus=True, ) # Validation data is not from the future diff --git a/nautilus_trader/system/kernel.py b/nautilus_trader/system/kernel.py index 9240dfd8ed38..ef6255329110 100644 --- a/nautilus_trader/system/kernel.py +++ b/nautilus_trader/system/kernel.py @@ -401,10 +401,7 @@ def __init__( # noqa (too complex) fs_protocol=config.catalog.fs_protocol, fs_storage_options=config.catalog.fs_storage_options, ) - self._data_engine.register_catalog( - catalog=self._catalog, - use_rust=config.catalog.use_rust, - ) + self._data_engine.register_catalog(catalog=self._catalog) # Create importable actors for actor_config in config.actors: diff --git a/tests/performance_tests/test_perf_catalog.py b/tests/performance_tests/test_perf_catalog.py index dfd7df11c823..9c9ac0adbcbe 100644 --- a/tests/performance_tests/test_perf_catalog.py +++ b/tests/performance_tests/test_perf_catalog.py @@ -50,7 +50,7 @@ def setup(): return (cls.catalog,), {} def run(catalog): - quotes = catalog.quote_ticks(as_nautilus=True) + quotes = catalog.quote_ticks() assert len(quotes) == 9500 benchmark.pedantic(run, setup=setup, rounds=1, iterations=1, warmup_rounds=1) @@ -66,13 +66,13 @@ def setup(): cls.catalog = data_catalog_setup(protocol="file", path=tempdir) - cls._load_quote_ticks_into_catalog(use_rust=True) + cls._load_quote_ticks_into_catalog() # Act return (cls.catalog,), {} def run(catalog): - quotes = catalog.quote_ticks(as_nautilus=True, use_rust=True) + quotes = catalog.quote_ticks() assert len(quotes) == 9500 benchmark.pedantic(run, setup=setup, rounds=1, iterations=1, warmup_rounds=1) diff --git a/tests/unit_tests/backtest/test_config.py b/tests/unit_tests/backtest/test_config.py index d1cdb8774ce5..030cb35e31e6 100644 --- a/tests/unit_tests/backtest/test_config.py +++ b/tests/unit_tests/backtest/test_config.py @@ -84,7 +84,6 @@ def test_backtest_data_config_load(self): "filter_expr": None, "start": 1580398089820000000, "end": 1580504394501000000, - "use_rust": False, "metadata": None, } @@ -198,7 +197,7 @@ def test_run_config_to_json(self) -> None: ) json = msgspec.json.encode(run_config) result = len(msgspec.json.encode(json)) - assert result == 1010 # UNIX + assert result == 986 # UNIX @pytest.mark.skipif(sys.platform == "win32", reason="redundant to also test Windows") def test_run_config_parse_obj(self) -> None: @@ -219,7 +218,7 @@ def test_run_config_parse_obj(self) -> None: assert isinstance(config, BacktestRunConfig) node = BacktestNode(configs=[config]) assert isinstance(node, BacktestNode) - assert len(raw) == 754 # UNIX + assert len(raw) == 737 # UNIX @pytest.mark.skipif(sys.platform == "win32", reason="redundant to also test Windows") def test_backtest_data_config_to_dict(self) -> None: @@ -240,7 +239,7 @@ def test_backtest_data_config_to_dict(self) -> None: ) json = msgspec.json.encode(run_config) result = len(msgspec.json.encode(json)) - assert result == 1866 + assert result == 1798 @pytest.mark.skipif(sys.platform == "win32", reason="redundant to also test Windows") def test_backtest_run_config_id(self) -> None: @@ -248,7 +247,7 @@ def test_backtest_run_config_id(self) -> None: print("token:", token) value: bytes = msgspec.json.encode(self.backtest_config.dict(), enc_hook=json_encoder) print("token_value:", value.decode()) - assert token == "e85939d3f49c300d8d12b22a702ad9ea1dccf942b23016b66c00101c0de6f3c6" # UNIX + assert token == "d1add7c871b0bdd762b495345e394276431eda714a00d839037df33e8a427fd1" # UNIX @pytest.mark.skip(reason="fix after merge") @pytest.mark.parametrize( diff --git a/tests/unit_tests/data/test_engine.py b/tests/unit_tests/data/test_engine.py index 9ab7776cc5cd..4b7eae668bca 100644 --- a/tests/unit_tests/data/test_engine.py +++ b/tests/unit_tests/data/test_engine.py @@ -2163,7 +2163,7 @@ def test_request_instruments_for_venue_when_catalog_registered(self): # data: bytes = writer.flush_bytes() # f.write(data) # - # self.data_engine.register_catalog(catalog, use_rust=True) + # self.data_engine.register_catalog(catalog) # # # Act # handler: list[DataResponse] = [] @@ -2246,7 +2246,7 @@ def test_request_instruments_for_venue_when_catalog_registered(self): # data: bytes = writer.flush_bytes() # f.write(data) # - # self.data_engine.register_catalog(catalog, use_rust=True) + # self.data_engine.register_catalog(catalog) # # # Act # handler: list[DataResponse] = []