Skip to content
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

Run nest_asyncio.apply() automatically inside Jupyter #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

g-simmons
Copy link

What does this do?

On Docs.init(), try to check if we're inside a Jupyter notebook. If so, run nest_asyncio.apply()

Test Status

  • Running the code example from the README fails in Jupyter if this is not included*
  • Running the code example from the README succeeds in Jupyter with this fix*
  • Running the code example from the README succeeds in the terminal*

*only tested up to Docs.add()

import nest_asyncio
nest_asyncio.apply()

def _in_notebook(self) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this function could be put in utils.py (outside of the class), since it doesn't use self in the method?

@whitead
Copy link
Owner

whitead commented Apr 13, 2023

Does this work? I already have code for this here but it doesn't seem to work.

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.

None yet

3 participants