diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2021-05-17 08:13:22 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2021-05-17 08:13:22 +0100 |
commit | a5b4f46b55ee39409126da978677f54e271060c1 (patch) | |
tree | fd8d7afc460479efb3220fcf5c61f38d0dc9d91d /datamaps/core/temporal.py | |
parent | e3f26229d0f69ddb93b866e184626337c30778c2 (diff) |
refactorings
Diffstat (limited to 'datamaps/core/temporal.py')
-rw-r--r-- | datamaps/core/temporal.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/datamaps/core/temporal.py b/datamaps/core/temporal.py index 24a0d70..f97edfa 100644 --- a/datamaps/core/temporal.py +++ b/datamaps/core/temporal.py @@ -32,9 +32,13 @@ class Month: @property def end_date(self): if self._month_int == 2 and calendar.isleap(self.year): - return datetime.date(self.year, self._month_int, Month._end_ints[self._month_int] + 1) + return datetime.date( + self.year, self._month_int, Month._end_ints[self._month_int] + 1 + ) else: - return datetime.date(self.year, self._month_int, Month._end_ints[self._month_int]) + return datetime.date( + self.year, self._month_int, Month._end_ints[self._month_int] + ) @property def name(self): @@ -112,8 +116,10 @@ class FinancialYear: class Quarter: - """An object representing a financial quarter. This is mainly required for building - a :py:class:`core.master.Master` object. + """An object representing a financial quarter. + + This is mainly required for building a :py:class:`core.master.Master` + object. Args: quarter (int): e.g.1, 2, 3 or 4 @@ -166,7 +172,6 @@ class Quarter: year = self.year self.months.append(Month(m, year)) - def __str__(self): return f"Q{self.quarter} {str(self.year)[2:]}/{str(self.year + 1)[2:]}" |