Repository navigation
Closed
Labels
Description
Python Warnings Detected
🚨 12 Python warning(s) were found in the HTML output during the documentation build.
Details:
- Repository: QuantEcon/lecture-python.myst
- Workflow: Build Project [using jupyter-book]
- Run ID: 17004617251
- Commit: abcb9f1
- Branch: 529/merge
- Date: 2025-08-16T05:31:34.512Z
RuntimeWarning in ./_build/html/back_prop.html
Found 2 instance(s):
1:/home/runner/miniconda3/envs/quantecon/lib/python3.12/pty.py:95: RuntimeWarning: os.fork() was called. os.fork() is incompatible with multithreaded code, and JAX is multithreaded, so this will likely lead to a deadlock.
pid, fd = os.forkpty()
RuntimeWarning in ./_build/html/two_auctions.html
Found 8 instance(s):
6:/tmp/ipykernel_8932/521884726.py:25: RuntimeWarning: Mean of empty slice.
return array_conditional[-order,:].mean()
/home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide
ret = ret.dtype.type(ret / rcount)
6:/tmp/ipykernel_8932/919518230.py:37: RuntimeWarning: Mean of empty slice.
return array_conditional[-order,:].mean()
/home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide
ret = ret.dtype.type(ret / rcount)
RuntimeWarning in ./_build/html/status.html
Found 2 instance(s):
1:/home/runner/miniconda3/envs/quantecon/lib/python3.12/pty.py:95: RuntimeWarning: os.fork() was called. os.fork() is incompatible with multithreaded code, and JAX is multithreaded, so this will likely lead to a deadlock.
pid, fd = os.forkpty()
Next Steps:
- Review the warnings listed above
- Fix the underlying code that's generating these warnings
- Re-run the build to verify the warnings are resolved
Note: This issue was automatically created by the Check for Python Warnings Action.
Please close this issue once all warnings have been addressed.
Reacted by Copilot
Activity
HumphreyYang commentedon Aug 17, 2025
Hi @mmcky,
I think I figured out the source of the
forkwarnings:It is not easy : (
ipython syntax sugar
!callssystemfunction inhttps://github.com/ipython/ipython/blob/cbac235320fe91056a0fb6dba74cd8bef7fc21d9/IPython/core/interactiveshell.py#L2622-L2643
which involves
pexpect.spawn()that callsptyprocess.PtyProcess.spawn()that callsos.forkpty()https://github.com/ipython/ipython/blob/cbac235320fe91056a0fb6dba74cd8bef7fc21d9/IPython/utils/_process_posix.py#L122-L126
I think we can try to use
to avoid it:
I think it's the same issue in the
back_prop. I will run some tests to see.mmcky commentedon Aug 18, 2025
Nice work @HumphreyYang.