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

Using include directive, conf.py configuration is not picked up #583

Open
enryH opened this issue Feb 5, 2024 · 2 comments
Open

Using include directive, conf.py configuration is not picked up #583

enryH opened this issue Feb 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@enryH
Copy link

enryH commented Feb 5, 2024

Describe the bug

context
When I include a notebook into sphinx from a different location as described here, the conf.py parameter is not picked up:

.. include:: ../../some/nexted/path/include.ipynb
   :parser: myst_nb.docutils_

My notebook is executed correctly in the local context and included.

expectation
I expected it to pick up the configuration from my conf.py.

bug
But instead I ran into a "Executing notebook failed: CellTimeoutError [mystnb.exec]" error, which I tried to fix using the following configuration in conf.py

# https://myst-nb.readthedocs.io/en/latest/configuration.html#global-configuration
nb_execution_timeout = 240  # otherwise it's a 30 seconds maximum per cell,

# https://myst-nb.readthedocs.io/en/latest/configuration.html
# Execution
nb_execution_raise_on_error = True

problem
So it might be only a documentation question, but: How do I set the configuration if I want to include a notebook which is not present in the docs folder with the sphinx conf.py file?

If I try to set the docutils.conf file as

[general]
nb_execution_mode = auto
nb_execution_raise_on_error = true
nb_merge_streams = true
nb_execution_timeout = 120

I get the warning: (ERROR/3) myst-nb configuration invalid: 'execution_timeout' must be of type <class 'int'> (got '120' that is a <class 'str'>). [mystnb]

Is there any way to set the NbParserConfig in the include directive?

Reproduce the bug

  1. Use the include directive and add it to the extra/test.rst file:
.. include:: ../../project/test.ipynb
   :parser: myst_nb.docutils_

and then include that into index.rst:

.. toctree::
  :maxdepth: 2
  :caption: test
  
  extra/test

List your environment

myst-nb                       0.17.2
myst-parser                 0.18.1

I don't have jupyter book installed.

@enryH enryH added the bug Something isn't working label Feb 5, 2024
Copy link

welcome bot commented Feb 5, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

enryH added a commit to RasmussenLab/pimms that referenced this issue Feb 5, 2024
- currently tutorial is not running through on READTHEDOCS
- see: executablebooks/MyST-NB#583

- 🐛 fix table formatting
@enryH
Copy link
Author

enryH commented Feb 16, 2024

Adding the desired configuration to the notebook metadata works, see documentation here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant