Skip to content

Commit

Permalink
FEAT: Continue work on ratio selection widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
genedan committed Jan 29, 2025
1 parent 7e1d901 commit e22c4b8
Showing 1 changed file with 51 additions and 4 deletions.
55 changes: 51 additions & 4 deletions faslr/model/ratio.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
"""
Module that contains base classes for ratio selections, e.g., development factor or a priori loss ratio selections.
"""
from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from pandas import DataFrame

from faslr.model.average import FAverageBox

from PyQt6.QtCore import Qt

from PyQt6.QtGui import QStandardItemModel

from PyQt6.QtWidgets import (
QWidget
QPushButton,
QWidget,
QVBoxLayout
)


class FRatioSelectionWidget(QWidget):
def __init__(self):
def __init__(
self,
ratios: DataFrame = None,
averages: DataFrame = None
):
"""
Containing widget for FRatioSelectionModel/View.
"""
super().__init__()

def open_average_box(self):
# Main layout.
self.layout = QVBoxLayout()
self.setLayout(self.layout)

pass
# Space above the table(s) where we can put auxiliary buttons, such as one to add averages.
self.tool_space = QWidget()
self.tool_layout = QVBoxLayout()
self.tool_space.setLayout(self.tool_layout)
self.add_average_button = QPushButton("Available Averages")

# Dialog box to select averages.
self.average_box = FAverageBox(data=averages)

self.tool_layout.addWidget(
self.add_average_button,
alignment=Qt.AlignmentFlag.AlignRight
)

self.layout.addWidget(self.tool_space)

self.add_average_button.clicked.connect(self.open_average_box) #noqa


def open_average_box(self):

self.average_box.show()


class FRatioSelectionModel(QStandardItemModel):
def __init__(
self,
ratios: DataFrame
):
super().__init__()
pass

0 comments on commit e22c4b8

Please sign in to comment.