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

gh-365: upload HTML rendering of notebooks as artifact #367

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Saransh-cpp
Copy link
Member

@Saransh-cpp Saransh-cpp commented Oct 15, 2024

The workflows now produce an HTML rendering of the notebook and upload it as artifact. I have tweaked the nox session to help with this. All the notebooks have been rerun to update the outputs with the recent changes.

Closes: #365

@Saransh-cpp Saransh-cpp added documentation Improvements or additions to documentation infrastructure Project infrastructure: dev tools, packaging, etc. labels Oct 15, 2024
@Saransh-cpp Saransh-cpp self-assigned this Oct 15, 2024
@Saransh-cpp Saransh-cpp marked this pull request as draft October 15, 2024 13:27
@Saransh-cpp Saransh-cpp changed the title gh-365: render notebook outputs on rtd gh-365: upload HTML rendering of notebooks as artifact Oct 18, 2024
@Saransh-cpp Saransh-cpp marked this pull request as ready for review October 18, 2024 10:31
@ntessore
Copy link
Collaborator

Great work @Saransh-cpp! Can you revert the changes to the .ipynb files, which will be nothing but updated timestamps and redrawn plots?

Comment on lines 46 to +53
- name: Run examples
run: nox -s examples
- name: Generate HTML
run: nox -s examples -- html
- uses: actions/upload-artifact@v4
with:
name: Examples
path: examples/**/*.html
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this now executes all of the examples twice: once with jupyter execute examples/**/*.ipynb and once with jupyter nbconvert --execute. You could either remove the first step, or I believe you can remove --execute from the second step.

@ntessore
Copy link
Collaborator

Could you add a dummy file somewhere that triggers the "Test examples" step, to be removed before merging?

@paddyroddy
Copy link
Member

Great work @Saransh-cpp! Can you revert the changes to the .ipynb files, which will be nothing but updated timestamps and redrawn plots?

Could we add this to pre-commit? This keeps the plots, and removes all metadata which doesn't actually get displayed on https://glass.readthedocs.io anyway

repos:
  - repo: https://github.com/kynan/nbstripout
    rev: 0.7.1
    hooks:
      - id: nbstripout
        args:
          - --keep-output

@paddyroddy
Copy link
Member

Could we add this to pre-commit? This keeps the plots, and removes all metadata which doesn't actually get displayed on glass.readthedocs.io anyway

repos:
  - repo: https://github.com/kynan/nbstripout
    rev: 0.7.1
    hooks:
      - id: nbstripout
        args:
          - --keep-output

Have added this and raised #380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation infrastructure Project infrastructure: dev tools, packaging, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Produce and upload HTML artifacts of the notebook runs
3 participants