ESCOMP / ESCOMP/CTSM

Add some unit tests for mesh_modifier python modules

Open
#2,153 0 comments 0 reactions 1 assignee Claimed by @slevis-lmwg View on GitHub
enhancement testing
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
2d 21h
Merged PRs (30d)
7

Description

In working with the mesh_modifier tool on the CTSM5.2 branch, I realized that adding some unit testing would be helpful for maintaining the tool. Unit tests that test whether floats could be used for the mask in addition to ints would be helpful. We thought both would work, but we showed that only ints work in the code as it is. There are a couple places where the code aborts, and unit tests around the error checking would be helpful.

Unit tests are also helpful when another person works on a bit of code, because it makes it clear what the code can and cannot do. So this helps them to become clear on what to expect the code to do, and not have to read and experiment with the code to find out its capabilities. So unit tests help with the team effort on maintaining our tools.

We also want to ensure our code will continue to work with updates in python and python module version updates. The best way to know that is to have tests that verify it functions correctly. The ideal for unit testing is that you ensure that every line functions correctly and edge cases in logic and all options are tested. We may not always do that, but when that goal is achieved it makes it easier to refactor tools to make new features easier to add or to better support the code, as well as general maintenance of the tool with the CTSM team of developers.

Adding a unit tester and a few unit tests for the mesh_modifier tool won't be hard or take too long to do.

@slevis-lmwg

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.