How to keep Python DUT from validating while the testplan is running

I have made a DUT in python that works fairly well, but is slow during running with a tapplan that references other tapplans. I’ve found part of the issue is that eveytime it gets to a referenced plan it inits the DUT, and that causes the validation rule for the DUT to run. The validation rule checks the filename referenced and reloads all the signals for the DUT. I only need the validation to run during init or preplan, so I want to determine if a testplan is running so the validation function can just exit.

Any help will be appreciated.

Rob