From 5aeb156036da0627001744b563b39e932a52f1f2 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Sat, 28 Jul 2018 00:04:38 +0200 Subject: [PATCH] Fix a couple of minor code quality issues --- cscripts/cslightcrv.py | 6 +++--- cscripts/csphagen.py | 6 +++--- cscripts/csphasecrv.py | 6 +++--- cscripts/cspull.py | 6 +++--- cscripts/cssens.py | 6 +++--- cscripts/csspec.py | 6 +++--- cscripts/cstsdist.py | 6 +++--- test/test_cscript.py | 5 ++--- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/cscripts/cslightcrv.py b/cscripts/cslightcrv.py index fc0b950..7539500 100755 --- a/cscripts/cslightcrv.py +++ b/cscripts/cslightcrv.py @@ -30,7 +30,7 @@ from cscripts import mputils # Global functions for multiprocessing support # # ============================================ # def _multiprocessing_func_wrapper(args): - return _multiprocessing_func(*args) + return _multiprocessing_func(*args) def _multiprocessing_func(cls, i): # Initialise thread logger @@ -41,13 +41,13 @@ def _multiprocessing_func(cls, i): cstart = cls.celapse() result = cls._timebin(i) celapse = cls.celapse() - cstart - buffer = cls._log.buffer() + log = cls._log.buffer() # Close logger cls._log.close() # Collect thread information - info = {'celapse': celapse, 'log': buffer} + info = {'celapse': celapse, 'log': log} # Return light curve bin result and thread information return result, info diff --git a/cscripts/csphagen.py b/cscripts/csphagen.py index dbef5db..1403fe2 100755 --- a/cscripts/csphagen.py +++ b/cscripts/csphagen.py @@ -29,7 +29,7 @@ from cscripts import mputils # Global functions for multiprocessing support # # ============================================ # def _multiprocessing_func_wrapper(args): - return _multiprocessing_func(*args) + return _multiprocessing_func(*args) def _multiprocessing_func(cls, i): # Initialise thread logger @@ -40,13 +40,13 @@ def _multiprocessing_func(cls, i): cstart = cls.celapse() result = cls._process_observation(i) celapse = cls.celapse() - cstart - buffer = cls._log.buffer() + log = cls._log.buffer() # Close logger cls._log.close() # Collect thread information - info = {'celapse': celapse, 'log': buffer} + info = {'celapse': celapse, 'log': log} # Return light curve bin result and thread information return result, info diff --git a/cscripts/csphasecrv.py b/cscripts/csphasecrv.py index b299079..9ac08ba 100755 --- a/cscripts/csphasecrv.py +++ b/cscripts/csphasecrv.py @@ -29,7 +29,7 @@ from cscripts import mputils # Global functions for multiprocessing support # # ============================================ # def _multiprocessing_func_wrapper(args): - return _multiprocessing_func(*args) + return _multiprocessing_func(*args) def _multiprocessing_func(cls, phbin): # Initialise thread logger @@ -40,13 +40,13 @@ def _multiprocessing_func(cls, phbin): cstart = cls.celapse() result = cls._phase_bin(phbin) celapse = cls.celapse() - cstart - buffer = cls._log.buffer() + log = cls._log.buffer() # Close logger cls._log.close() # Collect thread information - info = {'celapse': celapse, 'log': buffer} + info = {'celapse': celapse, 'log': log} # Return light curve bin result and thread information return result, info diff --git a/cscripts/cspull.py b/cscripts/cspull.py index 8a43037..9b1e0fd 100755 --- a/cscripts/cspull.py +++ b/cscripts/cspull.py @@ -30,7 +30,7 @@ from cscripts import mputils # Global functions for multiprocessing support # # ============================================ # def _multiprocessing_func_wrapper(args): - return _multiprocessing_func(*args) + return _multiprocessing_func(*args) def _multiprocessing_func(cls, i): # Initialise thread logger @@ -41,13 +41,13 @@ def _multiprocessing_func(cls, i): cstart = cls.celapse() result = cls._trial(i) celapse = cls.celapse() - cstart - buffer = cls._log.buffer() + log = cls._log.buffer() # Close logger cls._log.close() # Collect thread information - info = {'celapse': celapse, 'log': buffer} + info = {'celapse': celapse, 'log': log} # Return light curve bin result and thread information return result, info diff --git a/cscripts/cssens.py b/cscripts/cssens.py index cadd361..fb0cf84 100755 --- a/cscripts/cssens.py +++ b/cscripts/cssens.py @@ -32,7 +32,7 @@ from cscripts import mputils # Global functions for multiprocessing support # # ============================================ # def _multiprocessing_func_wrapper(args): - return _multiprocessing_func(*args) + return _multiprocessing_func(*args) def _multiprocessing_func(cls, i): # Initialise thread logger @@ -43,13 +43,13 @@ def _multiprocessing_func(cls, i): cstart = cls.celapse() result = cls._e_bin(i) celapse = cls.celapse() - cstart - buffer = cls._log.buffer() + log = cls._log.buffer() # Close logger cls._log.close() # Collect thread information - info = {'celapse': celapse, 'log': buffer} + info = {'celapse': celapse, 'log': log} # Return light curve bin result and thread information return result, info diff --git a/cscripts/csspec.py b/cscripts/csspec.py index 6c4bba7..f79fa40 100755 --- a/cscripts/csspec.py +++ b/cscripts/csspec.py @@ -28,7 +28,7 @@ from cscripts import mputils # Global functions for multiprocessing support # # ============================================ # def _multiprocessing_func_wrapper(args): - return _multiprocessing_func(*args) + return _multiprocessing_func(*args) def _multiprocessing_func(cls, i): # Initialise thread logger @@ -39,13 +39,13 @@ def _multiprocessing_func(cls, i): cstart = cls.celapse() result = cls._fit_energy_bin(i) celapse = cls.celapse() - cstart - buffer = cls._log.buffer() + log = cls._log.buffer() # Close logger cls._log.close() # Collect thread information - info = {'celapse': celapse, 'log': buffer} + info = {'celapse': celapse, 'log': log} # Return light curve bin result and thread information return result, info diff --git a/cscripts/cstsdist.py b/cscripts/cstsdist.py index 59b7efb..977ec2a 100755 --- a/cscripts/cstsdist.py +++ b/cscripts/cstsdist.py @@ -31,7 +31,7 @@ from cscripts import mputils # Global functions for multiprocessing support # # ============================================ # def _multiprocessing_func_wrapper(args): - return _multiprocessing_func(*args) + return _multiprocessing_func(*args) def _multiprocessing_func(cls, i): # Initialise thread logger @@ -42,13 +42,13 @@ def _multiprocessing_func(cls, i): cstart = cls.celapse() result = cls._trial(i) celapse = cls.celapse() - cstart - buffer = cls._log.buffer() + log = cls._log.buffer() # Close logger cls._log.close() # Collect thread information - info = {'celapse': celapse, 'log': buffer} + info = {'celapse': celapse, 'log': log} # Return light curve bin result and thread information return result, info diff --git a/test/test_cscript.py b/test/test_cscript.py index feeaca2..f262dfb 100755 --- a/test/test_cscript.py +++ b/test/test_cscript.py @@ -1,6 +1,6 @@ #! /usr/bin/env python # ========================================================================== -# This scripts performs unit tests for the cspull script. +# This scripts performs unit tests for the cscript base classes. # # Copyright (C) 2016-2018 Juergen Knoedlseder # @@ -341,7 +341,7 @@ class Test(test): test = cscript_test() # Recover User parameters - pars = test.pars() + pars = test.pars() # Create a copy of the User parameters cpy_pars = pars.copy() @@ -352,7 +352,6 @@ class Test(test): # Return return (test, pars, cpy_pars) - # Test cscript base class def _test_cscript(self): """ -- libgit2 0.21.4