Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format error outputs for BacktestNode exceptions #1388

Open
kbs-code opened this issue Dec 3, 2023 · 1 comment
Open

Format error outputs for BacktestNode exceptions #1388

kbs-code opened this issue Dec 3, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@kbs-code
Copy link

kbs-code commented Dec 3, 2023

Feature Request

Code reference: https://github.com/nautechsystems/nautilus_trader/blob/master/nautilus_trader/backtest/node.py

I was trying to run a high-level backtest and saw some output in the terminal. Most of it was formatted fine except for one block of text. Node.py is printing my configs unformatted when I misconfigured something in my backtest. This makes it harder to read error output and debug my backtests. This seems to be coming from lines 129-142 of Node.py:

         for config in self._configs:
            try:
                result = self._run(
                    run_config_id=config.id,
                    engine_config=config.engine,
                    venue_configs=config.venues,
                    data_configs=config.data,
                    batch_size_bytes=config.batch_size_bytes,
                )
                results.append(result)
            except Exception as e:
                # Broad catch all prevents a single backtest run from halting
                # the execution of the other backtests (such as a zero balance exception).
                print(f"Error running {config}: {e}")

I tried formatting the output on my end using various try/except statements, but none improved it.
backtest_error_output

@kbs-code kbs-code added the enhancement New feature or request label Dec 3, 2023
@cjdsellers cjdsellers self-assigned this Dec 3, 2023
@cjdsellers
Copy link
Member

Thanks for the feedback and taking the time to post the issue @kbs-code 🙏

@cjdsellers cjdsellers changed the title Please Consider Formatting Error Output in Node.py Exception Format error outputs for BacktestNode exceptions Dec 3, 2023
@cjdsellers cjdsellers added this to In progress in NautilusTrader Kanban Board Dec 3, 2023
@cjdsellers cjdsellers moved this from In progress to Backlog in NautilusTrader Kanban Board Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants