Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_degradation_year_on_year(self):
''' Test degradation with year on year approach. '''
funcName = sys._getframe().f_code.co_name
print '\r', 'Running ', funcName
# test classical decomposition degradation calc
print 'Frequency: ', self.input_freq
rd_result = degradation_year_on_year(self.test_CD_YOY_corr_energy)
self.assertAlmostEqual(rd_result[0], 100*self.rd, places=1)
print 'Actual: ', 100*self.rd
print 'Estimated: ', rd_result[0]
def test_degradation_year_on_year(self):
''' Test degradation with year on year approach. '''
funcName = sys._getframe().f_code.co_name
print '\r', 'Running ', funcName
# test YOY degradation calc
for input_freq in self.list_YOY_input_freq:
print 'Frequency: ', input_freq
rd_result = degradation_year_on_year(self.test_corr_energy[input_freq])
self.assertAlmostEqual(rd_result[0], 100 * self.rd, places=1)
print 'Actual: ', 100 * self.rd
print 'Estimated: ', rd_result[0]