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

update docs workflow + proper Cosmology docs #426

Merged
merged 9 commits into from Oct 24, 2017

Conversation

nickhand
Copy link
Member

A few updates:

  • api docs are generated with the builtin auto summary feature from a dynamically generated modules.rst file
  • there is now a proper list of methods/attributes for Cosmology(), linking to classylss -- this is accomplished with a custom sphinx template passed to auto-summary
  • This solves the issue of RTD timeouts (15 mins max) by using Jupyter notebooks instead of the ipython directive, which was taking up too much time when building the docs. Notebooks support RST raw cells, so we can do any modules that need code examples in notebooks instead
  • fixes various deprecated syntaxes in notebooks

- proper list of methods/attributes for Cosmology(), linking to
classylss
- solve RTD timeouts by using jupyter notebooks instead of ipython
directive in docs
- fix deprecated syntaxes in notebooks
@nickhand
Copy link
Member Author

The general workflow that I am using is doing:

make notebooks
make html

which executes all *ipynb files, and then builds the docs. Then, on RTD, the ipynb files are not re-executed, so we shouldn't bump up against the timeout limit

@rainwoodman
Copy link
Member

Looks like magic, but as long as it works.

I slightly liked the .rst files better than notebooks, because they have better looking diff-sets.

@nickhand
Copy link
Member Author

Yeah the notebook solution is not ideal (although it's only the docs with the IPython directive that get replaced), but I think it's the cleanest solution at the moment. I imagine issues like this are why projects like yt have a dedicated machine to build the docs, custom domain, etc

@rainwoodman
Copy link
Member

screenshot from 2017-10-23 14-07-33

Here is an issue -- get_pk occured twice.. usually the one from primordial is shadowed by the one from Spectra. I think we shall rename get_pk in primordial to get_pk_primordial to resolve this conflict. Is there a way to detect these conflicts in docs?

@nickhand
Copy link
Member Author

ah yes, I noticed that and meant to fix that in the docs. I'll do that now

@rainwoodman
Copy link
Member

Looks like it is less code if you keep the duplicates around, but issue a warning instead? The 'dir' method of a cosmology object does return every member it can find -- will it be useful to simplify the autosummary code? would it be useful if we implement dir on the class instead?

@nickhand
Copy link
Member Author

I think we should avoid leaving duplicates in the docs list, since that could be confusing for the user.

For the auto summary list, I'm searching in the same manner as the Cosmology's getattr (not dir), so now it always links to the proper attribute that the user will get. This is also an issue for sigma8, where we overload the Spectra attribute in the Cosmology() class.

@nickhand
Copy link
Member Author

FYI, I've built the docs with this update here:

http://nbodykit.readthedocs.io/en/cosmo-docs/index.html

@nickhand nickhand merged commit e8e0864 into bccp:master Oct 24, 2017
@nickhand nickhand deleted the cosmo-docs branch October 24, 2017 01:13
@nickhand
Copy link
Member Author

this addresses and closes #422

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

2 participants