Skip to content

Commit 9b92589

Browse files
committed
Final tweaks to packaging exercise steps
1 parent 2aedaf6 commit 9b92589

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

03_building_and_packaging/pypi_exercise.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
## Brief idea of the exercise
1111

12-
In this exercise you will convert a Python code into a package that is on [TestPyPI](https://test.pypi.org/). The code is a simple simulation code. After preparing the code for packaging, you will create build artifacts and upload them to the package index.
12+
In this exercise you, will convert a simple simulation code written in Python into a package that is available on [TestPyPI](https://test.pypi.org/).
1313

1414
## Prerequisites
1515

@@ -30,14 +30,14 @@ In this exercise you will convert a Python code into a package that is on [TestP
3030
- Check if your system has Python version >= 3.6 and update it if it is older than 3.6.
3131
- Install pip, build, and twine.
3232
- Install NumPy and Matplotlib with `pip`. The installation instructions can be found on the webpages (links in the Prerequisites section of this document).
33-
- Run the code using `python diffusion2d.py` and observe the output. You should see four plots combined into one figure. Save this figure on your system.
34-
- **Information about diffusion2d.py**: This code solves the diffusion equation in 2D over a square domain which is at a certain temperature and a circular disc at the center which is at a higher temperature. This code solves the diffusion equation using the [finite-difference method](https://en.wikipedia.org/wiki/Finite_difference_method). The thermal diffusivity and initial conditions of the system can be changed by the user. The code produces four plots at various timepoints of the simulation. The diffusion process can be clearly observed in these plots.
33+
- Run the code by running `python diffusion2d.py` and observe the output. You should see four plots combined into one figure. Save this figure on your system.
34+
- **Information about diffusion2d.py**: This code solves the diffusion equation over a two dimensional square domain which is at a certain temperature, and a circular disc at its center which is at a higher temperature. The diffusion equation is solved using the [finite-difference method](https://en.wikipedia.org/wiki/Finite_difference_method). The thermal diffusivity and initial conditions of the system can be changed by the user. The code produces four plots at various timepoints of the simulation. The diffusion process can be clearly observed in these plots.
3535
- Take a few minutes to play around with parameters `dx`, `dy` and `D` in the solver file and observe how the value of `dt` and the output changes. Do you notice if the code takes more or less time to finish the computation?
36-
- If you are interested in the theoretical background of the code, please have a look in [Chapter 7 of the book "Learning Scientific Programming with Python"](https://scipython.com/book/chapter-7-matplotlib/examples/the-two-dimensional-diffusion-equation/).
36+
- If you are interested in the theoretical background of the code, take a look at [chapter 7 of the book "Learning Scientific Programming with Python"](https://scipython.com/book/chapter-7-matplotlib/examples/the-two-dimensional-diffusion-equation/).
3737

3838
## Step 2 - Refactoring the code
3939

40-
- It is good practice to put code specific to a functionality in a separate file for better organization and code sustainability. We will do the same here.
40+
- It is good practice to put code specific to a functionality in a separate file for better readability and sustainability.
4141
- Create a file `output.py` on the same level as `diffusion2d.py`.
4242
- Create two functions in the file `output.py` called `create_plot()` and `output_plots()`.
4343
- The function `create_plot()` should create one plot for one time stamp. In the earlier output, this would be one of the four plots. You will find this functionality inside the time loop in `diffusion2d.py`.

0 commit comments

Comments
 (0)