Skip to content

Commit 089deb5

Browse files
committed
BLD: Move docformatter pin to v1.7.7
1 parent 958e132 commit 089deb5

14 files changed

Lines changed: 120 additions & 77 deletions

File tree

databento/common/bentologging.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
def enable_logging(level: int | str = logging.INFO) -> None:
77
"""
8-
Enable logging for the Databento module. This function should be used for
9-
simple applications and examples. It is advisable to configure your own
8+
Enable logging for the Databento module.
9+
10+
This function should be used for simple applications and examples. It is advisable to configure your own
1011
logging for serious applications.
1112
1213
Parameters

databento/common/dbnstore.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@ def __init__(self, source: BytesIO | bytes | IO[bytes]):
244244
@property
245245
def name(self) -> str:
246246
"""
247-
Return the name of the source buffer. Equivalent to `repr` of the
248-
input.
247+
Return the name of the source buffer.
248+
249+
Equivalent to `repr` of the input.
249250
250251
Returns
251252
-------
@@ -269,8 +270,9 @@ def nbytes(self) -> int:
269270
@property
270271
def reader(self) -> BytesIO:
271272
"""
272-
Return a reader for this buffer. The reader beings at the start of the
273-
buffer.
273+
Return a reader for this buffer.
274+
275+
The reader beings at the start of the buffer.
274276
275277
Returns
276278
-------
@@ -415,8 +417,9 @@ def __repr__(self) -> str:
415417
@property
416418
def compression(self) -> Compression:
417419
"""
418-
Return the data compression format (if any). This is determined by
419-
inspecting the data.
420+
Return the data compression format (if any).
421+
422+
This is determined by inspecting the data.
420423
421424
Returns
422425
-------
@@ -440,8 +443,9 @@ def dataset(self) -> str:
440443
@property
441444
def end(self) -> pd.Timestamp | None:
442445
"""
443-
Return the query end for the data. If None, the end time was not known
444-
when the data was generated.
446+
Return the query end for the data.
447+
448+
If None, the end time was not known when the data was generated.
445449
446450
Returns
447451
-------
@@ -545,11 +549,13 @@ def reader(self) -> IO[bytes]:
545549
@property
546550
def schema(self) -> Schema | None:
547551
"""
548-
Return the DBN record schema. If None, may contain one or more schemas.
552+
Return the DBN record schema.
553+
554+
If None, may contain one or more schemas.
549555
550556
Returns
551557
-------
552-
Schema or None
558+
Schema or None
553559
554560
"""
555561
schema = self._metadata.schema
@@ -576,8 +582,9 @@ def start(self) -> pd.Timestamp:
576582
@property
577583
def stype_in(self) -> SType | None:
578584
"""
579-
Return the query input symbology type for the data. If None, the
580-
records may contain mixed STypes.
585+
Return the query input symbology type for the data.
586+
587+
If None, the records may contain mixed STypes.
581588
582589
Returns
583590
-------

databento/common/enums.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ def coerced_new(enum: type[M], value: object) -> M:
8585

8686
class StringyMixin:
8787
"""
88-
Mixin class for overloading __str__ on Enum types. This will use the
89-
Enumerations subclass, if any, to modify the behavior of str().
88+
Mixin class for overloading __str__ on Enum types.
89+
90+
This will use the Enumerations subclass, if any, to modify the
91+
behavior of str().
9092
9193
For subclasses of enum.Flag a comma separated string of names is
9294
returned. For integer enumerations, the lowercase member name is
@@ -196,6 +198,8 @@ class RecordFlags(StringyMixin, IntFlag): # type: ignore
196198
"""
197199
Represents record flags.
198200
201+
Attributes
202+
----------
199203
F_LAST
200204
Marks the last record in a single event for a given `instrument_id`.
201205
F_TOB

databento/common/parsing.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ def symbols_list_to_list(
168168
@symbols_list_to_list.register(cls=Integral)
169169
def _(symbols: Integral, stype_in: SType) -> list[str]:
170170
"""
171-
Dispatch method for optional_symbols_list_to_list. Handles integral types,
172-
alerting when an integer is given for STypes that expect strings.
171+
Dispatch method for optional_symbols_list_to_list.
172+
173+
Handles integral types, alerting when an integer is given for STypes that expect strings.
173174
174175
See Also
175176
--------
@@ -187,8 +188,9 @@ def _(symbols: Integral, stype_in: SType) -> list[str]:
187188
@symbols_list_to_list.register(cls=str)
188189
def _(symbols: str, stype_in: SType) -> list[str]:
189190
"""
190-
Dispatch method for optional_symbols_list_to_list. Handles str, splitting
191-
on commas and validating smart symbology.
191+
Dispatch method for optional_symbols_list_to_list.
192+
193+
Handles str, splitting on commas and validating smart symbology.
192194
193195
See Also
194196
--------
@@ -212,8 +214,9 @@ def _(symbols: str, stype_in: SType) -> list[str]:
212214
@symbols_list_to_list.register(cls=Iterable)
213215
def _(symbols: Iterable[Any], stype_in: SType) -> list[str]:
214216
"""
215-
Dispatch method for optional_symbols_list_to_list. Handles Iterables by
216-
dispatching the individual members.
217+
Dispatch method for optional_symbols_list_to_list.
218+
219+
Handles Iterables by dispatching the individual members.
217220
218221
See Also
219222
--------

databento/common/symbology.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,9 @@ def map_symbols_json(
645645

646646
def build_symbol_map(self) -> dict[int, list[tuple[dt.date, dt.date, str]]]:
647647
"""
648-
Build a simple symbol map. This is to interface with methods of
649-
databento-dbn.
648+
Build a simple symbol map.
649+
650+
This is to interface with methods of databento-dbn.
650651
651652
Returns
652653
-------

databento/common/types.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
class Default(Generic[_T]):
2424
"""
25-
A container for a default value. This is to be used when a callable wants
26-
to detect if a default parameter value is being used.
25+
A container for a default value.
26+
27+
This is to be used when a callable wants to detect if a default parameter value is being used.
2728
2829
Example
2930
-------
@@ -152,8 +153,9 @@ def flush(self) -> None:
152153

153154
def write(self, data: bytes) -> None:
154155
"""
155-
Write data to the underlying stream. Any exceptions encountered will be
156-
dispatched to the exception callback, if defined.
156+
Write data to the underlying stream.
157+
158+
Any exceptions encountered will be dispatched to the exception callback, if defined.
157159
158160
Parameters
159161
----------

databento/common/validation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020

2121
def validate_path(value: PathLike[str] | str, param: str) -> Path:
2222
"""
23-
Validate whether the given value is a valid path. This also expands user
24-
directories to form valid paths.
23+
Validate whether the given value is a valid path.
24+
25+
This also expands user directories to form valid paths.
2526
2627
Parameters
2728
----------

databento/historical/api/batch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ class _BatchJob:
588588
"""
589589
Helper class for downloading multiple batch files from a job.
590590
591-
Supports sync and async downloads using a shared `ThreadPoolExecutor`.
591+
Supports sync and async downloads using a shared
592+
`ThreadPoolExecutor`.
592593
593594
"""
594595

databento/live/client.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ def __repr__(self) -> str:
159159
@property
160160
def dataset(self) -> str:
161161
"""
162-
Return the dataset for this live client. If no subscriptions have been
163-
made an empty string will be returned.
162+
Return the dataset for this live client.
163+
164+
If no subscriptions have been made an empty string will be returned.
164165
165166
Returns
166167
-------
@@ -234,8 +235,9 @@ def port(self) -> int:
234235
@property
235236
def session_id(self) -> str | None:
236237
"""
237-
Return the session ID for the current session. If `None`, the client is
238-
not connected.
238+
Return the session ID for the current session.
239+
240+
If `None`, the client is not connected.
239241
240242
Returns
241243
-------
@@ -279,8 +281,9 @@ def subscription_requests(
279281
@property
280282
def symbology_map(self) -> dict[int, str | int]:
281283
"""
282-
Return the symbology map for this client session. A symbol mapping is
283-
added when the client receives a SymbolMappingMsg.
284+
Return the symbology map for this client session.
285+
286+
A symbol mapping is added when the client receives a SymbolMappingMsg.
284287
285288
This can be used to transform an `instrument_id` in a DBN record
286289
to the input symbology.
@@ -398,8 +401,9 @@ def add_reconnect_callback(
398401
exception_callback: ExceptionCallback | None = None,
399402
) -> None:
400403
"""
401-
Add a callback for handling client reconnection events. This will only
402-
be called when using a reconnection policy other than
404+
Add a callback for handling client reconnection events.
405+
406+
This will only be called when using a reconnection policy other than
403407
`ReconnectPolicy.NONE` and if the session has been started with
404408
`Live.start`.
405409
@@ -614,8 +618,9 @@ def block_for_close(
614618
timeout: float | None = None,
615619
) -> None:
616620
"""
617-
Block until the session closes or a timeout is reached. A session will
618-
close after the remote gateway disconnects, or after `Live.stop` or
621+
Block until the session closes or a timeout is reached.
622+
623+
A session will close after the remote gateway disconnects, or after `Live.stop` or
619624
`Live.terminate` are called.
620625
621626
If a `timeout` is specified, `Live.terminate` will be called when the
@@ -661,8 +666,9 @@ async def wait_for_close(
661666
timeout: float | None = None,
662667
) -> None:
663668
"""
664-
Coroutine to wait until the session closes or a timeout is reached. A
665-
session will close when the remote gateway disconnects, or after
669+
Coroutine to wait until the session closes or a timeout is reached.
670+
671+
A session will close when the remote gateway disconnects, or after
666672
`Live.stop` or `Live.terminate` are called.
667673
668674
If a `timeout` is specified, `Live.terminate` will be called when the
@@ -718,8 +724,9 @@ def _map_symbol(self, record: DBNRecord) -> None:
718724

719725
class LiveIterator:
720726
"""
721-
Iterator class for the `Live` client. Automatically starts the client when
722-
created and will stop it when destroyed. This provides context-manager-like
727+
Iterator class for the `Live` client.
728+
729+
Automatically starts the client when created and will stop it when destroyed. This provides context-manager-like
723730
behavior to for loops.
724731
725732
Parameters

databento/live/gateway.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ def buffer(self) -> BytesIO:
194194

195195
def write(self, data: bytes) -> None:
196196
"""
197-
Write data to the decoder's buffer. This will make the data available
198-
for decoding.
197+
Write data to the decoder's buffer.
198+
199+
This will make the data available for decoding.
199200
200201
Parameters
201202
----------
@@ -208,8 +209,9 @@ def write(self, data: bytes) -> None:
208209

209210
def decode(self) -> list[GatewayControl]:
210211
"""
211-
Decode messages from the decoder's buffer. This will consume decoded
212-
data from the buffer.
212+
Decode messages from the decoder's buffer.
213+
214+
This will consume decoded data from the buffer.
213215
214216
Returns
215217
-------

0 commit comments

Comments
 (0)