Skip to content

Commit 2723d48

Browse files
committed
DOCS: Add annotations to bornhuetter.py.
1 parent 25474c3 commit 2723d48

File tree

1 file changed

+41
-8
lines changed

1 file changed

+41
-8
lines changed

faslr/methods/bornhuetter.py

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
"""
2+
Widgets for the Bornhuetter-Ferguson technique.
3+
"""
14
from __future__ import annotations
25

36
import numpy as np
47

5-
from faslr.base_table import FTableView
6-
78
from faslr.grid_header import GridTableView
89

910
from faslr.model import (
@@ -38,15 +39,31 @@
3839
if TYPE_CHECKING:
3940
from chainladder import Chainladder
4041
from pandas import DataFrame
41-
from typing import List
42+
from typing import (
43+
List,
44+
Optional
45+
)
4246

4347

4448
class BornhuetterWidget(FModelWidget):
49+
"""
50+
The containing widget for the Bornhuetter-Ferguson technique.
51+
52+
Parameters
53+
----------
54+
triangles: Optional[List[Chainladder]]
55+
The underlying triangles for the B-F technique.
56+
premium: Optional[list]
57+
averages: Optional[DataFrame]
58+
A DataFrame containing metadata on average types, i.e., all-year straight, 3-year volume-weighted, etc.
59+
The application by default will take this data from the underlying database, but this argument will
60+
override that query.
61+
"""
4562
def __init__(
4663
self,
47-
triangles: List[Chainladder] = None,
48-
premium: list = None,
49-
averages: DataFrame = None
64+
triangles: Optional[List[Chainladder]] = None,
65+
premium: Optional[list] = None,
66+
averages: Optional[DataFrame] = None
5067
):
5168
super().__init__()
5269

@@ -94,9 +111,17 @@ def __init__(
94111

95112

96113
class BornhuetterIBNRWidget(FIBNRWidget):
114+
"""
115+
The IBNR summary for the B-F method.
116+
117+
Parameters
118+
----------
119+
parent: Optional[BornhuetterWidget]
120+
The containing BornhuetterWidget.
121+
"""
97122
def __init__(
98123
self,
99-
parent: BornhuetterWidget
124+
parent: Optional[BornhuetterWidget] = None
100125
):
101126
self.parent: BornhuetterWidget = parent
102127
self.ibnr_model = BornhuetterIBNRModel(parent=self)
@@ -365,9 +390,17 @@ def __init__(
365390
)
366391

367392
class BornhuetterIBNRModel(FIBNRModel):
393+
"""
394+
The IBNR model for the BornhuetterIBNRWidget.
395+
396+
Parameters
397+
----------
398+
parent: Optional[BornhuetterIBNRWidget]
399+
The parent BornhuetterIBNRWidget.
400+
"""
368401
def __init__(
369402
self,
370-
parent: BornhuetterIBNRWidget
403+
parent: Optional[BornhuetterIBNRWidget] = None
371404
):
372405
super().__init__(parent=parent)
373406
self._data['On-Level Earned Premium'] = self.parent.parent.apriori_tab.model._data['On-Level Earned Premium']

0 commit comments

Comments
 (0)