Skip to content

fix: fall back from incompatible stdin#1258

Open
MilesCranmerBot wants to merge 2 commits into
astroautomata:masterfrom
MilesCranmerBot:bot/issue-832-stdin-wrapper
Open

fix: fall back from incompatible stdin#1258
MilesCranmerBot wants to merge 2 commits into
astroautomata:masterfrom
MilesCranmerBot:bot/issue-832-stdin-wrapper

Conversation

@MilesCranmerBot

@MilesCranmerBot MilesCranmerBot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fall back from default input_stream="stdin" to Julia devnull when Python stdin is not an interactive TTY with a valid fd
  • preserve explicit/custom Julia stream expressions
  • document the fallback and add targeted unit coverage

This should avoid SymbolicRegression.jl trying to start_reading/poll frontend-owned pseudofiles such as marimo's stdin wrapper.

Fixes #832

Tests

  • python3 -m py_compile pysr/sr.py pysr/test/test_main.py
  • uv run --no-project --python 3.12 --with pytest --with numpy --with pandas --with scikit-learn --with sympy --with juliacall==0.9.28 pytest pysr/test/test_main.py::TestInputStream -q
    • targeted assertions pass (3 passed); on this local machine JuliaCall/PythonCall teardown intermittently exits 139 after pytest reports success

MilesCranmerBot and others added 2 commits July 8, 2026 08:39
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.50000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pysr/sr.py 62.50% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

[BUG]: Freezing/Getting Stuck on Python 3.7/PySR 0.18.3

1 participant