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

removed .py script examples and replaced with .ipynb #830

Merged
merged 23 commits into from
May 8, 2021

Conversation

shimwell
Copy link
Collaborator

@shimwell shimwell commented May 3, 2021

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 apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

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.

  • Pep8 applied
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

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

@RemDelaporteMathurin
Copy link

@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
@shimwell
Copy link
Collaborator Author

shimwell commented May 4, 2021

@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

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

@RemDelaporteMathurin
Copy link

RemDelaporteMathurin commented May 5, 2021

@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

@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #830 (96b8a05) into develop (00ca6e5) will increase coverage by 0.42%.
The diff coverage is 92.30%.

❗ Current head 96b8a05 differs from pull request most recent head d36ba50. Consider uploading reports for the commit d36ba50 to get more accurate results
Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
...tric_neutronics/make_faceteted_neutronics_model.py 0.00% <0.00%> (ø)
...k/parametric_components/vacuum_vessel_inner_leg.py 93.33% <60.00%> (+67.87%) ⬆️
paramak/reactor.py 91.60% <75.00%> (-0.20%) ⬇️
paramak/parametric_reactors/ball_reactor.py 98.91% <96.00%> (-1.09%) ⬇️
paramak/parametric_reactors/submersion_reactor.py 98.64% <97.82%> (-0.41%) ⬇️
paramak/neutronics_utils.py 84.72% <100.00%> (-1.39%) ⬇️
paramak/parametric_neutronics/neutronics_model.py 93.68% <100.00%> (-0.05%) ⬇️
...ak/parametric_reactors/single_null_ball_reactor.py 75.00% <0.00%> (-25.00%) ⬇️
...ametric_reactors/single_null_submersion_reactor.py 75.00% <0.00%> (-25.00%) ⬇️
paramak/utils.py 97.30% <0.00%> (-2.31%) ⬇️
... and 2 more

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 7214f8d...d36ba50. Read the comment docs.

@shimwell
Copy link
Collaborator Author

shimwell commented May 7, 2021

Screenshot from 2021-05-07 18-42-07

@shimwell shimwell merged commit 718f9de into develop May 8, 2021
@shimwell shimwell deleted the fixing_tests_for_custom_pf_magnet_positions branch May 8, 2021 19:17
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.

unexpected keyword argument 'pf_coil_to_rear_blanket_radial_gap'
2 participants