Closed ericdill closed 8 years ago
can you nuke and ban the ipython notebook checkpoints?
and would it be possible to get that object graph as any kind of vector graphic?
have you tried running this on the HXN case that was slow?
I have not tried the HXN case yet. Do you remember what that scan id was?
re scan 512 on HXN: When I tried to run that last time, I discovered that the channelarchiver had filled up all 11 TB at HXN and 20-something TB at CSX. I'll try it again tomorrow
In [6]: def time_events(header):
t0 = ttime.time()
events = db.fetch_events(header)
t1 = ttime.time()
events = list(events)
t2 = ttime.time()
print('time for db.fetch_events call = %s s' % (t1-t0))
print('time to listify the generator = %s s' % (t2-t1))
return events
...:
In [7]: events = time_events(hdr512)
time for db.fetch_events call = 4.05311584473e-06 s
time to listify the generator = 42.5619840622 s
...crap
Here's some profiling output sorted by the total time for each function. I also included the cProfile output saved to disk. Would you be able to help me sort out why this is slow @tacaswell ?
I suppose this is going to die on the vine. oh well!
When complete, this PR will introduce the ability to update metadatastore documents via a new
Correction
s collection (sure is a tongue twister!) and anupdate
function in metadatastore. ACorrection
s document is aDynamicDocument
with three fields:uid
: The unique identifier for one of the other documents (RunStart
,RunStop
,EventDescriptor
,BeamlineConfig
)corrections_uid
: A unique string identifier for oneCorrection
s document. Defaults touuid4
if none is providedtime
: The unix epoch time that the document was savedNote that
Event
documents cannot be updated.update(document)
will raise ifisinstance(document, Event)
This PR introduces a new kwarg into the
find_*
functions, initially calleduse_newest_correction=True
which is a boolean flag that will:find_*
function to go and grab the most recent correction for that document (based on itsuid
)This PR introduces a new function
find_corrections
that will retrieve all corrections for a document based on either the original document'suid
or thecorrection_uid
of a specific correction.This PR requires test coverage before it can be merged.
Todo
RunStart
.Correction
document that keeps track of which user account made the changeDemo
http://nbviewer.ipython.org/ff3540dbe06073a673ec
Known use cases
insert_beamline_configuration
. This adds to theBeamlineConfig
collectionupdate
on the updated RunStart document. This adds to theCorrection
collection.RunStart
,EventDescriptor
,RunStop
documents with new tags (https://github.com/ericdill/metadataStore/commit/6b9792e0e2d1af2c41470a7e06b8ad6c30fb9e12)run_start
update(run_start). This adds to the
Correctioncollection. Future calls to
find_run_starts(uid=run_start.uid)will return the tagged run_start document. If you want the original document,
find_run_starts(uid=run_start.uid, use_newest_correction=False)` will return itevent_descriptor
update(event_descriptor)
. This adds to theCorrection
collection. Future calls tofind_event_descriptors(uid=event_descriptor.uid)
will return the corrected event descriptor. If you want the original document,find_event_descriptors(uid=event_descriptor.uid, use_newest_correction=False)
will return it