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

Merged
merged 13 commits into from
Nov 7, 2024

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 62
- 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

@Saransh-cpp Saransh-cpp force-pushed the saransh/run-nb-on-rtd branch 2 times, most recently from b0b64fc to c222771 Compare November 5, 2024 14:12
@Saransh-cpp Saransh-cpp changed the base branch from main to paddy/issue-385 November 5, 2024 16:08
@Saransh-cpp
Copy link
Member Author

The artifact upload worked - https://github.com/glass-dev/glass/actions/runs/11701933760

glass/remove_me.py Outdated Show resolved Hide resolved
.github/workflows/examples.yml Outdated Show resolved Hide resolved
Copy link
Member

@paddyroddy paddyroddy left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Collaborator

@ntessore ntessore left a comment

Choose a reason for hiding this comment

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

Looks great and will come in very handy for debugging!

Base automatically changed from paddy/issue-385 to main November 7, 2024 20:39
@paddyroddy paddyroddy merged commit 42e5a10 into main Nov 7, 2024
16 checks passed
@paddyroddy paddyroddy deleted the saransh/run-nb-on-rtd branch November 7, 2024 20:39
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