Testing and ensuring the quality of python code developed for the scripting interface
Python scripting in Ansys Mechanical is slowly becoming more common in my team.
Initially, I would share small snippets and files with function definitions directly with those who were interested in trying it out.
Now that more people are becoming comfortable with the python interface, more engineers are writing and editing functions to solve their needs.
I would like to develop a system for proposing changes, testing and storing the code we develop. At a minimum, we need to be able to check that the functions we write keep working in future versions of Ansys.
Writing automatic test cases with code-based model generation-meshing-solving-postprocessing would fit into the "github workflow" with a repository containing test & src files, pull requests etc. However it seems like a large undertaking to write the tests and teach this workflow.
Maintaining test cases constructed by hand seems error prone and time-intensive. However most engineers currently use hand-crafted models to test the functions they write, so in the short term there is little cost of collecting the models and storing them.
How does the Ansys developer community solve this problem? What tips and tricks can you share regarding how to organize my/our growing collection of functions?