-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1143: Consolidate date code to one directory
- Loading branch information
Showing
10 changed files
with
41 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class InvalidDate(Exception): | ||
"""Custom exception class to handle dates in unsupported formats.""" | ||
|
||
def __init__(self, date, message): | ||
"""Initialize the error with the culprit date string and a meaningful message.""" | ||
self.date = date | ||
self.message = message | ||
|
||
def __str__(self): | ||
"""Return a human-readable summary of the error.""" | ||
return f"Invalid date '{self.date}': {self.message}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,2 @@ | ||
class AugurError(Exception): | ||
pass | ||
|
||
|
||
# TODO: Move this to something like dates/errors.py | ||
class InvalidDate(Exception): | ||
"""Custom exception class to handle dates in unsupported formats.""" | ||
|
||
def __init__(self, date, message): | ||
"""Initialize the error with the culprit date string and a meaningful message.""" | ||
self.date = date | ||
self.message = message | ||
|
||
def __str__(self): | ||
"""Return a human-readable summary of the error.""" | ||
return f"Invalid date '{self.date}': {self.message}" |
4 changes: 2 additions & 2 deletions
4
...augur.util_support.date_disambiguator.rst → .../developer/augur.dates.ambiguous_date.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
augur.util\_support.date\_disambiguator | ||
augur.dates.ambiguous\_date | ||
======================================= | ||
|
||
.. automodule:: augur.util_support.date_disambiguator | ||
.. automodule:: augur.dates.ambiguous_date | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
augur.dates.errors | ||
================== | ||
|
||
.. automodule:: augur.dates.errors | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.