예제 #1
0
    def build(self):
        ptypes = self._get_property_types(nlimit=False)
        self.n = 0
        for props in ptypes:
            assert props is not None, props
            #props.build()
            self.nproperties += props.n

        pids = check_duplicate('property_id', ptypes, self.model.log)

        self.property_ids = np.array(list(pids), dtype='int32')
        self.property_ids.sort()
        self.property_groups = build_groups(ptypes, 'property_id')
예제 #2
0
    def build(self):
        ptypes = self._get_property_types(nlimit=False)
        self.n = 0
        for props in ptypes:
            assert props is not None, props
            #props.build()
            self.nproperties += props.n

        pids = check_duplicate('property_id', ptypes, self.model.log)

        self.property_ids = np.array(list(pids), dtype='int32')
        self.property_ids.sort()
        self.property_groups = build_groups(ptypes, 'property_id')
예제 #3
0
    def build(self):
        #print('elements')
        self.n = 0
        self._build_elements()
        self._build_properties()


        old_build = False
        if old_build:
            etypes = self._get_element_types(nlimit=False)
            ptypes = self._get_property_types(nlimit=False)

            for elems in etypes:
                #if elems is None:
                    #continue
                if hasattr(elems, 'type'):
                    if elems.type in self.model.card_count:
                        self.model.log.debug('building %s' % elems.__class__.__name__)
                else:
                    #if elems.n:
                    self.model.log.debug('building %s' % elems.__class__.__name__)
                elems.build()
                self.nelements += elems.n
                self.validate_nodes(elems)
                #print(nids - grids[i])

            for props in ptypes:
                #if props is None:
                    #continue
                if hasattr(props, 'type'):
                    if props.type in self.model.card_count:
                        self.model.log.debug('building %s' % props.__class__.__name__)
                else:
                    #if props.n:
                    self.model.log.debug('building %s' % props.__class__.__name__)
                props.build()
                self.nproperties += props.n
        else:
            etypes = self._get_element_types(nlimit=True)
            ptypes = self._get_property_types(nlimit=True)
            self.model.log.debug('etypes = %s' % etypes)
            self.model.log.debug('ptypes = %s' % ptypes)
            for elems in etypes:
                #if elems.type in ['CONROD']:
                    #self.nproperties += elems.n
                self.nelements += elems.n
                self.validate_nodes(elems)
            for props in ptypes:
                self.nproperties += props.n

        self.model.log.debug('finished building %s' % self.__class__.__name__)

        if self.nelements:
            eids = check_duplicate('element_id', etypes, self.model.log)
            self.element_ids = asarray(eids, dtype='int32')
            self.element_ids.sort()
            self.element_groups = build_groups(etypes, 'element_id', is_element=True)
            #self.model.log.info('self.element_groups = %s' % self.element_groups)
        else:
            self.model.log.warning('no elements...')

        if self.nproperties:
            pids = check_duplicate('property_id', ptypes, self.model.log)
            self.property_ids = asarray(pids, dtype='int32')
            self.property_ids.sort()
            self.property_groups = build_groups(ptypes, 'property_id')
            self.model.log.info('self.property_groups = %s' % self.property_groups)
예제 #4
0
    def build(self):
        #print('elements')
        self.n = 0
        self._build_elements()
        self._build_properties()


        old_build = False
        if old_build:
            etypes = self._get_element_types(nlimit=False)
            ptypes = self._get_property_types(nlimit=False)

            for elems in etypes:
                #if elems is None:
                    #continue
                if hasattr(elems, 'type'):
                    if elems.type in self.model.card_count:
                        self.model.log.debug('building %s' % elems.__class__.__name__)
                else:
                    #if elems.n:
                    self.model.log.debug('building %s' % elems.__class__.__name__)
                elems.build()
                self.nelements += elems.n
                self.validate_nodes(elems)
                #print(nids - grids[i])

            for props in ptypes:
                #if props is None:
                    #continue
                if hasattr(props, 'type'):
                    if props.type in self.model.card_count:
                        self.model.log.debug('building %s' % props.__class__.__name__)
                else:
                    #if props.n:
                    self.model.log.debug('building %s' % props.__class__.__name__)
                props.build()
                self.nproperties += props.n
        else:
            etypes = self._get_element_types(nlimit=True)
            ptypes = self._get_property_types(nlimit=True)
            self.model.log.debug('etypes = %s' % etypes)
            self.model.log.debug('ptypes = %s' % ptypes)
            for elems in etypes:
                #if elems.type in ['CONROD']:
                    #self.nproperties += elems.n
                self.nelements += elems.n
                self.validate_nodes(elems)
            for props in ptypes:
                self.nproperties += props.n

        self.model.log.debug('finished building %s' % self.__class__.__name__)

        if self.nelements:
            eids = check_duplicate('element_id', etypes, self.model.log)
            self.element_ids = asarray(eids, dtype='int32')
            self.element_ids.sort()
            self.element_groups = build_groups(etypes, 'element_id', is_element=True)
            #self.model.log.info('self.element_groups = %s' % self.element_groups)
        else:
            self.model.log.warning('no elements...')

        if self.nproperties:
            pids = check_duplicate('property_id', ptypes, self.model.log)
            self.property_ids = asarray(pids, dtype='int32')
            self.property_ids.sort()
            self.property_groups = build_groups(ptypes, 'property_id')
            self.model.log.info('self.property_groups = %s' % self.property_groups)