Skip to content

Commit

Permalink
update docstrngs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jan 31, 2025
1 parent 89ea006 commit 70d1420
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/ga4gh/core/enderef.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def ga4gh_enref(o, cra_map, object_store=None, return_id_obj_tuple=False) -> tup
"""Recursively convert "referable attributes" from inlined to
referenced form. Returns a new object.
cra_map: class referrable-attribute map; { o.type: [attr, attr, ...] }
If `object_store` is provided, it must be an
collections.abc.MutableMapping subclass and will be used to store
objects as they are referenced. If `object_store` is not provided
(or None), referenced objects will not be stored.
:param o: VRS object
:param cra_map: class referrable-attribute map; { o.type: [attr, attr, ...] }
:param object_store: `collections.abc.MutableMapping` subclass that stores
objects as they are referenced. If not given, referenced objects are not stored.
:param return_id_obj_tuple: include ID with return value or not
:return: new, enref'd object, as well as object ID if param set
:raise TypeError: if any object IDs are non-GA4GH CURIEs
"""

def _id_and_store(o): # noqa: ANN202 ANN001
Expand Down
3 changes: 3 additions & 0 deletions src/ga4gh/vrs/dataproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ def _isoformat(o: datetime.datetime) -> str:
>>> _isoformat(dt)
'2019-10-15T10:23:41.115927Z'
:param o: date object to format
:return: ISO8601-formatted string equivalent
:raise TypeError: if object given isn't a Python datetime instance
"""
# stolen from connexion flask_app.py
if not isinstance(o, datetime.datetime):
Expand Down
9 changes: 6 additions & 3 deletions src/ga4gh/vrs/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,12 @@ def _normalize_cis_phased_block(o, data_proxy: _DataProxy | None = None): # noq
def normalize(vo, data_proxy: _DataProxy | None = None, **kwargs):
"""Normalize given vrs object, regardless of type
kwargs:
rle_seq_limit: If RLE is set as the new state, set the limit for the length
of the `sequence`. To exclude `state.sequence`, set to 0.
:param vo:
:param data_proxy: GA4GH sequence dataproxy instance, if needed
:keyword rle_seq_limit: If RLE is set as the new state, set the limit for the length
of the `sequence`. To exclude `state.sequence`, set to 0.
:return: normalized object
:raise TypeError: if given object isn't a pydantic.BaseModel
"""
if not is_pydantic_instance(vo):
msg = f"Object is of class {vo.__class__} (with parents {vo.__class__.__mro__}), but normalize requires objects that inherit from pydantic.BaseModel."
Expand Down

0 comments on commit 70d1420

Please sign in to comment.