Skip to content

Instantly share code, notes, and snippets.

@CJ-Wright
Created March 30, 2016 17:21
Show Gist options
  • Save CJ-Wright/a6b31d3d3b116dd5c8ed0ca373a382a8 to your computer and use it in GitHub Desktop.
Save CJ-Wright/a6b31d3d3b116dd5c8ed0ca373a382a8 to your computer and use it in GitHub Desktop.
---------------------------------------------------------------------------
DatumNotFound Traceback (most recent call last)
<ipython-input-26-0b516695237d> in <module>()
----> 1 ev0 = next(events)
/mnt/work-data/other_src/databroker/databroker/databroker.pyc in get_events(headers, fields, fill, handler_registry, handler_overrides)
402 # (else omit it from the events of this descriptor)
403 if fill:
--> 404 fill_event(event, handler_registry, handler_overrides)
405 yield event
406
/mnt/work-data/other_src/databroker/databroker/databroker.pyc in fill_event(event, handler_registry, handler_overrides)
280 if is_external.get(data_key, False):
281 if data_key not in handler_overrides:
--> 282 event.data[data_key] = fs.retrieve(value, handler_registry)
283 else:
284 mock_registry = mock_registries[data_key]
/mnt/work-data/other_src/filestore/filestore/api.pyc in get_data(eid, handler_registry)
154 handler_registry = {}
155 with _FS_SINGLETON.handler_context(handler_registry) as fs:
--> 156 return fs.get_datum(eid)
157
158
/mnt/work-data/other_src/filestore/filestore/fs.pyc in get_datum(self, eid)
113 return _get_datum(self._datum_col, eid,
114 self._datum_cache, self.get_spec_handler,
--> 115 logger)
116
117 def register_handler(self, key, handler, overwrite=False):
/mnt/work-data/other_src/filestore/filestore/core.pyc in get_datum(col, eid, datum_cache, get_spec_handler, logger)
21 if edoc is None:
22 raise DatumNotFound(
---> 23 "No datum found with datum_id {!r}".format(eid))
24 # save it for later
25 datum = {k: edoc[k] for k in keys}
DatumNotFound: No datum found with datum_id UUID('6cb196b2-5731-4fed-a07a-988db71b8373')
@CJ-Wright
Copy link
Author

Also, the hdr

{'descriptors': [{u'data_keys': {u'I0': {u'dtype': u'number',
     u'source': u'IO'},
    u'detz': {u'dtype': u'number', u'source': u'detz'},
    u'img': {u'dtype': u'array',
     u'external': u'FILESTORE:',
     u'shape': [2048, 2048],
     u'source': u'det'}},
   u'run_start': u'97ad5d70-a2fd-469b-a100-ecd9878decdb',
   u'time': 0.0,
   u'uid': u'4a7d6114-baab-4c83-a1a2-e99e821bf20f'}],
 'start': {u'background': False,
  u'beamline_id': u'11-ID-B',
  u'calibration': True,
  u'group': u'',
  u'owner': u'',
  u'poni': [UUID('29197b68-046b-4174-8877-246a127da7a9')],
  u'project': u'',
  u'run_config': {u'distance': 25.0, u'loader_name': u'calibration'},
  u'scan_id': 1,
  u'time': 1457792962.018,
  u'uid': u'97ad5d70-a2fd-469b-a100-ecd9878decdb'},
 'stop': {u'exit_status': u'success',
  u'reason': u'',
  u'run_start': u'97ad5d70-a2fd-469b-a100-ecd9878decdb',
  u'time': {u'I0': datetime.datetime(2016, 3, 12, 8, 15, 11),
   u'img': datetime.datetime(2016, 3, 12, 8, 15, 11)},
  u'uid': u'ae711159-f6af-48c4-8c8a-a21eea44943b'}}

@CJ-Wright
Copy link
Author

---------------------------------------------------------------------------
DatumNotFound                             Traceback (most recent call last)
<ipython-input-4-0b516695237d> in <module>()
----> 1 ev0 = next(events)

/mnt/work-data/other_src/databroker/databroker/databroker.pyc in get_events(headers, fields, fill, handler_registry, handler_overrides)
    402                     # (else omit it from the events of this descriptor)
    403                 if fill:
--> 404                     fill_event(event, handler_registry, handler_overrides)
    405                 yield event
    406 

/mnt/work-data/other_src/databroker/databroker/databroker.pyc in fill_event(event, handler_registry, handler_overrides)
    280         if is_external.get(data_key, False):
    281             if data_key not in handler_overrides:
--> 282                 event.data[data_key] = fs.retrieve(value, handler_registry)
    283             else:
    284                 mock_registry = mock_registries[data_key]

/mnt/work-data/other_src/filestore/filestore/api.pyc in get_data(eid, handler_registry)
    154         handler_registry = {}
    155     with _FS_SINGLETON.handler_context(handler_registry) as fs:
--> 156         return fs.get_datum(eid)
    157 
    158 

/mnt/work-data/other_src/filestore/filestore/fs.pyc in get_datum(self, eid)
    113         return _get_datum(self._datum_col, eid,
    114                           self._datum_cache, self.get_spec_handler,
--> 115                           logger)
    116 
    117     def register_handler(self, key, handler, overwrite=False):

/mnt/work-data/other_src/filestore/filestore/core.pyc in get_datum(col, eid, datum_cache, get_spec_handler, logger)
     21         if edoc is None:
     22             raise DatumNotFound(
---> 23                 "No datum found with datum_id {!r}".format(eid))
     24         # save it for later
     25         datum = {k: edoc[k] for k in keys}

DatumNotFound: No datum found with datum_id u'579f746b-5e5e-4552-ba09-70cd563c7685'

@CJ-Wright
Copy link
Author


DatumNotFound Traceback (most recent call last)
in ()
----> 1 ev0 = next(events)

/mnt/work-data/other_src/databroker/databroker/databroker.pyc in get_events(headers, fields, fill, handler_registry, handler_overrides)
    402                     # (else omit it from the events of this descriptor)
    403                 if fill:
--> 404                     fill_event(event, handler_registry, handler_overrides)
    405                 yield event
    406 

/mnt/work-data/other_src/databroker/databroker/databroker.pyc in fill_event(event, handler_registry, handler_overrides)
    280         if is_external.get(data_key, False):
    281             if data_key not in handler_overrides:
--> 282                 event.data[data_key] = fs.retrieve(value, handler_registry)
    283             else:
    284                 mock_registry = mock_registries[data_key]

/mnt/work-data/other_src/filestore/filestore/api.pyc in get_data(eid, handler_registry)
    154         handler_registry = {}
    155     with _FS_SINGLETON.handler_context(handler_registry) as fs:
--> 156         return fs.get_datum(eid)
    157 
    158 

/mnt/work-data/other_src/filestore/filestore/fs.pyc in get_datum(self, eid)
    113         return _get_datum(self._datum_col, eid,
    114                           self._datum_cache, self.get_spec_handler,
--> 115                           logger)
    116 
    117     def register_handler(self, key, handler, overwrite=False):

/mnt/work-data/other_src/filestore/filestore/core.pyc in get_datum(col, eid, datum_cache, get_spec_handler, logger)
     21         if edoc is None:
     22             raise DatumNotFound(
---> 23                 "No datum found with datum_id {!r}".format(eid))
     24         # save it for later
     25         datum = {k: edoc[k] for k in keys}

DatumNotFound: No datum found with datum_id u'9d5c1449-e247-4595-b6e1-81d9b2a7816d'

@CJ-Wright
Copy link
Author

In [125]: from databroker import get_table

In [126]: get_table(hdr, fill=False)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-126-30e912377e37> in <module>()
----> 1 get_table(hdr, fill=False)

/mnt/work-data/other_src/databroker/databroker/databroker.pyc in get_table(headers, fields, fill, convert_times, handler_registry, handler_overrides)
    467                 discard_fields = event_fields - fields
    468                 extra_fields = fields - event_fields
--> 469             payload = get_events_table(descriptor)
    470             descriptor, data, seq_nums, times, uids, timestamps = payload
    471             df = pd.DataFrame(index=seq_nums)

/mnt/work-data/other_src/metadatastore/metadatastore/commands.pyc in get_events_table(descriptor)
    208         keys as `data_table`.
    209     """
--> 210     return _DB_SINGLETON.get_events_table(descriptor)
    211 
    212 

/mnt/work-data/other_src/metadatastore/metadatastore/mds.pyc in get_events_table(self, descriptor)
    318                                           self._DESCRIPTOR_CACHE,
    319                                           self._runstart_col,
--> 320                                           self._RUNSTART_CACHE)
    321 
    322     def find_run_starts(self, **kwargs):

/mnt/work-data/other_src/metadatastore/metadatastore/core.pyc in get_events_table(descriptor, event_col, descriptor_col, descriptor_cache, run_start_col, run_start_cache)
    449 
    450     # get timestamps
--> 451     timestamps_table = _transpose(all_events, keys, 'timestamps')
    452 
    453     # return the whole lot

/mnt/work-data/other_src/metadatastore/metadatastore/core.pyc in _transpose(in_data, keys, field)
    393         dd = ev[field]
    394         for k in keys:
--> 395             out[k][j] = dd[k]
    396     return out
    397 

KeyError: u'detz'

@CJ-Wright
Copy link
Author

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-134-0c8c3c2b4296> in <module>()
      1 from metadatastore.commands import get_events_generator
----> 2 for descriptor in descriptors:
      3    events_generator = get_events_generator(descriptor)
      4    ev0 = next(events_generator)
      5    assert list(ev0.data.keys()) == list(descriptor.data_keys.keys())

NameError: name 'descriptors' is not defined

@CJ-Wright
Copy link
Author

    data_keys1 = {'I0': dict(source='IO', dtype='number'),
                  'img': dict(source='det', dtype='array',
                              shape=(2048, 2048),
                              external='FILESTORE:'),
                  'detz': dict(source='detz', dtype='number')}

@CJ-Wright
Copy link
Author

In [20]: dm.bin_on('I0', interpolation={'T':'linear'})
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-20-f35af28f1e55> in <module>()
----> 1 dm.bin_on('I0', interpolation={'T':'linear'})

/mnt/work-data/other_src/datamuxer/datamuxer.py in bin_on(self, source_name, interpolation, agg, use_cols)
    551         http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html
    552         """
--> 553         centers, bin_edges = self._bin_on(source_name)
    554         return self.bin_by_edges(bin_edges, bin_anchors=centers,
    555                                  interpolation=interpolation, agg=agg,

/mnt/work-data/other_src/datamuxer/datamuxer.py in _bin_on(self, source_name)
    562 
    563         # [2, 4, 6] -> [-inf, 3, 5, inf]
--> 564         bin_edges = np.mean([centers[1:], centers[:-1]], 0)
    565         # [-inf, 3, 5, inf] -> [(-inf, 3), (3, 5), (5, inf)]
    566         bin_edges = [-np.inf] + list(np.repeat(bin_edges, 2)) + [np.inf]

/mnt/work-data/other_src/anaconda/envs/dp_dev/lib/python2.7/site-packages/numpy/core/fromnumeric.pyc in mean(a, axis, dtype, out, keepdims)
   2876 
   2877     return _methods._mean(a, axis=axis, dtype=dtype,
-> 2878                           out=out, keepdims=keepdims)
   2879 
   2880 

/mnt/work-data/other_src/anaconda/envs/dp_dev/lib/python2.7/site-packages/numpy/core/_methods.pyc in _mean(a, axis, dtype, out, keepdims)
     63         dtype = mu.dtype('f8')
     64 
---> 65     ret = umr_sum(arr, axis, dtype, out, keepdims)
     66     if isinstance(ret, mu.ndarray):
     67         ret = um.true_divide(

TypeError: ufunc add cannot use operands with types dtype('<M8[ns]') and dtype('<M8[ns]')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment