Changeset 14428 for fact


Ignore:
Timestamp:
09/26/12 15:39:28 (12 years ago)
Author:
neise
Message:
some sanitychecks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/pyfact/pyfact.py

    r14423 r14428  
    646646        # or whole arrays of numbers as well.
    647647        # we treat single elements differently...
     648        if number_of_elements == 0:
     649            return
    648650        if number_of_elements == 1:
    649651            # allocate some memory for a single number according to its type
     
    690692            local = np.zeros( number_of_elements, nptype)
    691693       
    692         # Set the Pointer Address
    693         f.SetPtrAddress(colname, local)
     694        # Set the Pointer Address
     695        try:
     696            f.SetPtrAddress(colname, local)
     697        except TypeError:
     698            print 'something was wrong with SetPtrAddress()'
     699            print 'Type of colname', type(colname)
     700            print 'colname:', colname
     701            print 'Type of local', type(local)
     702            print 'length of local', len(local)
     703            print 'local should be alle zeros, since "local = np.zeros( number_of_elements, nptype)" '
     704            raise
     705           
    694706        self._table_cols[colname] = local
    695707        if number_of_elements > 1:
Note: See TracChangeset for help on using the changeset viewer.