[ ]:
# Document Author: Dr. Vishal Sharma
# Author email: sharma_vishal14@hotmail.com
# License: MIT
# This tutorial is applicable for NAnPack version 1.0.0-alpha4

Running Tests

Users are advised to follow the instructions given here to run the required tests on Jupyter Notebook after installing the package.

Enter these commands on terminal or Jupyter Notebook to run the tests.

Note:
On Windows command line remove “%run” from the commands given below. “%run” is the magic IPython command used in Jupyter Notebook.

Test # 1

First test is to verify whether the nanpack is installed correctly on your system. This is performed by running “test_nanpack.py” file in the tests folder of your project root. Enter the command shown in cell 2 (replace with correct project path) of this notebook and verify that the test is completed successfully as shown in the ouput below.

[1]:
%run -m nanpack.tests.test_nanpackinstall
NAnPack package test SUCCESS.

Test # 2

Next test is to verify whether the required third party packages- NumPy and matplotlib are installed correctly on your system. Run script “test_thirdpartyinstalls.py” by entering the command shown in cell 3 (replace with correct project path) and verify that the test is completed successfully as shown in the ouput below.

[2]:
%run -m nanpack.tests.test_thirdpartyinstalls
Close plot to continue testing.
_images/running-tests_5_1.png
Numpy package test SUCCESS.
Matplotlib package test SUCCESS.
Math package test SUCCESS.

Test # 3

Lestly, we need to verify that the important components of nanpack are working. Enter the command shown in cell 3 (replace with correct project path) and verify that the test is completed successfully as shown in the ouput below.

[3]:
%run -m nanpack.tests.test_run
Uniform rectangular grid generation in cartesian coordinate system: Completed.
2
Assigning COLD-START initial conditions to the dependent term.
Initialization: Completed.
   ITER           ERROR
   ----           -----
      2    340.19325284
      4     41.00275596
      6     14.14011094
      8      6.69943966
     10      3.00219428
     12      1.33465332
     14      0.60100640
     16      0.27475525
     18      0.12717846
     20      0.05943372
     22      0.02797837
     24      0.01324526
Starting calculations to obtain analytical solution.
Calculating analytical solution: Completed.
Test run execution SUCCESS.
_images/running-tests_7_1.png

What to do next?

After these tests are successful, you may proceed to running some example scripts that you may create yourself using the tutorials included in the documentation.
If the tests are not successful, here are some options to look into:
  1. If Test # 1 failed, try re-installing package. Make sure that the Python is included in your environment path variable. Please bring it to the attention of the author by raising an issue on GitHub or by messaging me on Twitter (@_NAnPack) or on LinkedIn NAnPack Community group.

  2. If Test # 2 failed, check which package is not working and re-install the package.

  3. If Test # 1 and Test # 2 passed, then Test # 3 must complete successfully too. If it doesn’t please bring the issue to the attention of the author by raising an issue on GitHub or by messaging me on Twitter (@_NAnPack) or on LinkedIn NAnPack Community group.