|
| 1 | +""" |
| 2 | +Widgets for the Bornhuetter-Ferguson technique. |
| 3 | +""" |
1 | 4 | from __future__ import annotations |
2 | 5 |
|
3 | 6 | import numpy as np |
4 | 7 |
|
5 | | -from faslr.base_table import FTableView |
6 | | - |
7 | 8 | from faslr.grid_header import GridTableView |
8 | 9 |
|
9 | 10 | from faslr.model import ( |
|
38 | 39 | if TYPE_CHECKING: |
39 | 40 | from chainladder import Chainladder |
40 | 41 | from pandas import DataFrame |
41 | | - from typing import List |
| 42 | + from typing import ( |
| 43 | + List, |
| 44 | + Optional |
| 45 | + ) |
42 | 46 |
|
43 | 47 |
|
44 | 48 | 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 | + """ |
45 | 62 | def __init__( |
46 | 63 | 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 |
50 | 67 | ): |
51 | 68 | super().__init__() |
52 | 69 |
|
@@ -94,9 +111,17 @@ def __init__( |
94 | 111 |
|
95 | 112 |
|
96 | 113 | 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 | + """ |
97 | 122 | def __init__( |
98 | 123 | self, |
99 | | - parent: BornhuetterWidget |
| 124 | + parent: Optional[BornhuetterWidget] = None |
100 | 125 | ): |
101 | 126 | self.parent: BornhuetterWidget = parent |
102 | 127 | self.ibnr_model = BornhuetterIBNRModel(parent=self) |
@@ -365,9 +390,17 @@ def __init__( |
365 | 390 | ) |
366 | 391 |
|
367 | 392 | class BornhuetterIBNRModel(FIBNRModel): |
| 393 | + """ |
| 394 | + The IBNR model for the BornhuetterIBNRWidget. |
| 395 | +
|
| 396 | + Parameters |
| 397 | + ---------- |
| 398 | + parent: Optional[BornhuetterIBNRWidget] |
| 399 | + The parent BornhuetterIBNRWidget. |
| 400 | + """ |
368 | 401 | def __init__( |
369 | 402 | self, |
370 | | - parent: BornhuetterIBNRWidget |
| 403 | + parent: Optional[BornhuetterIBNRWidget] = None |
371 | 404 | ): |
372 | 405 | super().__init__(parent=parent) |
373 | 406 | self._data['On-Level Earned Premium'] = self.parent.parent.apriori_tab.model._data['On-Level Earned Premium'] |
|
0 commit comments