예제 #1
0
 def _make_by_spec(self):
     self._get_by_spec, self._save_by_spec, self._delete_by_spec \
             = utils.make_variable_data(self.path + "_by_spec", 
                                        tb.Float32Col)
예제 #2
0
        _save_mass(self.uuid, self.mass)

    def _on_delete(self):
        utils.TableObject._on_delete(self)
        _delete_image(self.uuid, self.spec.shape)
        _delete_mass(self.uuid, self.spec.stop_on_time)

class ResultTable(tb.IsDescription):
    uuid = utils.make_uuid_col()
    spec_uuid = tb.StringCol(32)
Result.setup_table("results", ResultTable, 
                   sorted_indices=['uuid', 'spec_uuid'])

_get_image, _save_image, _delete_image \
        = utils.make_variable_data("_results_image", tb.BoolCol,
                                   filters=tb.Filters(complib='zlib', 
                                                      complevel=9))
_get_mass, _save_mass, _delete_mass \
        = utils.make_variable_data("_results_mass", tb.UInt16Col,
                                   filters=tb.Filters(complib='zlib', 
                                                      complevel=9))
@utils.memoized
def _get_image_table(size):
    class Image(utils.EasyTableObject): pass
    class ImageTable(tb.IsDescription):
        uuid = utils.make_uuid_col()
        image = tb.BoolCol(shape=size)

    name = "_result_images_{0}x{1}".format(*size)
    Image.setup_table(name, ImageTable,
                      filters=tb.Filters(complib='zlib', complevel=9))
예제 #3
0
 def _make_by_result(self, column, table_args):
     self._get_by_result, self._save_by_result, self._delete_by_result \
             = utils.make_variable_data(self.path, column, **table_args)