Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

497 #504

Merged
merged 20 commits into from
Apr 4, 2024
Merged

497 #504

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions chainladder/core/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

class TriangleDisplay:
def __repr__(self):
try:
self.values
except:
print("Triangle is empty")
return
# try:
# self.values
# except:
# print("Triangle is empty")
# return

if (self.values.shape[0], self.values.shape[1]) == (1, 1):
data = self._repr_format()
Expand Down
26 changes: 17 additions & 9 deletions chainladder/core/tests/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@

def test_heatmap_render(raa):
"""The heatmap method should render correctly given the sample."""
assert raa.heatmap()
try:
raa.heatmap()

except:
assert False

def test_empty_triangle():
assert cl.Triangle()

# def test_empty_triangle():
# assert cl.Triangle()


def test_to_frame(raa):
assert cl.Chainladder().fit(raa).cdf_.to_frame()
assert cl.Chainladder().fit(raa).cdf_.to_frame(origin_as_datetime=False)
assert cl.Chainladder().fit(raa).cdf_.to_frame(origin_as_datetime=True)
assert cl.Chainladder().fit(raa).ultimate_.to_frame()
assert cl.Chainladder().fit(raa).ultimate_.to_frame(origin_as_datetime=False)
assert cl.Chainladder().fit(raa).ultimate_.to_frame(origin_as_datetime=True)
try:
cl.Chainladder().fit(raa).cdf_.to_frame()
cl.Chainladder().fit(raa).cdf_.to_frame(origin_as_datetime=False)
cl.Chainladder().fit(raa).cdf_.to_frame(origin_as_datetime=True)
cl.Chainladder().fit(raa).ultimate_.to_frame()
cl.Chainladder().fit(raa).ultimate_.to_frame(origin_as_datetime=False)
cl.Chainladder().fit(raa).ultimate_.to_frame(origin_as_datetime=True)

except:
assert False
Loading