Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@timeit(delim=True, n=100)
def mutator_test_run():
MutatorBenchmarker().run_tests()
@timeit(delim=True, n=100)
def probability_test_run():
ProbabilityBenchmarker().run_tests()
@timeit
def __pair_corr(self):
"""Get pair correlation."""
pairs = cwr(self.sp.species, 2)
for s1, s2 in pairs:
self.sp.pair_corr(s1, s2)
@timeit
def run_tests(self):
"""Initialize Mutator and perform tests."""
self.__cm_setup()
self.__pair_corr()
@timeit
def __sp_setup(self):
"""Set up SubstitutionProbability."""
self.sp = SubstitutionProbability()
@timeit
def run_tests(self):
"""Run all tests."""
self.__sp_setup()
self.__pair_corr()
@timeit
def __pair_corr(self):
"""Get pair correlations."""
self.cm.complete_pair_corrs()
@timeit
def __cm_setup(self) -> CationMutator:
"""Create a CationMutator."""
self.cm = CationMutator.from_json()