Skip to content

Commit

Permalink
Try documenting a class parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
bsweger committed Oct 11, 2024
1 parent 83369fd commit b750fb1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
"polars": ("https://docs.pola.rs/api/python/stable", None),
}
intersphinx_disabled_domains = ["std"]

Expand Down Expand Up @@ -120,6 +121,7 @@
nitpicky = True
nitpick_ignore = [
("py:class", "datetime"),
("py:class", "polars.LazyFrame"),
]


Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ daily workflow pipeline.
USA ┆ Arizona ┆ 2022-07-20 ┆ Homo sapiens ┆ 22B
└─────────┴──────────┴────────────┴──────────────┴──────────────────┘
See the :doc:`user-guide` for more details about working with Cladetime.`
See the :doc:`user-guide` for more details about working with Cladetime.

The :doc:`reference/index` documentation provides API-level documentation.

1 change: 1 addition & 0 deletions docs/reference/cladetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CladeTime
==========

.. autoclass:: cladetime.CladeTime
:members:
11 changes: 4 additions & 7 deletions src/cladetime/cladetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class CladeTime:
Attributes
----------
ncov_metadata : dict
Metadata for the Nextstrain ncov pipeline that generated the sequence
and sequence metadata that correspond to the sequence_as_of date
url_sequence : str
S3 URL to the Nextstrain Sars-CoV-2 sequence file (zst-compressed
.fasta) that was available at the sequence_as_of
Expand Down Expand Up @@ -72,7 +69,6 @@ def sequence_as_of(self) -> datetime:

@sequence_as_of.setter
def sequence_as_of(self, date) -> None:
"""Set the sequence_as_of attribute."""
sequence_as_of = self._validate_as_of_date(date)
utc_now = datetime.now(timezone.utc)
if sequence_as_of > utc_now:
Expand All @@ -90,7 +86,6 @@ def tree_as_of(self) -> datetime:

@tree_as_of.setter
def tree_as_of(self, date) -> None:
"""Set the tree_as_of attribute."""
if date is None:
tree_as_of = self.sequence_as_of
else:
Expand All @@ -111,7 +106,9 @@ def ncov_metadata(self):

@ncov_metadata.getter
def ncov_metadata(self) -> dict:
"""Get the ncov_metadata attribute."""
"""dict : Metadata for the Nextstrain ncov pipeline that generated the
sequence and sequence metadata that correspond to the
sequence_as_of date"""
if self.url_ncov_metadata:
metadata = _get_ncov_metadata(self.url_ncov_metadata)
return metadata
Expand All @@ -125,7 +122,7 @@ def sequence_metadata(self):

@sequence_metadata.getter
def sequence_metadata(self) -> pl.LazyFrame:
"""Get the sequence_metadata attribute."""
""":class:`polars.LazyFrame` : A Polars LazyFrame that references :any:`the sequence metadata on S3<url_sequence_metadata>`"""
if self.url_sequence_metadata:
sequence_metadata = get_covid_genome_metadata(metadata_url=self.url_sequence_metadata)
return sequence_metadata
Expand Down

0 comments on commit b750fb1

Please sign in to comment.