Пример #1
0
 def test_get_indexes_num_elems(self):
     self.config.attributes.observables.types = {
         'gender': CommonTypes.any.value
     }
     self.config.attributes_dict = load_attributes_dict(self.config)
     indexes = get_indexes(self.config)
     self.assertEqual(len(indexes), 729)
Пример #2
0
    def initialize(self):

        self.excluded = load_excluded(self)

        self.annotations_dict = load_annotations_dict(self)
        subset_annotations(self)

        self.attributes_dict = load_attributes_dict(self)
        self.attributes_indexes = get_indexes(self)
        subset_attributes(self)
        self.cells_dict = load_cells_dict(self)
        subset_cells(self)
Пример #3
0
    def initialize(self):

        if self.is_init:

            if self.annotations is not None:
                self.excluded = load_excluded(self)
                self.annotations_dict = load_annotations_dict(self)
                subset_annotations(self)

            self.observables_dict = load_observables_dict(self)
            self.observables_categorical_dict = load_observables_categorical_dict(
                self)
            self.is_observables_categorical = get_is_observables_categorical(
                self)
            self.attributes_indexes = get_indexes(self)
            subset_observables(self)

            if self.attributes.cells is not None:
                self.cells_dict = load_cells_dict(self)
                subset_cells(self)
Пример #4
0
 def test_get_indexes_num_f(self):
     self.config.attributes.observables.types = {'gender': 'F'}
     self.config.attributes_dict = load_observables_dict(self.config)
     indexes = get_indexes(self.config)
     self.assertEqual(len(indexes), 388)
Пример #5
0
 def test_get_indexes_age_and_m(self):
     self.config.attributes_dict = load_observables_dict(self.config)
     self.config.attributes.observables.types = {'age': [20, 21, 22], 'gender': 'M'}
     self.assertEqual(len(get_indexes(self.config)), 14)