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

Repair notebook prolog #828

Merged

Conversation

rocco8773
Copy link
Member

  1. Repair the link directing to the notebooks on GitHub
    • original link was directing to doc/notebook/ instead of docs/notebook/
    • original link was trying to find a GitHub branch corresponding to the release variable defined in conf.py...now it's pointing directly to master
  2. Repair the binder link
    • The original link was not properly finding the notebooks on GitHub
    • This was a useful tool for figuring out the correct link...https://mybinder.org/
  3. Remove the nbviewer link. The RTD page is already behaving as a viewer.

…the Gitub maser branch, comment out the nbviewer script
@rocco8773 rocco8773 added bug Issues describing unexpected behavior or defects. Remember: a bug is a sign of a missing test! docs PlasmaPy Docs at http://docs.plasmapy.org refactoring ♻️ Improving an implementation without adding new functionality labels Jun 2, 2020
@rocco8773 rocco8773 requested a review from StanczakDominik June 2, 2020 21:19
@rocco8773 rocco8773 self-assigned this Jun 2, 2020
@pep8speaks
Copy link

pep8speaks commented Jun 2, 2020

Hello @rocco8773! Thanks for updating your pull request.

Line 218:100: E501 line too long (151 > 99 characters)
Line 221:100: E501 line too long (212 > 99 characters)

Comment last updated at 2020-06-03 17:37:11 UTC

@codecov
Copy link

codecov bot commented Jun 2, 2020

Codecov Report

Merging #828 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #828   +/-   ##
=======================================
  Coverage   95.88%   95.88%           
=======================================
  Files          56       56           
  Lines        5123     5123           
=======================================
  Hits         4912     4912           
  Misses        211      211           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb46387...f54c74f. Read the comment docs.

docs/conf.py Outdated
Interactive online version:
<a href="https://mybinder.org/v2/gh/PlasmaPy/PlasmaPy/{{ env.config.release|e }}?filepath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>.
<a href="https://mybinder.org/v2/gh/PlasmaPy/PlasmaPy/master/?filepath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>.
Copy link
Member

Choose a reason for hiding this comment

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

Admittedly this was mostly copypasted from the doc examples, but I think it'd make sense to - if we were to release 0.4 tomorrow - link from 0.4 docs to 0.4 examples. This way, you're linking from every version's docs to the master branch, which seems like an antipattern.

Perhaps there's a way around this? If there's any module in the docs that'll have version information, that'd be conf.py!

Copy link
Member Author

Choose a reason for hiding this comment

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

In general and practice I'd agree that would be the better option. However, we literally do not have release branch to point back to on GitHub. The only options I can think of that don't require manual work during each deployment are...

  1. Pointing back to a commit tree like this (https://github.com/PlasmaPy/PlasmaPy/blob/c1f9482e030beda87f65b5558d40322536d36dd0/docs/notebooks/physics.ipynb), but I don't know If sphinx knows anything about the commit ids.
  2. If RTD the has any stored pacakge data and if we can point to that instead.

In order to get a fix in now, I say we merge this PR and open to improve the link back.

Copy link
Member

Choose a reason for hiding this comment

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

I'm willing to bet I can take

PlasmaPy/docs/conf.py

Lines 79 to 85 in 25c8127

# The full version, including alpha/beta/rc tags.
# Note: If plasmapy.__version__ can not be defined then it is set to 'unknown'.
# However, release needs to be a semantic style version number, so set
# the 'unknown' case to ''.
release = "" if release == "unknown" else release
# The short X.Y version.
version = ".".join(release.split(".")[:2])
adapt it to our release schema from https://github.com/PlasmaPy/PlasmaPy/releases and put it in there (via an f-string, to boot), then https://mybinder.org/ claims to take release tags too, and it's gonna work splendidly. But I do have to do the dishes now, so I'll do it in an hour or so.

Look to my commit at... wow, what time is it over there... er... look to my commit before the first light of the fourth day of June, at dawn, look to the, er, the commit's gonna come from your east so I guess that checks out.

Copy link
Member

@StanczakDominik StanczakDominik Jun 3, 2020

Choose a reason for hiding this comment

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

Gah, versioning got in my way. When working off 0.3.1, we get 0.3.2 dev for some crazy setuptools_scm related reason... I'll have to do a couple of RTD tests to get this done. Future issue, definitely.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I think I go the notebooks to point to the git tree, but I setup a fallback to master. Here's the current doc build where it seems to be working...https://plasmapy--828.org.readthedocs.build/en/828/notebooks/physics.html

docs/conf.py Outdated Show resolved Hide resolved
@rocco8773 rocco8773 marked this pull request as ready for review June 3, 2020 17:43
Copy link
Member

@StanczakDominik StanczakDominik left a comment

Choose a reason for hiding this comment

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

Continuing with the magical theme for these reviews... yer a wizard, @rocco8773. Works great on the test doc build! I'm half expecting this to break at one point during our next release, but hey, since it's your code, not mine... I have high hopes! 😆 Thanks for doing this! :)

@StanczakDominik StanczakDominik merged commit 4fa67e2 into PlasmaPy:master Jun 4, 2020
@rocco8773
Copy link
Member Author

I thought you'd get a kick out of this one!

@StanczakDominik
Copy link
Member

I mean, yeah, looking at you delving into the depths of Jinja2 was... something. 😆

@rocco8773 rocco8773 deleted the nbsphinx-prolog-link-to-nbs branch June 4, 2020 19:56
@namurphy namurphy added bugfix Pull requests that fix a bug. Remember: a bug is a sign of a missing test! and removed bug Issues describing unexpected behavior or defects. Remember: a bug is a sign of a missing test! labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull requests that fix a bug. Remember: a bug is a sign of a missing test! docs PlasmaPy Docs at http://docs.plasmapy.org refactoring ♻️ Improving an implementation without adding new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants