-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Strange decimal.getcontext().prec behavior #5260
Comments
Adding version info here for clarity
|
Quick additional note. Above, this was occurring in the jupyter/tensorflow-notebook Docker image from about a month ago, with a few things installed, and a few updates run. I've pulled the latest image with the below versions, and with nothing else installed/no updates run. Behavior is slightly different, but the issue still occurs intermittently, apparently varying based on a) if Jupyter Lab is freshly started, b) if kernel has been restarted, and c) whether the shell command has been run. So, if you're trying to reproduce, treat as intermittent, and test with variations of those three factors. Versions from the latest image where this is happening:
|
Is this the appropriate place for this issue to be opened? |
Hi @evan-burke - sorry for the lack of response. This sounds like a strange issue, but one that probably should be investigated from the kernel side. I suspect you might have better success with this question in the ipykernel repo. That said, these projects do share many of the same maintainers. Good luck. |
Thank you Kevin - I'll open one there and reference this. |
Hi,
I'm using Python's
decimal.getcontext().prec
to set decimal precision for operations in a notebook.In Jupyter, the precision seems to (somewhat intermittently) get reset to 28 between manual executions of different cells. The strangest part is - running the shell command
!jupyter notebook --version
fixes the issue. (I haven't tested other shell commands.)Additionally, on a just-started version of JupyterLab,
decimal.getcontext().prec
behavior is normal; the bug only appears to surface after restarting the kernel in the JupyterLab UI."Run all cells" also appears to apply precision correctly across different cells.
Example & version details -
https://github.com/evan-burke/juptyer_getcontext_bug/blob/master/getcontext.ipynb
Same thing run in a console behaves normally:
The text was updated successfully, but these errors were encountered: