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

Autogenerate pynest examples from source with sphinx_gallery #1336

Merged
merged 3 commits into from
Nov 23, 2019

Conversation

jessica-mitchell
Copy link
Contributor

This PR allows sphinx_gallery to autogenerate examples from pynest/examples/

The mock module in the conf.py file was removed due to a conflict between it and sphinx_gallery; this change should not affect any part of the documentation generation.

The examples that were previously in doc/ are now removed, so we no longer have the duplicate files
And the paths were updated in the examples/index.rst file
The html output should not change.

@heplesser Should I add the topology/examples? I wasn't sure if they need to be updated for 2.18 - The last update mentioned in the README is 2014 NEST 2.6

@terhorstd terhorstd added ZC: Documentation DO NOT USE THIS LABEL I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) ZP: PR Created DO NOT USE THIS LABEL S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation. labels Nov 15, 2019
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

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

This makes me so happy. Less files, less merge conflicts. ❤️

doc/conf.py Outdated
MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot', 'pandas']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot', 'pandas']
# sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

Copy link
Contributor

Choose a reason for hiding this comment

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

I Think it is save to delete this mock magic. I tried building the doc with and without pictures and it works.

@stinebuu stinebuu merged commit 0a30361 into nest:master Nov 23, 2019
@heplesser
Copy link
Contributor

@jessica-mitchell Sorry for commenting late on this one. I suggest to treat the topology examples in the same way as the other pynest examples.

@jessica-mitchell jessica-mitchell deleted the autogenerate_examples_sphinx branch January 23, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation. ZC: Documentation DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants