Methods starting with '__' get special name mangling.
http://docs.python.org/reference/expressions.html#atom-identifiers
We don't want any of that.
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:
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:
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
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')
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']
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,
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'])
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:
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'],
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')
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.
"""
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']
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]
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(
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]
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')
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(
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']]
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(
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,
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(
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')
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)