Skip to content

Recommended Debugging Approaches in MsPASS

Will Yang edited this page Sep 28, 2021 · 6 revisions

Debugging in C++

There could be a possibility that you might get an error in the C++ code when using MsPASS, and here is a way you could try to debug and figure it out.

Debugging in Python

First of all, for errors because of incorrect usage, you might need to turn to our wiki page for reference, which contains the user manual focusing on how we design each concept and feature, and reference manual documenting Python and C++ APIs.

For other bugs and issues that you are unable to resolve, please report them as issues in our GitHub.

If you would like to debug it by yourself, we suggest that you could follow the way how we write our test cases under python/tests folders. Basically, you could write a function as a unit testcase and test the functionality you would like to in your workflow. Some syntactic sugars in pytest would help if you would like to test some more complex workflows.

Then make sure you install pytest beforehand and assuming your shell is at the top of the mspass tree (i.e. in the mspass directory) type the following into your terminal window:

pytest --cov=mspasspy python/tests/path_to_your_test_case.py Make sure you type the correct path of the unit test file you would like to run and you would see the result and debug it by yourself.