Ejemplo n.º 1
0
 def test_vm_p_b(self):
     path_stack = './tests/stack_vm.stack'
     stack = qp.Stack('viewmanager').load(path_stack, load_cache=True)
     vm = ViewManager(stack)
     vm.get_views(cell_items='colpct', freqs=True, nets=False,
                  stats=None, tests=None, weight=None,
                  bases='auto')
     vm.set_bases('uw', 'uw', False, ['gross', 'base'])
     vm_views = vm.views
     self.assertEqual(vm_views, E['p_b'])
Ejemplo n.º 2
0
 def test_vm_cp_b_w_auto(self):
     path_stack = './tests/stack_vm.stack'
     stack = qp.Stack('viewmanager').load(path_stack, load_cache=True)
     vm = ViewManager(stack)
     vm.get_views(cell_items='counts_colpct', freqs=True,
                  nets=False, stats=None, tests=None,
                  weight='weight_a', bases='auto')
     vm.set_bases('w', 'w', 'w', ['gross', 'base', 'effective'])
     vm_views = vm.views
     self.assertEqual(vm_views, E['cp_b_w_auto'])
Ejemplo n.º 3
0
 def test_vm_c_b(self):
     stack = self._get_stack(self)
     path_stack = './tests/stack_vm.stack'
     stack.save(path_stack)
     vm = ViewManager(stack)
     vm.get_views(cell_items='counts', freqs=True, nets=False,
                  stats=None, tests=None, weight=None,
                  bases='auto')
     vm.set_bases('uw', 'uw', False, ['gross', 'base'])
     vm_views = vm.views
     self.assertEqual(vm_views, E['c_b'])
Ejemplo n.º 4
0
 def test_vm_p_b_n_s_t_w_both(self):
     path_stack = './tests/stack_vm.stack'
     stack = qp.Stack('viewmanager').load(path_stack, load_cache=True)
     vm = ViewManager(stack)
     vm.get_views(cell_items='colpct', freqs=True, nets=True,
                  stats=['mean', 'stddev'], tests=['0.05'],
                  weight='weight_a', bases='both')
     vm.set_bases('both', 'both', 'w', ['gross', 'base', 'effective'],
                  'before', True)
     vm_views = vm.views
     self.assertEqual(vm_views, E['p_b_n_s_t_w_both'])
Ejemplo n.º 5
0
 def test_vm_p_b_w_both(self):
     path_stack = './tests/stack_vm.stack'
     stack = qp.Stack('viewmanager').load(path_stack, load_cache=True)
     vm = ViewManager(stack)
     vm.get_views(cell_items='colpct', freqs=True, nets=False,
                  stats=None, tests=None, weight='weight_a',
                  bases='both')
     vm.set_bases('both', 'both', 'w', ['gross', 'base', 'effective'],
                  'before', True)
     vm_views = vm.views
     self.assertEqual(vm_views, E['p_b_w_both'])
     path_cache = './tests/stack_vm.cache'
     os.remove(path_stack)
     os.remove(path_cache)