-
Notifications
You must be signed in to change notification settings - Fork 12
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
removed .py script examples and replaced with .ipynb #830
removed .py script examples and replaced with .ipynb #830
Conversation
@shimwell these notebooks will look fab! I recently learned my way through testing demos notebooks in the CI by first converting them to .py with nbconvert and then run them. If you're interested let me know |
…com:ukaea/paramak into fixing_tests_for_custom_pf_magnet_positions
Thanks Remi, there is a method used to test the notebooks in this PR but I would be keen to take a look at anything just in case the method I have can be improved on https://github.com/ukaea/paramak/blob/develop/tests/notebook_testing.py |
@shimwell this is what I use for FESTIM. It is a seperated workflow that runs in parrallel to the unit test suite. # This is a basic workflow to help you get started with Actions
name: Test demos
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: quay.io/fenicsproject/stable:latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run the notebooks
run: |
jupyter-nbconvert --to python demos/demo_multi_materials.ipynb
mkdir outputs
python3 -m demos.demo_multi_materials
jupyter-nbconvert --to python demos/demo_meshes.ipynb
python3 -m demos.demo_meshes
jupyter-nbconvert --to python demos/demo_derived_quantities.ipynb
python3 -m demos.demo_derived_quantities
jupyter-nbconvert --to python demos/demo_Ogorodnikova.ipynb
python3 -m demos.demo_Ogorodnikova
jupyter-nbconvert --to python demos/demo_coupled_heat_transfer.ipynb
python3 -m demos.demo_coupled_heat_transfer |
…com:ukaea/paramak into fixing_tests_for_custom_pf_magnet_positions
Codecov Report
@@ Coverage Diff @@
## develop #830 +/- ##
===========================================
+ Coverage 94.23% 94.66% +0.42%
===========================================
Files 75 75
Lines 5345 5377 +32
===========================================
+ Hits 5037 5090 +53
+ Misses 308 287 -21
Continue to review full report at Codecov.
|
Proposed changes
The py files were becoming a bit of a burden to maintain and the ipynb files were starting to duplicate them.
This PR tidies up the examples so that all the examples are on python notebooks instead of py scripts.
TODO
-[ ] update links in the documentation rst files
-[ ] convert neutroncis examples to notebooks
Types of changes
What types of changes does your code introduce to the Paramak?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...