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
update in_notebook check #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a line to docs/changelog.rst
describing the bugfix? There's no new version yet, so you can add something like:
Master
------
* <insert description>
at the top of the file.
@@ -142,7 +142,7 @@ def _progress_bar_handler(self, tqdm_connection_details: TqdmConnectionDetails, | |||
|
|||
# In case we're running tqdm in a notebook we need to apply a dirty hack to get progress bars working. | |||
# Solution adapted from https://github.com/tqdm/tqdm/issues/485#issuecomment-473338308 | |||
in_notebook = 'IPython' in sys.modules and 'IPKernelApp' in sys.modules['IPython'].get_ipython().config | |||
in_notebook = 'IPython' in sys.modules and sys.modules['IPython'].get_ipython() is not None and 'IPKernelApp' in sys.modules['IPython'].get_ipython().config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's getting a bit out of hand with the big if statement. Perhaps we should simply let it fail and handle that instead:
try:
in_notebook = 'IPKernelApp' in sys.modules['IPython'].get_ipython().config
except (AttributeError, KeyError):
in_notebook = False
…nd django installed (`#13`_)Fixed progress bar in a particular setting with iPython and django installed
I'm closing this PR because there hasn't been any activity in quite some time. I will add the fix proposed here to another PR today. |
* Fixes #13 - Fixed progress bar in a particular setting with iPython and django installed * Fixes #15 - ``keep_alive`` now works even when the function to be called or any other parameter passed to the ``map`` function is changed * Moved ``enable_insights`` to the WorkerPool constructor. Using ``enable_insights`` from a ``map`` function is now deprecated and will be removed in MPIRE v2.6.0. * Restructured docs and updated several sections for Windows users. Co-authored-by: sybrenjansen <sybren.jansen@gmail.com>
when ipython is installed with django, it'll sometimes try and use it automatically. when trying to run a django management command with ipython installed i was seeing