-
Notifications
You must be signed in to change notification settings - Fork 11
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
Added a timeout argument to execute #48
Conversation
As in https://nbsphinx.readthedocs.io/en/0.6.0/timeout.html#Cell-Execution-Timeout, |
Great. So, we will need to read the timeout metadata information somewhere in that loop before https://github.com/ExecutableBookProject/jupyter-cache/blob/517366e31adeafd4818fb40f7c85a364e44f600b/jupyter_cache/executors/basic.py#L159. I will update this PR for this, and the one in myst-nb to check for conf variable |
Hey @chrisjsewell , a quick question. Where do you think the |
Not quite sure TBH, maybe cc'in @choldgraf |
I opened up jupyter/nbclient#45 to see if others in the nbclient repo have thoughts |
@choldgraf should we just create an object like
No one seems to be replying to that thread. Probably there is no jupyter-standard, else |
I think that you're right that there isn't really a standard, so let's just go with something that seems reasonable to us and we can support a new standard later on if we wish |
jupyter-client doesn't/shouldn't have any direct ties to mystnb though, so it would be better to use a more generic top level key like |
ok, so committing again with Added
|
Just a note that matt did have some thoughts in jupyter/nbclient#45 he just posted...it mostly comes down to "there is no current standard" but I think nbclient folks are open to agreeing on a metadata spec that is reasonable. |
@choldgraf that's great. So, basically he prefers to have separate metadata for execution as well instead of namespaced subsection. Then we can ditch the option of putting |
I'm not entirely sure - but feel free to throw out some ideas in the nbclient thread and perhaps we can come to a quick agreement |
@AakashGfude this looks good from a functionality standpoint, three major points:
Does that all make sense? Lemme know what you think. |
dc84e82
to
d4a6bbc
Compare
@choldgraf have added tests and also added this as an option in cli commands, coz it might come handy?
have added a line in python API section of the docs. But, the
Thanks. Have added the tests now.
it indeed was setup to handle a global config value for timeout , In jupyter-book inside the |
8b5df22
to
a7c2b8d
Compare
This is so weird. Not sure, what got updated, but pre-commit tests are failing for files in Travis in which I did not work on. Needless to say, Working fine on my local system. |
not sure why |
Have added the same files |
nice! is this ready for a review or merge? |
@choldgraf yes |
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.
This looks good to me - just two quick comments in there 👍 thanks Aakash!
@@ -57,12 +57,13 @@ class JupyterExecutorBasic(JupyterExecutorAbstract): | |||
|
|||
The execution is split into two methods: `run` and `execute`. | |||
In this way access to the cache can be synchronous, but the execution can be | |||
multi/async processed. | |||
multi/async processed. Takes timeout parameter in seconds for execution |
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.
Could you add a short section on "timeout" under the execution documentation here: https://jupyter-cache.readthedocs.io/en/latest/using/api.html#execution
And mention that you can specify a timeout
either via a the call to jupyter-cache, or via the execution: timeout:
metadata field?
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.
I had added a small Note there https://github.com/executablebooks/jupyter-cache/pull/48/files#diff-7d5c2179cfd8d418561a37c077b98278R1063 . But, creating a small section sounds better
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.
@choldgraf what do you think?
ok this LGTM and the integration tests are passing, so I'll give it a merge! |
thanks very much @AakashGfude for working on this one! 👍 |
a timeout option to specify what is the maximum time allowed to execute for each cell before it times out. The default specified here is
30s
, which is also the default value of ExecutePreProcessor.