コード例 #1
0
ファイル: AnalysisDatabase_ver0.py プロジェクト: ablot/acq4
 def _queryToArray(self, q):
     recs = self._queryToDict(q)
     if len(recs) < 1:
         #return np.array([])  ## need to return empty array *with correct fields*, but this is very difficult, so just return None
         return None
     rec1 = recs[0]
     dtype = functions.suggestRecordDType(rec1)
     #print rec1, dtype
     arr = np.empty(len(recs), dtype=dtype)
     arr[0] = tuple(rec1.values())
     for i in xrange(1, len(recs)):
         arr[i] = tuple(recs[i].values())
     return arr
コード例 #2
0
 def _queryToArray(self, q):
     recs = self._queryToDict(q)
     if len(recs) < 1:
         #return np.array([])  ## need to return empty array *with correct fields*, but this is very difficult, so just return None
         return None
     rec1 = recs[0]
     dtype = functions.suggestRecordDType(rec1)
     #print rec1, dtype
     arr = np.empty(len(recs), dtype=dtype)
     arr[0] = tuple(rec1.values())
     for i in range(1, len(recs)):
         arr[i] = tuple(recs[i].values())
     return arr
コード例 #3
0
ファイル: database.py プロジェクト: hiuwo/acq4
 def _queryToArray(self, q):
     prof = debug.Profiler("_queryToArray", disabled=True)
     recs = self._queryToDict(q)
     prof.mark("got records")
     if len(recs) < 1:
         #return np.array([])  ## need to return empty array *with correct columns*, but this is very difficult, so just return None
         return None
     rec1 = recs[0]
     dtype = functions.suggestRecordDType(rec1, singleRecord=True)
     #print rec1, dtype
     arr = np.empty(len(recs), dtype=dtype)
     arr[0] = tuple(rec1.values())
     for i in xrange(1, len(recs)):
         arr[i] = tuple(recs[i].values())
     prof.mark('converted to array')
     prof.finish()
     return arr
コード例 #4
0
ファイル: database.py プロジェクト: travis-open/acq4
 def _queryToArray(self, q):
     prof = debug.Profiler("_queryToArray", disabled=True)
     recs = self._queryToDict(q)
     prof.mark("got records")
     if len(recs) < 1:
         #return np.array([])  ## need to return empty array *with correct columns*, but this is very difficult, so just return None
         return None
     rec1 = recs[0]
     dtype = functions.suggestRecordDType(rec1, singleRecord=True)
     #print rec1, dtype
     arr = np.empty(len(recs), dtype=dtype)
     arr[0] = tuple(rec1.values())
     for i in xrange(1, len(recs)):
         arr[i] = tuple(recs[i].values())
     prof.mark('converted to array')
     prof.finish()
     return arr