Skip to content

Clarify visualize error handling#92

Merged
jrfaeder merged 2 commits into
RuleWorld:mainfrom
wshlavacek:visualize-error-handling
May 12, 2026
Merged

Clarify visualize error handling#92
jrfaeder merged 2 commits into
RuleWorld:mainfrom
wshlavacek:visualize-error-handling

Conversation

@wshlavacek
Copy link
Copy Markdown
Contributor

Summary

  • remove the print-and-reraise fallback path in BNGVisualize
  • centralize visualization execution / collection so cwd restoration happens in one place
  • re-raise real BNGErrors cleanly and wrap filesystem failures as BNGFileError
  • add focused regression coverage in tests/test_visualize_errors.py

Why

The current code mixes logging, print(...), and exception handling in a way that makes visualization failures noisier and less explicit than they need to be.

Testing

  • uv run python -m pytest -q tests/test_visualize_errors.py
  • uvx black --check bionetgen/core/tools/visualize.py tests/test_visualize_errors.py

@jrfaeder jrfaeder merged commit 6d5598b into RuleWorld:main May 12, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants