Skip to content

Commit

Permalink
Fixed outstanding issue from #511
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethshsu committed May 6, 2024
1 parent 6a4ee3d commit 9dc86b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions chainladder/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions chainladder/core/triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9dc86b7

Please sign in to comment.