|
29 | 29 | QVBoxLayout |
30 | 30 | ) |
31 | 31 |
|
32 | | -from typing import TYPE_CHECKING |
| 32 | +from typing import ( |
| 33 | + Optional, |
| 34 | + TYPE_CHECKING |
| 35 | +) |
33 | 36 |
|
34 | 37 | if TYPE_CHECKING: |
35 | 38 | from pandas import DataFrame |
36 | | - from faslr.common.model import FSelectionModel |
| 39 | + from faslr.common.model import ( |
| 40 | + FSelectionModel, |
| 41 | + FSelectionModelWidget |
| 42 | + ) |
37 | 43 |
|
38 | 44 | class FAverageBox(QDialog): |
| 45 | + """ |
| 46 | + Dialog box used to add an average to a loss model from the list of available averages, or to add an average |
| 47 | + to the list of available averages. |
| 48 | +
|
| 49 | + Parameters |
| 50 | + ---------- |
| 51 | + parent: Optional[FSelectionModelWidget] |
| 52 | + The containing widget of the corresponding selection model. |
| 53 | + selection_model: Optional[FSelectionModel] |
| 54 | + The corresponding selection model. |
| 55 | + title: Optional[str] |
| 56 | + The title of the dialog box, overriding the default. |
| 57 | + data: Optional[DataFrame] |
| 58 | + A dataframe containing the available averages. Overrides extraction of these averages from the database. |
| 59 | + """ |
39 | 60 | def __init__( |
40 | 61 | self, |
41 | | - parent, |
42 | | - selection_model: FSelectionModel = None, |
43 | | - title: str = None, |
44 | | - data: DataFrame = None |
| 62 | + parent: Optional[FSelectionModelWidget], |
| 63 | + selection_model: Optional[FSelectionModel] = None, |
| 64 | + title: Optional[str] = "Available Averages", |
| 65 | + data: Optional[DataFrame] = None |
45 | 66 | ): |
46 | | - """ |
47 | | - Dialog box that interacts between the user and the parent ratio selection model. |
48 | | - """ |
| 67 | + |
49 | 68 | super().__init__() |
50 | 69 |
|
51 | 70 | self.layout = QVBoxLayout() |
52 | 71 |
|
53 | | - self.parent = parent |
| 72 | + self.parent: FSelectionModelWidget = parent |
54 | 73 |
|
55 | 74 | self.selection_model = selection_model |
56 | 75 |
|
|
0 commit comments