Skip to content

How should I go about implementing the existing Python functions using Devito?

Rini Banerjee edited this page Aug 6, 2020 · 3 revisions

When implementing the existing Python functions in fdm-devito-notebooks using Devito, open the notebook you are working on and work out if the code is from the corresponding Python file in src-<section> or more like pseudocode. Take a look at this page to see what you should do in terms of initial formatting.

If your code was pseudocode, all you need to do is change the code in the notebook to use Devito (if applicable) and you're done!

If it was in a .py file, we recommend you follow these steps:

  1. Change the code in the Python file to use Devito. Talk to us on Slack about any issues you are facing - we are happy to help!
  2. Make sure the notebook is still compiling.
  3. (If applicable) Run the tests and keep working on your code until it is correct.
  4. Read through the section you have just Devito-fied. Do the steps you have taken make sense to the reader? If not, add some Markdown cells in between, explaining what you have done.