Skip to content

Instantly share code, notes, and snippets.

@ericdill
Created June 17, 2015 01:48
Show Gist options
  • Save ericdill/361669c9a7307cbdef75 to your computer and use it in GitHub Desktop.
Save ericdill/361669c9a7307cbdef75 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {
"trusted": true,
"collapsed": true
},
"cell_type": "code",
"source": "from dataportal import DataBroker as db\nfrom dataportal.broker.simple_broker import EventQueue\nfrom metadatastore.api import find_run_stops\nfrom bluesky.broker_callbacks import validate_all_events, validate_all_resources",
"execution_count": 1,
"outputs": []
},
{
"metadata": {
"trusted": true,
"collapsed": false
},
"cell_type": "code",
"source": "hdr = db[-1]\nrun_stop, = find_run_stops(run_start=hdr.run_start_uid)",
"execution_count": 2,
"outputs": [
{
"output_type": "error",
"ename": "TypeError",
"evalue": "__init__() missing 2 required positional arguments: 'some_dict' and 'document_name'",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-2-342d973fd942>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mhdr\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdb\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mrun_stop\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfind_run_stops\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrun_start\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mhdr\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun_start_uid\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/edill/dev/python/dataportal/dataportal/broker/simple_broker.py\u001b[0m in \u001b[0;36m__getitem__\u001b[1;34m(cls, key)\u001b[0m\n\u001b[0;32m 64\u001b[0m raise IndexError(\n\u001b[0;32m 65\u001b[0m \"There are only {0} runs.\".format(i))\n\u001b[1;32m---> 66\u001b[1;33m \u001b[0mheader\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mHeader\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfrom_run_start\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 67\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msix\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstring_types\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 68\u001b[0m \u001b[1;31m# Interpret key as a uid (or the few several characters of one).\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/edill/dev/python/dataportal/dataportal/broker/simple_broker.py\u001b[0m in \u001b[0;36mfrom_run_start\u001b[1;34m(cls, run_start, verify_integrity)\u001b[0m\n\u001b[0;32m 328\u001b[0m \u001b[0mheader\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mdataportal\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbroker\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mHeader\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 329\u001b[0m \"\"\"\n\u001b[1;32m--> 330\u001b[1;33m \u001b[0mheader\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mHeader\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 331\u001b[0m \u001b[0mheader\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_name\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m\"Header\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 332\u001b[0m header.event_descriptors = list(\n",
"\u001b[1;31mTypeError\u001b[0m: __init__() missing 2 required positional arguments: 'some_dict' and 'document_name'"
]
}
]
},
{
"metadata": {
"trusted": true,
"collapsed": true
},
"cell_type": "code",
"source": "",
"execution_count": null,
"outputs": []
}
],
"metadata": {
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
},
"language_info": {
"nbconvert_exporter": "python",
"version": "3.4.3",
"file_extension": ".py",
"pygments_lexer": "ipython3",
"name": "python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"mimetype": "text/x-python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment