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

Test notebooks with a separate CI workflow #151

Merged
merged 5 commits into from
Feb 16, 2025

Conversation

mdpiper
Copy link
Member

@mdpiper mdpiper commented Feb 14, 2025

This PR moves the test-notebooks job to a separate workflow. I also disabled testing on pymt and terrainbento notebooks.

@mdpiper mdpiper marked this pull request as ready for review February 14, 2025 21:30
@mdpiper mdpiper requested a review from mcflugen February 14, 2025 21:30
Copy link
Member

@mcflugen mcflugen left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

This is the old way of reading an ESRI ASCII file. We should update this notebook to use the new way. But in another pull request.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, OK. I couldn't remember which was the new way. I only changed it because it was failing in the CI test.

Copy link
Member

Choose a reason for hiding this comment

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

For a future pr, the new way is something like,

from landlab.io import esri_ascii

with open("data/square-test-basin.asc") as stream:
    grid = esri_ascii.load(filepath, name="topographic__elevation")
z = grid.at_node["topographic__elevation"]

Copy link
Member

Choose a reason for hiding this comment

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

Why did you decide to run this job as a separate workflow?

Copy link
Member Author

Choose a reason for hiding this comment

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

I like separating unit tests from checking notebooks. They feel like different things, even though we call both "tests" and they run through pytest. Also test.yml was longer than one screen.

Is there a penalty for splitting jobs across workflows instead of grouping them into one workflow?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe this is a subject for discussion on the Forum!

Copy link
Member

@mcflugen mcflugen Feb 15, 2025

Choose a reason for hiding this comment

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

Since the workflows are independent of one another, it's fine separating them. If you had a third job (e.g. maybe building/deploying docs or deploying to PyPI) that required both the regular tests and the notebook tests to complete, then you would have to put them in a single workflow.

@mdpiper mdpiper merged commit 1c5e257 into main Feb 16, 2025
11 checks passed
@mdpiper mdpiper deleted the mdpiper/separate-notebook-workflow branch February 16, 2025 00:35
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.

2 participants