Regression

projectroot.check_format_py (from CTest)

Failing for the past 1 build (Since #96 )
Took 2.6 sec.

Stacktrace

--- original//var/jenkins/workspace/Cap-experimental/python/source/__init__.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/source/__init__.py
@@ -40,4 +40,5 @@
     """
     return EnergyStorageDevice.build(self, ptree, comm)
 
+
 EnergyStorageDevice.__init__ = build
--- original//var/jenkins/workspace/Cap-experimental/python/source/impedance_spectroscopy.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/source/impedance_spectroscopy.py
@@ -202,6 +202,8 @@
         plot_nyquist(subject._data, figure=self._figure)
         if self._filename is not None:
             pyplot.savefig(self._filename, bbox_inches='tight')
+
+
 Observer._builders['NyquistPlot'] = NyquistPlot
 
 
@@ -227,6 +229,8 @@
 
     def update(self, subject, *args, **kwargs):
         raise NotImplementedError
+
+
 Observer._builders['BodePlot'] = BodePlot
 
 
@@ -296,8 +300,9 @@
         self._line_template += '\r\n'
 
     def update(self, subject, *args, **kwargs):
-        m2_to_cm2 = lambda x: 10000 * x
-        kg_to_g = lambda x: 1000 * x
+        def m2_to_cm2(x): return 10000 * x
+
+        def kg_to_g(x): return 1000 * x
         with open(self._filename, mode='wb') as fout:
             NaN = 255
             extra_data = subject._extra_data
@@ -360,6 +365,8 @@
                     format_spec='.7e'
                 )
                 fout.write(line.encode(self._encoding))
+
+
 Observer._builders['ECLabAsciiFile'] = ECLabAsciiFile
 
 
@@ -444,5 +451,7 @@
             self._data['frequency'] = append(self._data['frequency'], f)
             self._data['impedance'] = append(self._data['impedance'], Z)
             self.notify()
+
+
 for alias in ['EIS', 'ElectrochemicalImpedanceSpectroscopy']:
     Experiment._builders[alias] = ElectrochemicalImpedanceSpectroscopy
--- original//var/jenkins/workspace/Cap-experimental/python/source/ragone_plot.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/source/ragone_plot.py
@@ -130,6 +130,8 @@
         plot_ragone(subject._data, figure=self._figure)
         if self._filename is not None:
             pyplot.savefig(self._filename, bbox_inches='tight')
+
+
 Observer._builders['RagonePlot'] = RagonePlot
 
 # TODO: Probably want to make that class more general to do discharges at
@@ -213,4 +215,6 @@
                                          discharge_power)
             discharge_power *= power(10.0, 1.0 / self._steps_per_decade)
             self.notify()
+
+
 Experiment._builders['RagoneAnalysis'] = RagoneAnalysis
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_end_criterion.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_end_criterion.py
@@ -167,5 +167,6 @@
         self.assertRaises(NotImplementedError, bad_criterion.check, NaN,
                           device)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_impedance_spectroscopy.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_impedance_spectroscopy.py
@@ -231,5 +231,6 @@
 #        bode = BodePlot('bode.png')
 #        bode.update(dummy)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_observer_pattern.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_observer_pattern.py
@@ -142,5 +142,6 @@
         # Now calling it without raising an error.
         dummy.run(None)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_property_tree_wrappers.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_property_tree_wrappers.py
@@ -136,5 +136,6 @@
         self.assertFalse(ptree.get_bool('foo.bar'))
         remove(json_file)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_ragone_plot.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_ragone_plot.py
@@ -114,5 +114,6 @@
                 inf)
             self.assertLess(max_percent_error, 0.1)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_stage.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_stage.py
@@ -70,5 +70,6 @@
         self.assertAlmostEqual(data['voltage'][0], data['voltage'][1])
         self.assertAlmostEqual(data['current'][3], 0.0)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_time_evolution.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_time_evolution.py
@@ -75,5 +75,6 @@
         self.assertRaises(TypeError, TimeEvolution)
         self.assertRaises(RuntimeError, TimeEvolution, PropertyTree())
 
+
 if __name__ == '__main__':
     unittest.main()

Standard Output

--- original//var/jenkins/workspace/Cap-experimental/python/source/__init__.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/source/__init__.py
@@ -40,4 +40,5 @@
     """
     return EnergyStorageDevice.build(self, ptree, comm)
 
+
 EnergyStorageDevice.__init__ = build
--- original//var/jenkins/workspace/Cap-experimental/python/source/impedance_spectroscopy.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/source/impedance_spectroscopy.py
@@ -202,6 +202,8 @@
         plot_nyquist(subject._data, figure=self._figure)
         if self._filename is not None:
             pyplot.savefig(self._filename, bbox_inches='tight')
+
+
 Observer._builders['NyquistPlot'] = NyquistPlot
 
 
@@ -227,6 +229,8 @@
 
     def update(self, subject, *args, **kwargs):
         raise NotImplementedError
+
+
 Observer._builders['BodePlot'] = BodePlot
 
 
@@ -296,8 +300,9 @@
         self._line_template += '\r\n'
 
     def update(self, subject, *args, **kwargs):
-        m2_to_cm2 = lambda x: 10000 * x
-        kg_to_g = lambda x: 1000 * x
+        def m2_to_cm2(x): return 10000 * x
+
+        def kg_to_g(x): return 1000 * x
         with open(self._filename, mode='wb') as fout:
             NaN = 255
             extra_data = subject._extra_data
@@ -360,6 +365,8 @@
                     format_spec='.7e'
                 )
                 fout.write(line.encode(self._encoding))
+
+
 Observer._builders['ECLabAsciiFile'] = ECLabAsciiFile
 
 
@@ -444,5 +451,7 @@
             self._data['frequency'] = append(self._data['frequency'], f)
             self._data['impedance'] = append(self._data['impedance'], Z)
             self.notify()
+
+
 for alias in ['EIS', 'ElectrochemicalImpedanceSpectroscopy']:
     Experiment._builders[alias] = ElectrochemicalImpedanceSpectroscopy
--- original//var/jenkins/workspace/Cap-experimental/python/source/ragone_plot.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/source/ragone_plot.py
@@ -130,6 +130,8 @@
         plot_ragone(subject._data, figure=self._figure)
         if self._filename is not None:
             pyplot.savefig(self._filename, bbox_inches='tight')
+
+
 Observer._builders['RagonePlot'] = RagonePlot
 
 # TODO: Probably want to make that class more general to do discharges at
@@ -213,4 +215,6 @@
                                          discharge_power)
             discharge_power *= power(10.0, 1.0 / self._steps_per_decade)
             self.notify()
+
+
 Experiment._builders['RagoneAnalysis'] = RagoneAnalysis
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_end_criterion.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_end_criterion.py
@@ -167,5 +167,6 @@
         self.assertRaises(NotImplementedError, bad_criterion.check, NaN,
                           device)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_impedance_spectroscopy.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_impedance_spectroscopy.py
@@ -231,5 +231,6 @@
 #        bode = BodePlot('bode.png')
 #        bode.update(dummy)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_observer_pattern.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_observer_pattern.py
@@ -142,5 +142,6 @@
         # Now calling it without raising an error.
         dummy.run(None)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_property_tree_wrappers.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_property_tree_wrappers.py
@@ -136,5 +136,6 @@
         self.assertFalse(ptree.get_bool('foo.bar'))
         remove(json_file)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_ragone_plot.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_ragone_plot.py
@@ -114,5 +114,6 @@
                 inf)
             self.assertLess(max_percent_error, 0.1)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_stage.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_stage.py
@@ -70,5 +70,6 @@
         self.assertAlmostEqual(data['voltage'][0], data['voltage'][1])
         self.assertAlmostEqual(data['current'][3], 0.0)
 
+
 if __name__ == '__main__':
     unittest.main()
--- original//var/jenkins/workspace/Cap-experimental/python/test/test_time_evolution.py
+++ fixed//var/jenkins/workspace/Cap-experimental/python/test/test_time_evolution.py
@@ -75,5 +75,6 @@
         self.assertRaises(TypeError, TimeEvolution)
         self.assertRaises(RuntimeError, TimeEvolution, PropertyTree())
 
+
 if __name__ == '__main__':
     unittest.main()