Skip to content

Commit

Permalink
Move color_chooser, style_chooser, and filter_popup
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Oct 7, 2024
1 parent 1829ad8 commit ff86cad
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 32 deletions.
8 changes: 0 additions & 8 deletions src/ert/gui/tools/plot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from .color_chooser import ColorBox
from .filter_popup import FilterPopup
from .filterable_kw_list_model import FilterableKwListModel
from .plot_tool import PlotTool
from .style_chooser import StyleChooser

__all__ = [
"ColorBox",
"FilterPopup",
"FilterableKwListModel",
"PlotTool",
"StyleChooser",
]
File renamed without changes.
6 changes: 3 additions & 3 deletions src/ert/gui/tools/plot/customize/customization_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from ert.gui.tools.plot.widgets import ClearableLineEdit

from .. import style_chooser as sc
from .style_chooser import STYLESET_DEFAULT, StyleChooser

if TYPE_CHECKING:
from ert.gui.tools.plot.plottery import PlotConfig
Expand Down Expand Up @@ -111,9 +111,9 @@ def addStyleChooser(
attribute_name: str,
title: str,
tool_tip: Optional[str] = None,
line_style_set: str = sc.STYLESET_DEFAULT,
line_style_set: str = STYLESET_DEFAULT,
) -> None:
style_chooser = sc.StyleChooser(line_style_set=line_style_set)
style_chooser = StyleChooser(line_style_set=line_style_set)
self[attribute_name] = style_chooser
self.addRow(title, self[attribute_name])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

from qtpy.QtWidgets import QComboBox, QHBoxLayout

from ert.gui.tools.plot import style_chooser as sc

from .customization_view import CustomizationView, WidgetProperty
from .style_chooser import STYLESET_AREA

if TYPE_CHECKING:
from ert.gui.tools.plot.plottery import PlotConfig
Expand Down Expand Up @@ -46,25 +45,25 @@ def __init__(self) -> None:
"std_style",
"Std dev",
"Line and marker style for the unbiased standard deviation lines.",
line_style_set=sc.STYLESET_AREA,
line_style_set=STYLESET_AREA,
)
self.addStyleChooser(
"min_max_style",
"Min/max",
"Line and marker style for the min/max lines.",
line_style_set=sc.STYLESET_AREA,
line_style_set=STYLESET_AREA,
)
self.addStyleChooser(
"p10_p90_style",
"P10-P90",
"Line and marker style for the P10-P90 lines.",
line_style_set=sc.STYLESET_AREA,
line_style_set=STYLESET_AREA,
)
self.addStyleChooser(
"p33_p67_style",
"P33-P67",
"Line and marker style for the P33-P67 lines.",
line_style_set=sc.STYLESET_AREA,
line_style_set=STYLESET_AREA,
)
self.addSpacing()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
QWidget,
)

from .plottery import PlotStyle
from ert.gui.tools.plot.plottery import PlotStyle

STYLE_OFF = ("Off", None)
STYLE_AREA = ("Area", "#")
Expand Down
7 changes: 3 additions & 4 deletions src/ert/gui/tools/plot/customize/style_customization_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

from qtpy.QtWidgets import QHBoxLayout

from ert.gui.tools.plot import ColorBox
from ert.gui.tools.plot import style_chooser as sc

from .color_chooser import ColorBox
from .customization_view import CustomizationView, WidgetProperty
from .style_chooser import STYLESET_TOGGLE

if TYPE_CHECKING:
from ert.gui.tools.plot.plottery import PlotConfig
Expand Down Expand Up @@ -34,7 +33,7 @@ def __init__(self) -> None:
"observs_style",
"Observation",
"Line and marker style for the observation line.",
line_style_set=sc.STYLESET_TOGGLE,
line_style_set=STYLESET_TOGGLE,
)

self["default_style"].createLabelLayout(layout)
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/tools/plot/data_type_keys_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

from .data_type_keys_list_model import DataTypeKeysListModel
from .data_type_proxy_model import DataTypeProxyModel
from .filter_popup import FilterPopup
from .plot_api import PlotApiKeyDefinition
from .widgets import FilterPopup


class _LegendMarker(QWidget):
Expand Down
3 changes: 2 additions & 1 deletion src/ert/gui/tools/plot/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .clearable_line_edit import ClearableLineEdit
from .copy_style_to_dialog import CopyStyleToDialog
from .custom_date_edit import CustomDateEdit
from .filter_popup import FilterPopup

__all__ = ["ClearableLineEdit", "CopyStyleToDialog", "CustomDateEdit"]
__all__ = ["ClearableLineEdit", "CopyStyleToDialog", "CustomDateEdit", "FilterPopup"]
12 changes: 9 additions & 3 deletions src/ert/gui/tools/plot/widgets/copy_style_to_dialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import Any, Dict, List, Optional
from __future__ import annotations

from typing import TYPE_CHECKING, Any, Dict, List, Optional

from qtpy.QtGui import QIcon
from qtpy.QtWidgets import (
Expand All @@ -11,8 +13,12 @@
)

from ert.gui.ertwidgets import CheckList
from ert.gui.tools.plot import FilterableKwListModel, FilterPopup
from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition

from .filter_popup import FilterPopup
from .filterable_kw_list_model import FilterableKwListModel

if TYPE_CHECKING:
from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition


class CopyStyleToDialog(QDialog):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import List, Optional
from __future__ import annotations

from typing import TYPE_CHECKING, List, Optional

from qtpy.QtCore import QEvent, Qt, Signal
from qtpy.QtGui import QCursor
Expand All @@ -12,7 +14,8 @@
QWidget,
)

from .plot_api import PlotApiKeyDefinition
if TYPE_CHECKING:
from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition


class FilterPopup(QDialog):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from typing import Dict, List
from __future__ import annotations

from ert.gui.ertwidgets.models.selectable_list_model import SelectableListModel
from typing import TYPE_CHECKING, Dict, List

from .plot_api import PlotApiKeyDefinition
from ert.gui.ertwidgets import SelectableListModel

if TYPE_CHECKING:
from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition


class FilterableKwListModel(SelectableListModel):
Expand Down

0 comments on commit ff86cad

Please sign in to comment.