From 9dc86b7235db1f7967d0d034baba2acb39e8afd1 Mon Sep 17 00:00:00 2001 From: Kenneth Hsu Date: Mon, 6 May 2024 14:31:08 -0700 Subject: [PATCH] Fixed outstanding issue from #511 --- chainladder/core/base.py | 8 ++++---- chainladder/core/triangle.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chainladder/core/base.py b/chainladder/core/base.py index 5b25750b..8a57df2b 100644 --- a/chainladder/core/base.py +++ b/chainladder/core/base.py @@ -274,16 +274,16 @@ def _get_grain(dates, trailing=False, kind="origin"): diffs = np.diff(np.sort(months)) if len(dates.unique()) == 1: grain = ( - "A" + "Y" if version.Version(pd.__version__) >= version.Version("2.2.0") - else "Y" + else "A" ) elif len(months) == 1: grain = ( - "A" + "Y" if version.Version(pd.__version__) >= version.Version("2.2.0") - else "Y" + else "A" ) elif np.all(diffs == 6): diff --git a/chainladder/core/triangle.py b/chainladder/core/triangle.py index b9806c7b..96557adc 100644 --- a/chainladder/core/triangle.py +++ b/chainladder/core/triangle.py @@ -332,9 +332,9 @@ def origin(self): else: freq = { "Y": ( - "A" + "Y" if version.Version(pd.__version__) >= version.Version("2.2.0") - else "Y" + else "A" ), "S": "2Q", "H": "2Q",