Skip to content

Commit

Permalink
Match upstream endpoint renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
timstaley committed Dec 11, 2015
1 parent f504d1d commit f18ee40
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 220 deletions.
80 changes: 26 additions & 54 deletions docs/source/notebooks/tutorial1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from __future__ import print_function\n",
Expand All @@ -40,9 +38,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import voeventdb.remote as vr\n",
Expand Down Expand Up @@ -74,9 +70,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"# For testing against a local-dev server:\n",
Expand All @@ -96,9 +90,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"apiv1.count()"
Expand All @@ -117,28 +109,24 @@
"source": [
"## IVORN's and single-packet details\n",
"\n",
"Next let's try ``apiv1.ivorn``, which returns a list of \n",
"Next let's try ``apiv1.list_ivorn``, which returns a list of \n",
"[IVORN's](http://voevent.readthedocs.org/en/latest/reading.html#ivorns-and-identifiers), unique idenitifiers which represent a VOEvent packet, analogous to how a URL represents a web-page."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"ivorn_list = apiv1.ivorn()\n",
"ivorn_list = apiv1.list_ivorn()\n",
"len(ivorn_list)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"#Take a look at the first 10\n",
Expand All @@ -155,9 +143,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"print(vr.default_list_n_max)"
Expand All @@ -173,34 +159,30 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"## How to override the default:\n",
"# vr.default_list_n_max = 2500\n",
"## Set n_max for a single query:\n",
"# apiv1.ivorn(n_max=50)"
"# apiv1.list_ivorn(n_max=50)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If we know the IVORN of a packet, we can look up some details using the ``apiv1.synopsis`` endpoint:"
"If we know the IVORN of a packet, we can look up some details using the ``apiv1.packet_synopsis`` endpoint:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"ivorn = ivorn_list[0]\n",
"apiv1.synopsis(ivorn)"
"apiv1.packet_synopsis(ivorn)"
]
},
{
Expand All @@ -213,12 +195,10 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"xml = apiv1.xml(ivorn)"
"xml = apiv1.packet_xml(ivorn)"
]
},
{
Expand All @@ -231,9 +211,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"## A brief example, see the voevent-parse tutorial for more\n",
Expand All @@ -249,18 +227,16 @@
"## Summary endpoints\n",
"\n",
"So we can view individual packet IVORNS, and look up packet details, but that's very fine-grained information - we don't want to wade through all of them to figure out what's in the database. We can use 'summary' endpoints to give us a higher-level overview. \n",
"For example, we can organise VOEvents by 'streams' - basically the bit of the IVORN between the `ivo://` prefix and the `#` symbol. The ``apiv1.stream_count`` endpoint tells us how many VOEvent packets belong to each stream:"
"For example, we can organise VOEvents by 'streams' - basically the bit of the IVORN between the `ivo://` prefix and the `#` symbol. The ``apiv1.map_stream_count`` endpoint tells us how many VOEvent packets belong to each stream:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"apiv1.stream_count()"
"apiv1.map_stream_count()"
]
},
{
Expand All @@ -273,12 +249,10 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"apiv1.authored_month_count()"
"apiv1.map_authored_month_count()"
]
},
{
Expand All @@ -292,19 +266,17 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"apiv1.role_count()"
"apiv1.map_role_count()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Similarly, ``apiv1.stream_role_count`` gives a breakdown of how many packets belong to each role, listed by stream."
"Similarly, ``apiv1.map_stream_role_count`` gives a breakdown of how many packets belong to each role, listed by stream."
]
},
{
Expand All @@ -325,7 +297,7 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
Expand Down

0 comments on commit f18ee40

Please sign in to comment.