.__setup_params() -> ._setup_params() in hooke/plugin/*.py.
authorW. Trevor King <wking@drexel.edu>
Sat, 28 Aug 2010 23:35:49 +0000 (19:35 -0400)
committerW. Trevor King <wking@drexel.edu>
Sat, 28 Aug 2010 23:35:49 +0000 (19:35 -0400)
Methods starting with '__' get special name mangling.
  http://docs.python.org/reference/expressions.html#atom-identifiers
We don't want any of that.

hooke/plugin/command_stack.py
hooke/plugin/curve.py
hooke/plugin/flatfilt.py
hooke/plugin/playlist.py
hooke/plugin/polymer_fit.py
hooke/plugin/vclamp.py

index 3dfc731cd423d23e3d369b3ca7684dfa31bef44e..59ca5ddbe79e98782ff5d60f3d038cf2293349cf 100644 (file)
@@ -228,10 +228,10 @@ input command stack.  If the command stack does not have an input file
             help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
-        params = self.__setup_params(hooke, params)
+        params = self._setup_params(hooke, params)
         self.plugin.command_stack.save(params['output'])
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         if params['output'] == None and self.plugin.command_stack.path == None:
             params['output'] = 'default'
         if params['output'] != None:
@@ -256,11 +256,11 @@ File name for the input command stack.
             help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
-        params = self.__setup_params(hooke, params)
+        params = self._setup_params(hooke, params)
         self.plugin.command_stack.clear()
         self.plugin.command_stack.load(params['input'])
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         if params['input'] == None and self.plugin.command_stack.path == None:
             params['input'] = 'default'
         if params['input'] != None:
@@ -285,12 +285,12 @@ current stack.
             help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         if len(params['commands']) == 0:
             return
         params['commands'].execute(hooke=hooke, stack=params['stack'])
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         if params['commands'] == None:
             params['commands'] = self.plugin.command_stack
         return params
index d51ddfdef1681851bb0e4fbcaffb688054af4699..5df5629f776d1b2c48a096deae4c8e006d8f2778 100644 (file)
@@ -451,7 +451,7 @@ Name of the new column for storing the difference (without units, defaults to
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         data_A = self._get_column(hooke=hooke, params=params,
                                   block_name='block A',
                                   column_name='column A')
@@ -464,7 +464,7 @@ Name of the new column for storing the difference (without units, defaults to
                          column_name='output column',
                          values=out)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         curve = self._curve(hooke, params)
         if params['block A'] == None:
             params['block A'] = curve.data[0].info['name']
@@ -526,7 +526,7 @@ central differencing.
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         x_data = self._get_column(hooke=hooke, params=params,
                                   column_name='x column')
         f_data = self._get_column(hooke=hooke, params=params,
@@ -537,7 +537,7 @@ central differencing.
                          column_name='output column',
                          values=d)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         curve = self._curve(hooke, params)
         x_name,x_unit = split_data_label(params['x column'])
         f_name,f_unit = split_data_label(params['f column'])
@@ -591,7 +591,7 @@ Otherwise, the chunks are end-to-end, and not overlapping.
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         data = self._get_column(hooke=hooke, params=params)
         bounds = params['bounds']
         if bounds != None:
@@ -615,7 +615,7 @@ Otherwise, the chunks are end-to-end, and not overlapping.
                          values=power)
         outqueue.put(b)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         if params['output block'] in self._block_names(hooke, params):
             raise Failure('output block %s already exists in %s.'
                           % (params['output block'],
index 79300cd77a818556da307de4475d049a0420abc2..21665fecbc3e6412829deffdd39a123df69209f7 100644 (file)
@@ -144,7 +144,7 @@ Name for storing the list of peaks in the `.info` dictionary.
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         block = self._block(hooke=hooke, params=params)
         dist_data = self._get_column(hooke=hooke, params=params,
                                      column_name='distance column')
@@ -165,7 +165,7 @@ Name for storing the list of peaks in the `.info` dictionary.
                          values=peaks_to_mask(def_data, peaks) * def_data)
         outqueue.put(peaks)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         """Setup `params` from config and return the z piezo and
         deflection arrays.
         """
index 43978b5669f7eba4f58fbb43241fa2dbb6090309..616cfed6739c52ff73627cd0aff6ffc97cb19973 100644 (file)
@@ -372,7 +372,7 @@ Evaluate the applied command stack immediately.
             help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         p = self._playlist(hooke, params)
         if params['evaluate'] == True:
             exec_cmd = hooke.command_by_name['execute command stack']
@@ -387,7 +387,7 @@ Evaluate the applied command stack immediately.
                 curve.set_hooke(hooke)
                 p.unload(curve)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         if params['commands'] == None:
             cstack_plugin = [p for p in hooke.plugins
                              if p.name == 'command_stack'][0]
index c3d715cac554771684db2673ecc8a4cc9054f52d..9d1a86b6d50de845701d03064c64ac37bb36bbf8 100644 (file)
@@ -944,7 +944,7 @@ Indicies of points bounding the selected data.
             help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
-        params = self.__setup_params(hooke, params)
+        params = self._setup_params(hooke, params)
         data = self._block(hooke, params)
         model = params['polymer model']
         dist_data = self._get_column(
@@ -960,7 +960,7 @@ Indicies of points bounding the selected data.
                          column_name='output tension column',
                          values=tension_data)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         for key,value in params.items():
             if value == None:  # Use configured default value.
                 params[key] = self.plugin.config[key]
index 88306ff44ededee715b174438cd18da374e46356..441f1fea930214597d0998144ca69eca74e9beda 100644 (file)
@@ -304,7 +304,7 @@ Name (without units) for storing fit parameters in the `.info` dictionary.
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         block = self._block(hooke=hooke, params=params)
         dist_data = self._get_column(hooke=hooke, params=params,
                                      column_name='distance column')
@@ -323,7 +323,7 @@ Name (without units) for storing fit parameters in the `.info` dictionary.
                          column_name='output deflection column',
                          values=def_data - def_offset)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         name,dist_unit = split_data_label(params['distance column'])
         name,def_unit = split_data_label(params['deflection column'])
         params['output distance column'] = join_data_label(
@@ -521,7 +521,7 @@ Name of the spring constant in the `.info` dictionary.
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         def_data = self._get_column(hooke=hooke, params=params,
                                     column_name='deflection column')
         out = def_data * def_data.info[params['spring constant info name']]
@@ -529,7 +529,7 @@ Name of the spring constant in the `.info` dictionary.
                          column_name='output deflection column',
                          values=out)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         name,in_unit = split_data_label(params['deflection column'])
         out_unit = 'N'  # HACK: extract target units from k_unit.
         params['output deflection column'] = join_data_label(
@@ -579,7 +579,7 @@ Name of the spring constant in the `.info` dictionary.
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         def_data = self._get_column(hooke=hooke, params=params,
                                     column_name='deflection column')
         dist_data = self._get_column(hooke=hooke, params=params,
@@ -592,7 +592,7 @@ Name of the spring constant in the `.info` dictionary.
                          column_name='output distance column',
                          values=dist_data - def_data / k)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         name,dist_unit = split_data_label(params['distance column'])
         name,def_unit = split_data_label(params['deflection column'])
         params['output distance column'] = join_data_label(
@@ -656,7 +656,7 @@ Name of the flattening information in the `.info` dictionary.
 
     def _run(self, hooke, inqueue, outqueue, params):
         self._add_to_command_stack(params)
-        params = self.__setup_params(hooke=hooke, params=params)
+        params = self._setup_params(hooke=hooke, params=params)
         block = self._block(hooke=hooke, params=params)
         dist_data = self._get_column(hooke=hooke, params=params,
                                      column_name='distance column')
@@ -690,7 +690,7 @@ Name of the flattening information in the `.info` dictionary.
                          column_name='output deflection column',
                          values=out)
 
-    def __setup_params(self, hooke, params):
+    def _setup_params(self, hooke, params):
         d_name,d_unit = split_data_label(params['deflection column'])
         params['output deflection column'] = join_data_label(
             params['output deflection column'], d_unit)