Skip to content

Commit b15ded6

Browse files
committed
Mildly improve docs
1 parent 8b102e7 commit b15ded6

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

docs/source/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@
4343

4444
html_theme = 'alabaster'
4545
html_static_path = ['_static']
46+
47+
autodoc_default_options = {
48+
'inherited-members': False,
49+
'undoc-members': False,
50+
}

src/obelisk/asynchronous/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
Relevant entrance points are :class:`client.Obelisk`.
66
It can be imported from the :mod:`.client` module, or directly from this one.
77
"""
8-
__all__= ['Obelisk']
8+
__all__= ['Obelisk', 'core']
99
from .client import Obelisk
10+
from . import core

src/obelisk/asynchronous/core.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
This module contains the asynchronous API to interface with Obelisk CORE.
3+
These methods all return a :any:`Coroutine`.
4+
5+
Relevant entrance points are :class:`Core`.
6+
7+
This API vaguely resembles that of clients to previous Obelisk versions,
8+
but also significantly diverts from it where the underlying Obelisk CORE API does so.
9+
"""
110
from obelisk.asynchronous.base import BaseClient
211
from obelisk.exceptions import ObeliskError
312

@@ -11,25 +20,35 @@
1120

1221

1322
DataType = Literal['number', 'number[]', 'json', 'bool', 'string']
23+
"""The possible types of data Obelisk can accept"""
1424

1525

1626
Aggregator = Literal['last', 'min', 'mean', 'max', 'count', 'stddev']
27+
"""Type of aggregation Obelisk can process"""
1728

1829

19-
# https://obelisk.pages.ilabt.imec.be/obelisk-core/query.html#available-data-point-fields
2030
FieldName = str # TODO: validate field names?
31+
"""https://obelisk.pages.ilabt.imec.be/obelisk-core/query.html#available-data-point-fields"""
2132

2233

2334
Datapoint = Dict[str, Any]
35+
"""Datapoints resulting from queries are modeled as simple dicts, as fields can come and go depending on query."""
2436

2537

2638
class ObeliskPosition(BaseModel):
39+
"""
40+
Format for coordinates as expected by Obelisk.
41+
"""
42+
2743
lat: float
44+
"""Latitude"""
2845
lng: float
46+
"""Longitude"""
2947
elevation: float
3048

3149

32-
class IncomingDataPoint(BaseModel):
50+
class IncomingDatapoint(BaseModel):
51+
"""A datapoint to be submitted to Obelisk. These are validated quite extensively, but not fully."""
3352
timestamp: Optional[AwareDatetime] = None
3453
metric: str
3554
value: Any
@@ -142,7 +161,7 @@ class Core(BaseClient):
142161
async def send(
143162
self,
144163
dataset: str,
145-
data: List[IncomingDataPoint],
164+
data: List[IncomingDatapoint],
146165
) -> httpx.Response:
147166
"""
148167
Publishes data to Obelisk
@@ -151,7 +170,7 @@ async def send(
151170
----------
152171
dataset : str
153172
ID for the dataset to publish to
154-
data : List[IncomingDataPoint]
173+
data : List[IncomingDatapoint]
155174
List of Obelisk-acceptable datapoints.
156175
Exact format varies between Classic or HFS,
157176
caller is responsible for formatting.
@@ -228,3 +247,4 @@ async def query_time_chunked(
228247
yield await self.query(
229248
chunk
230249
)
250+

0 commit comments

Comments
 (0)