Skip to content

Commit f904543

Browse files
committed
FEAT: Begin adding annotations to average.py.
1 parent 550b59b commit f904543

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

faslr/model/average.py

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,47 @@
2929
QVBoxLayout
3030
)
3131

32-
from typing import TYPE_CHECKING
32+
from typing import (
33+
Optional,
34+
TYPE_CHECKING
35+
)
3336

3437
if TYPE_CHECKING:
3538
from pandas import DataFrame
36-
from faslr.common.model import FSelectionModel
39+
from faslr.common.model import (
40+
FSelectionModel,
41+
FSelectionModelWidget
42+
)
3743

3844
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+
"""
3960
def __init__(
4061
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
4566
):
46-
"""
47-
Dialog box that interacts between the user and the parent ratio selection model.
48-
"""
67+
4968
super().__init__()
5069

5170
self.layout = QVBoxLayout()
5271

53-
self.parent = parent
72+
self.parent: FSelectionModelWidget = parent
5473

5574
self.selection_model = selection_model
5675

0 commit comments

Comments
 (0)