-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
Schema
class, plus some other fix ups (#50)
* move Schema class from types_.py -> schema.py * add class SchemaHelpers * change helper names * _local_schema_helper -> default_schema_helper * _lsst_schema_helper -> lsst_schema_helper * docs: add schema module and some fixes * rename SchemaNotFoundError -> SchemaError * add custom Schema classes to de/serialize * cleanup imports * add a default schema * remove OpenAlertError. use SchemaError instead * hack in the schema for lsst.v7_1.alert * remove lsst-alert-packet as a dependency * fix CHANGELOG. prep release v0.3.7
- Loading branch information
Showing
38 changed files
with
5,953 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pittgoogle.schema | ||
================= | ||
|
||
.. automodule:: pittgoogle.schema | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Get alerts for testing | ||
====================== | ||
|
||
Setup | ||
----- | ||
|
||
.. code-block:: python | ||
import pittgoogle | ||
Get alerts from a Pub/Sub subscription | ||
-------------------------------------- | ||
|
||
If you need to create the subscription, follow the example in :class:`pittgoogle.Subscription`. | ||
|
||
Here are examples that get an alert from each of our "loop" streams: | ||
|
||
.. code-block:: python | ||
# Choose one of the following | ||
loop_sub = pittgoogle.Subscription("rubin-loop", schema_name="lsst.v7_1.alert") | ||
loop_sub = pittgoogle.Subscription("elasticc-loop", schema_name="elasticc.v0_9_1.alert") | ||
loop_sub = pittgoogle.Subscription("ztf-loop", schema_name="ztf") | ||
loop_sub.touch() | ||
alert = loop.pull_batch(max_messages=1)[0] | ||
Get alerts from a file on disk | ||
------------------------------- | ||
|
||
.. code-block:: python | ||
# [TODO] Add code snippet | ||
Get alerts from Cloud Storage | ||
----------------------------- | ||
|
||
.. code-block:: python | ||
# [TODO] Add code snippet | ||
Get alerts from BigQuery | ||
------------------------- | ||
.. code-block:: python | ||
# [TODO] Add code snippet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.