Skip to content

Commit

Permalink
Add docstrings for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dralshehri committed Feb 10, 2022
1 parent f83bb5a commit 16f4d32
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/epiweeks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def __init__(
week starts on Sunday or ``iso`` where the week starts on
Monday.
validate: Whether to validate year, week and system or not.
Raises:
ValueError: When ``year`` is out of supported range.
ValueError: When ``week`` is out of weeks range for year.
ValueError: When ``system`` is not within supported systems.
"""

if validate:
Expand Down Expand Up @@ -243,6 +248,10 @@ def __init__(self, year: int, system: str = "cdc"):
system: Week numbering system, which may be ``cdc`` where the
week starts on Sunday or ``iso`` where the week starts on
Monday.
Raises:
ValueError: When ``year`` is out of supported range.
ValueError: When ``system`` is not within supported systems.
"""

_check_year(year)
Expand Down

0 comments on commit 16f4d32

Please sign in to comment.