diff --git a/src/ert/gui/plottery/__init__.py b/src/ert/gui/plottery/__init__.py deleted file mode 100644 index a312c6e57a4..00000000000 --- a/src/ert/gui/plottery/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# isort: skip_file - -# At least for some combinations of pandas and matplotlib the numpy.datetime64 -# dates coming from pandas are not correctly recognized/converted by matplotlib. -# Calling this converter.register() method seems to fix the problem. -from pandas.plotting import register_matplotlib_converters - -register_matplotlib_converters() - -from .plot_style import PlotStyle # noqa -from .plot_limits import PlotLimits # noqa -from .plot_config import PlotConfig # noqa -from .plot_context import PlotContext # noqa -from .plot_config_history import PlotConfigHistory # noqa -from .plot_config_factory import PlotConfigFactory # noqa diff --git a/src/ert/gui/plottery/plots/__init__.py b/src/ert/gui/plottery/plots/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/ert/gui/simulation/run_dialog.py b/src/ert/gui/simulation/run_dialog.py index 56cba507be2..4005681dc9d 100644 --- a/src/ert/gui/simulation/run_dialog.py +++ b/src/ert/gui/simulation/run_dialog.py @@ -53,7 +53,7 @@ SnapshotModel, ) from ert.gui.tools.file import FileDialog -from ert.gui.tools.plot.plot_tool import PlotTool +from ert.gui.tools.plot import PlotTool from ert.run_models import ( BaseRunModel, RunModelStatusEvent, diff --git a/src/ert/gui/tools/plot/customize/customization_view.py b/src/ert/gui/tools/plot/customize/customization_view.py index 24f6c508c8f..082b3c514fe 100644 --- a/src/ert/gui/tools/plot/customize/customization_view.py +++ b/src/ert/gui/tools/plot/customize/customization_view.py @@ -11,12 +11,12 @@ QWidget, ) -from ert.gui.tools.plot.widgets.clearable_line_edit import ClearableLineEdit +from ert.gui.tools.plot.widgets import ClearableLineEdit from .. import style_chooser as sc if TYPE_CHECKING: - from ert.gui.plottery import PlotConfig + from ert.gui.tools.plot.plottery import PlotConfig class CustomizationView(QWidget): diff --git a/src/ert/gui/tools/plot/customize/customize_plot_dialog.py b/src/ert/gui/tools/plot/customize/customize_plot_dialog.py index 4435548ec02..cd4e3bdddfa 100644 --- a/src/ert/gui/tools/plot/customize/customize_plot_dialog.py +++ b/src/ert/gui/tools/plot/customize/customize_plot_dialog.py @@ -19,8 +19,8 @@ QWidgetAction, ) -from ert.gui.plottery import PlotConfig, PlotConfigFactory, PlotConfigHistory from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition +from ert.gui.tools.plot.plottery import PlotConfig, PlotConfigFactory, PlotConfigHistory from ert.gui.tools.plot.widgets import CopyStyleToDialog from .default_customization_view import DefaultCustomizationView @@ -29,7 +29,7 @@ from .style_customization_view import StyleCustomizationView if TYPE_CHECKING: - from ert.gui.tools.plot.customize import CustomizationView + from .customization_view import CustomizationView class PlotCustomizer(QObject): diff --git a/src/ert/gui/tools/plot/customize/default_customization_view.py b/src/ert/gui/tools/plot/customize/default_customization_view.py index 67fb1b8aca1..a03720f1f91 100644 --- a/src/ert/gui/tools/plot/customize/default_customization_view.py +++ b/src/ert/gui/tools/plot/customize/default_customization_view.py @@ -3,7 +3,7 @@ from .customization_view import CustomizationView, WidgetProperty if TYPE_CHECKING: - from ert.gui.plottery import PlotConfig + from ert.gui.tools.plot.plottery import PlotConfig def _label_msg(label: str) -> str: diff --git a/src/ert/gui/tools/plot/customize/limits_customization_view.py b/src/ert/gui/tools/plot/customize/limits_customization_view.py index 335a8070c25..dd8fb620cfb 100644 --- a/src/ert/gui/tools/plot/customize/limits_customization_view.py +++ b/src/ert/gui/tools/plot/customize/limits_customization_view.py @@ -7,15 +7,13 @@ from qtpy.QtGui import QDoubleValidator, QIntValidator from qtpy.QtWidgets import QLabel, QStackedWidget, QWidget -from ert.gui.plottery import PlotContext -from ert.gui.plottery.plot_limits import PlotLimits -from ert.gui.tools.plot.widgets.clearable_line_edit import ClearableLineEdit -from ert.gui.tools.plot.widgets.custom_date_edit import CustomDateEdit +from ert.gui.tools.plot.plottery import PlotContext, PlotLimits +from ert.gui.tools.plot.widgets import ClearableLineEdit, CustomDateEdit from .customization_view import CustomizationView if TYPE_CHECKING: - from ert.gui.plottery import PlotConfig + from ert.gui.tools.plot.plottery import PlotConfig class StackedInput(QStackedWidget): diff --git a/src/ert/gui/tools/plot/customize/statistics_customization_view.py b/src/ert/gui/tools/plot/customize/statistics_customization_view.py index a3c3fb26670..019293ee206 100644 --- a/src/ert/gui/tools/plot/customize/statistics_customization_view.py +++ b/src/ert/gui/tools/plot/customize/statistics_customization_view.py @@ -9,7 +9,7 @@ from .customization_view import CustomizationView, WidgetProperty if TYPE_CHECKING: - from ert.gui.plottery import PlotConfig + from ert.gui.tools.plot.plottery import PlotConfig class StatisticsCustomizationView(CustomizationView): diff --git a/src/ert/gui/tools/plot/customize/style_customization_view.py b/src/ert/gui/tools/plot/customize/style_customization_view.py index 117d65ce173..657ca777673 100644 --- a/src/ert/gui/tools/plot/customize/style_customization_view.py +++ b/src/ert/gui/tools/plot/customize/style_customization_view.py @@ -8,7 +8,7 @@ from .customization_view import CustomizationView, WidgetProperty if TYPE_CHECKING: - from ert.gui.plottery import PlotConfig + from ert.gui.tools.plot.plottery import PlotConfig class StyleCustomizationView(CustomizationView): diff --git a/src/ert/gui/tools/plot/data_type_keys_list_model.py b/src/ert/gui/tools/plot/data_type_keys_list_model.py index c626dc05134..8b2faa9d978 100644 --- a/src/ert/gui/tools/plot/data_type_keys_list_model.py +++ b/src/ert/gui/tools/plot/data_type_keys_list_model.py @@ -4,7 +4,7 @@ from qtpy.QtGui import QColor, QIcon from typing_extensions import override -from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition +from .plot_api import PlotApiKeyDefinition class DataTypeKeysListModel(QAbstractItemModel): diff --git a/src/ert/gui/tools/plot/data_type_keys_widget.py b/src/ert/gui/tools/plot/data_type_keys_widget.py index d7040d30b84..368d8bf9987 100644 --- a/src/ert/gui/tools/plot/data_type_keys_widget.py +++ b/src/ert/gui/tools/plot/data_type_keys_widget.py @@ -12,11 +12,11 @@ ) from ert.gui.ertwidgets import SearchBox -from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition 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 class _LegendMarker(QWidget): diff --git a/src/ert/gui/tools/plot/filter_popup.py b/src/ert/gui/tools/plot/filter_popup.py index dc0f4f2cbe3..091eb6b917c 100644 --- a/src/ert/gui/tools/plot/filter_popup.py +++ b/src/ert/gui/tools/plot/filter_popup.py @@ -12,7 +12,7 @@ QWidget, ) -from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition +from .plot_api import PlotApiKeyDefinition class FilterPopup(QDialog): diff --git a/src/ert/gui/tools/plot/filterable_kw_list_model.py b/src/ert/gui/tools/plot/filterable_kw_list_model.py index 665fe18ca5f..3a1cf528a89 100644 --- a/src/ert/gui/tools/plot/filterable_kw_list_model.py +++ b/src/ert/gui/tools/plot/filterable_kw_list_model.py @@ -1,7 +1,8 @@ from typing import Dict, List from ert.gui.ertwidgets.models.selectable_list_model import SelectableListModel -from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition + +from .plot_api import PlotApiKeyDefinition class FilterableKwListModel(SelectableListModel): diff --git a/src/ert/gui/tools/plot/plot_ensemble_selection_widget.py b/src/ert/gui/tools/plot/plot_ensemble_selection_widget.py index ee06dffd1b4..9da4b6e7bd7 100644 --- a/src/ert/gui/tools/plot/plot_ensemble_selection_widget.py +++ b/src/ert/gui/tools/plot/plot_ensemble_selection_widget.py @@ -21,7 +21,7 @@ QWidget, ) -from ert.gui.tools.plot.plot_api import EnsembleObject +from .plot_api import EnsembleObject class EnsembleSelectionWidget(QWidget): diff --git a/src/ert/gui/tools/plot/plot_widget.py b/src/ert/gui/tools/plot/plot_widget.py index 09e271e7a31..92093a59ae1 100644 --- a/src/ert/gui/tools/plot/plot_widget.py +++ b/src/ert/gui/tools/plot/plot_widget.py @@ -20,17 +20,17 @@ QWidgetAction, ) -from ert.gui.tools.plot.plot_api import EnsembleObject +from .plot_api import EnsembleObject if TYPE_CHECKING: - from ert.gui.plottery import PlotContext - from ert.gui.plottery.plots.cesp import CrossEnsembleStatisticsPlot - from ert.gui.plottery.plots.distribution import DistributionPlot - from ert.gui.plottery.plots.ensemble import EnsemblePlot - from ert.gui.plottery.plots.gaussian_kde import GaussianKDEPlot - from ert.gui.plottery.plots.histogram import HistogramPlot - from ert.gui.plottery.plots.statistics import StatisticsPlot - from ert.gui.plottery.plots.std_dev import StdDevPlot + from .plottery import PlotContext + from .plottery.plots.cesp import CrossEnsembleStatisticsPlot + from .plottery.plots.distribution import DistributionPlot + from .plottery.plots.ensemble import EnsemblePlot + from .plottery.plots.gaussian_kde import GaussianKDEPlot + from .plottery.plots.histogram import HistogramPlot + from .plottery.plots.statistics import StatisticsPlot + from .plottery.plots.std_dev import StdDevPlot class CustomNavigationToolbar(NavigationToolbar2QT): diff --git a/src/ert/gui/tools/plot/plot_window.py b/src/ert/gui/tools/plot/plot_window.py index 777129ad5a5..bcf77faa067 100644 --- a/src/ert/gui/tools/plot/plot_window.py +++ b/src/ert/gui/tools/plot/plot_window.py @@ -10,21 +10,22 @@ from qtpy.QtWidgets import QDockWidget, QMainWindow, QTabWidget, QWidget from ert.gui.ertwidgets import showWaitCursorWhileWaiting -from ert.gui.plottery import PlotConfig, PlotContext -from ert.gui.plottery.plots.cesp import CrossEnsembleStatisticsPlot -from ert.gui.plottery.plots.distribution import DistributionPlot -from ert.gui.plottery.plots.ensemble import EnsemblePlot -from ert.gui.plottery.plots.gaussian_kde import GaussianKDEPlot -from ert.gui.plottery.plots.histogram import HistogramPlot -from ert.gui.plottery.plots.statistics import StatisticsPlot -from ert.gui.plottery.plots.std_dev import StdDevPlot -from ert.gui.tools.plot.plot_api import EnsembleObject, PlotApiKeyDefinition from .customize import PlotCustomizer from .data_type_keys_widget import DataTypeKeysWidget -from .plot_api import PlotApi +from .plot_api import EnsembleObject, PlotApi, PlotApiKeyDefinition from .plot_ensemble_selection_widget import EnsembleSelectionWidget from .plot_widget import PlotWidget +from .plottery import PlotConfig, PlotContext +from .plottery.plots import ( + CrossEnsembleStatisticsPlot, + DistributionPlot, + EnsemblePlot, + GaussianKDEPlot, + HistogramPlot, + StatisticsPlot, + StdDevPlot, +) CROSS_ENSEMBLE_STATISTICS = "Cross ensemble statistics" DISTRIBUTION = "Distribution" diff --git a/src/ert/gui/tools/plot/plottery/__init__.py b/src/ert/gui/tools/plot/plottery/__init__.py new file mode 100644 index 00000000000..f4872c9eca8 --- /dev/null +++ b/src/ert/gui/tools/plot/plottery/__init__.py @@ -0,0 +1,24 @@ +# isort: skip_file + +# At least for some combinations of pandas and matplotlib the numpy.datetime64 +# dates coming from pandas are not correctly recognized/converted by matplotlib. +# Calling this converter.register() method seems to fix the problem. +from pandas.plotting import register_matplotlib_converters + +register_matplotlib_converters() + +from .plot_style import PlotStyle +from .plot_limits import PlotLimits +from .plot_config import PlotConfig +from .plot_context import PlotContext +from .plot_config_history import PlotConfigHistory +from .plot_config_factory import PlotConfigFactory + +__all__ = [ + "PlotConfig", + "PlotConfigFactory", + "PlotConfigHistory", + "PlotContext", + "PlotLimits", + "PlotStyle", +] diff --git a/src/ert/gui/plottery/plot_config.py b/src/ert/gui/tools/plot/plottery/plot_config.py similarity index 99% rename from src/ert/gui/plottery/plot_config.py rename to src/ert/gui/tools/plot/plottery/plot_config.py index d5023a867fe..52e1ad2d19b 100644 --- a/src/ert/gui/plottery/plot_config.py +++ b/src/ert/gui/tools/plot/plottery/plot_config.py @@ -4,7 +4,8 @@ from copy import copy from typing import Any, List, Optional, Tuple -from ert.gui.plottery import PlotLimits, PlotStyle +from .plot_limits import PlotLimits +from .plot_style import PlotStyle class PlotConfig: diff --git a/src/ert/gui/plottery/plot_config_factory.py b/src/ert/gui/tools/plot/plottery/plot_config_factory.py similarity index 96% rename from src/ert/gui/plottery/plot_config_factory.py rename to src/ert/gui/tools/plot/plottery/plot_config_factory.py index 34d988646c6..aace3989740 100644 --- a/src/ert/gui/plottery/plot_config_factory.py +++ b/src/ert/gui/tools/plot/plottery/plot_config_factory.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING -from ert.gui.plottery import PlotConfig +from .plot_config import PlotConfig if TYPE_CHECKING: from ert.gui.tools.plot.plot_api import PlotApiKeyDefinition diff --git a/src/ert/gui/plottery/plot_config_history.py b/src/ert/gui/tools/plot/plottery/plot_config_history.py similarity index 97% rename from src/ert/gui/plottery/plot_config_history.py rename to src/ert/gui/tools/plot/plottery/plot_config_history.py index 8680efe5323..e8346ad62b4 100644 --- a/src/ert/gui/plottery/plot_config_history.py +++ b/src/ert/gui/tools/plot/plottery/plot_config_history.py @@ -1,6 +1,6 @@ from typing import List -from ert.gui.plottery import PlotConfig +from .plot_config import PlotConfig class PlotConfigHistory: diff --git a/src/ert/gui/plottery/plot_context.py b/src/ert/gui/tools/plot/plottery/plot_context.py similarity index 98% rename from src/ert/gui/plottery/plot_context.py rename to src/ert/gui/tools/plot/plottery/plot_context.py index e92a2f47918..273eaeb4f69 100644 --- a/src/ert/gui/plottery/plot_context.py +++ b/src/ert/gui/tools/plot/plottery/plot_context.py @@ -5,9 +5,10 @@ if TYPE_CHECKING: from pandas import DataFrame - from ert.gui.plottery import PlotConfig from ert.gui.tools.plot.plot_api import EnsembleObject + from .plot_config import PlotConfig + class PlotContext: UNKNOWN_AXIS = None diff --git a/src/ert/gui/plottery/plot_limits.py b/src/ert/gui/tools/plot/plottery/plot_limits.py similarity index 100% rename from src/ert/gui/plottery/plot_limits.py rename to src/ert/gui/tools/plot/plottery/plot_limits.py diff --git a/src/ert/gui/plottery/plot_style.py b/src/ert/gui/tools/plot/plottery/plot_style.py similarity index 100% rename from src/ert/gui/plottery/plot_style.py rename to src/ert/gui/tools/plot/plottery/plot_style.py diff --git a/src/ert/gui/tools/plot/plottery/plots/__init__.py b/src/ert/gui/tools/plot/plottery/plots/__init__.py new file mode 100644 index 00000000000..c9b8b47d4f1 --- /dev/null +++ b/src/ert/gui/tools/plot/plottery/plots/__init__.py @@ -0,0 +1,17 @@ +from .cesp import CrossEnsembleStatisticsPlot +from .distribution import DistributionPlot +from .ensemble import EnsemblePlot +from .gaussian_kde import GaussianKDEPlot +from .histogram import HistogramPlot +from .statistics import StatisticsPlot +from .std_dev import StdDevPlot + +__all__ = [ + "CrossEnsembleStatisticsPlot", + "DistributionPlot", + "EnsemblePlot", + "GaussianKDEPlot", + "HistogramPlot", + "StatisticsPlot", + "StdDevPlot", +] diff --git a/src/ert/gui/plottery/plots/cesp.py b/src/ert/gui/tools/plot/plottery/plots/cesp.py similarity index 99% rename from src/ert/gui/plottery/plots/cesp.py rename to src/ert/gui/tools/plot/plottery/plots/cesp.py index bc673ea890d..b1d3317799f 100644 --- a/src/ert/gui/plottery/plots/cesp.py +++ b/src/ert/gui/tools/plot/plottery/plots/cesp.py @@ -17,7 +17,7 @@ from matplotlib.figure import Figure from pandas import DataFrame - from ert.gui.plottery import PlotConfig, PlotContext + from ert.gui.tools.plot.plottery import PlotConfig, PlotContext CcsData = TypedDict( diff --git a/src/ert/gui/plottery/plots/distribution.py b/src/ert/gui/tools/plot/plottery/plots/distribution.py similarity index 98% rename from src/ert/gui/plottery/plots/distribution.py rename to src/ert/gui/tools/plot/plottery/plots/distribution.py index 7eb46758f29..c106fdf02c9 100644 --- a/src/ert/gui/plottery/plots/distribution.py +++ b/src/ert/gui/tools/plot/plottery/plots/distribution.py @@ -14,7 +14,7 @@ from matplotlib.axes import Axes from matplotlib.figure import Figure - from ert.gui.plottery import PlotConfig, PlotContext + from ert.gui.tools.plot.plottery import PlotConfig, PlotContext class DistributionPlot: diff --git a/src/ert/gui/plottery/plots/ensemble.py b/src/ert/gui/tools/plot/plottery/plots/ensemble.py similarity index 96% rename from src/ert/gui/plottery/plots/ensemble.py rename to src/ert/gui/tools/plot/plottery/plots/ensemble.py index d14786b9d8c..5b0a7b1a07f 100644 --- a/src/ert/gui/plottery/plots/ensemble.py +++ b/src/ert/gui/tools/plot/plottery/plots/ensemble.py @@ -5,9 +5,9 @@ import numpy as np import pandas as pd -from ert.gui.plottery.plots.history import plotHistory from ert.summary_key_type import is_rate +from .history import plotHistory from .observations import plotObservations from .plot_tools import PlotTools @@ -16,8 +16,8 @@ from matplotlib.axes import Axes from matplotlib.figure import Figure - from ert.gui.plottery import PlotConfig, PlotContext from ert.gui.tools.plot.plot_api import EnsembleObject + from ert.gui.tools.plot.plottery import PlotConfig, PlotContext class EnsemblePlot: diff --git a/src/ert/gui/plottery/plots/gaussian_kde.py b/src/ert/gui/tools/plot/plottery/plots/gaussian_kde.py similarity index 97% rename from src/ert/gui/plottery/plots/gaussian_kde.py rename to src/ert/gui/tools/plot/plottery/plots/gaussian_kde.py index 79e701771c2..230bfef51b2 100644 --- a/src/ert/gui/plottery/plots/gaussian_kde.py +++ b/src/ert/gui/tools/plot/plottery/plots/gaussian_kde.py @@ -15,7 +15,7 @@ from matplotlib.axes import Axes from matplotlib.figure import Figure - from ert.gui.plottery import PlotConfig, PlotContext + from ert.gui.tools.plot.plottery import PlotConfig, PlotContext class GaussianKDEPlot: diff --git a/src/ert/gui/plottery/plots/histogram.py b/src/ert/gui/tools/plot/plottery/plots/histogram.py similarity index 99% rename from src/ert/gui/plottery/plots/histogram.py rename to src/ert/gui/tools/plot/plottery/plots/histogram.py index 4a6797c535a..0eaa504c69f 100644 --- a/src/ert/gui/plottery/plots/histogram.py +++ b/src/ert/gui/tools/plot/plottery/plots/histogram.py @@ -16,7 +16,7 @@ from matplotlib.axes import Axes from matplotlib.figure import Figure - from ert.gui.plottery import PlotContext, PlotStyle + from ert.gui.tools.plot.plottery import PlotContext, PlotStyle class HistogramPlot: diff --git a/src/ert/gui/plottery/plots/history.py b/src/ert/gui/tools/plot/plottery/plots/history.py similarity index 93% rename from src/ert/gui/plottery/plots/history.py rename to src/ert/gui/tools/plot/plottery/plots/history.py index ff141e9b57f..dc75edc29db 100644 --- a/src/ert/gui/plottery/plots/history.py +++ b/src/ert/gui/tools/plot/plottery/plots/history.py @@ -3,7 +3,7 @@ if TYPE_CHECKING: from matplotlib.axes import Axes - from ert.gui.plottery import PlotContext + from ert.gui.tools.plot.plottery import PlotContext def plotHistory(plot_context: "PlotContext", axes: "Axes") -> None: diff --git a/src/ert/gui/plottery/plots/observations.py b/src/ert/gui/tools/plot/plottery/plots/observations.py similarity index 96% rename from src/ert/gui/plottery/plots/observations.py rename to src/ert/gui/tools/plot/plottery/plots/observations.py index 9b81b8b0e85..74c08a81b36 100644 --- a/src/ert/gui/plottery/plots/observations.py +++ b/src/ert/gui/tools/plot/plottery/plots/observations.py @@ -7,7 +7,7 @@ from matplotlib.axes import Axes from pandas import DataFrame - from ert.gui.plottery import PlotConfig, PlotContext + from ert.gui.tools.plot.plottery import PlotConfig, PlotContext def plotObservations( diff --git a/src/ert/gui/plottery/plots/plot_tools.py b/src/ert/gui/tools/plot/plottery/plots/plot_tools.py similarity index 98% rename from src/ert/gui/plottery/plots/plot_tools.py rename to src/ert/gui/tools/plot/plottery/plots/plot_tools.py index 9ef2f883b0e..78cacda5afb 100644 --- a/src/ert/gui/plottery/plots/plot_tools.py +++ b/src/ert/gui/tools/plot/plottery/plots/plot_tools.py @@ -8,7 +8,7 @@ from matplotlib.axes import Axes from matplotlib.figure import Figure - from ert.gui.plottery import PlotContext + from ert.gui.tools.plot.plottery import PlotContext class PlotTools: diff --git a/src/ert/gui/plottery/plots/statistics.py b/src/ert/gui/tools/plot/plottery/plots/statistics.py similarity index 98% rename from src/ert/gui/plottery/plots/statistics.py rename to src/ert/gui/tools/plot/plottery/plots/statistics.py index 4117ef5c70a..450b0aeaafd 100644 --- a/src/ert/gui/plottery/plots/statistics.py +++ b/src/ert/gui/tools/plot/plottery/plots/statistics.py @@ -7,9 +7,9 @@ from matplotlib.patches import Rectangle from pandas import DataFrame -from ert.gui.plottery import PlotConfig, PlotContext, PlotStyle -from ert.gui.plottery.plots.history import plotHistory +from ert.gui.tools.plot.plottery import PlotConfig, PlotContext, PlotStyle +from .history import plotHistory from .observations import plotObservations from .plot_tools import PlotTools diff --git a/src/ert/gui/plottery/plots/std_dev.py b/src/ert/gui/tools/plot/plottery/plots/std_dev.py similarity index 95% rename from src/ert/gui/plottery/plots/std_dev.py rename to src/ert/gui/tools/plot/plottery/plots/std_dev.py index 4c6d55aa6f1..1c39f1e2233 100644 --- a/src/ert/gui/plottery/plots/std_dev.py +++ b/src/ert/gui/tools/plot/plottery/plots/std_dev.py @@ -1,4 +1,6 @@ -from typing import Any, Dict +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Dict import matplotlib.pyplot as plt import numpy as np @@ -7,8 +9,9 @@ from matplotlib.figure import Figure from mpl_toolkits.axes_grid1 import make_axes_locatable -from ert.gui.plottery import PlotContext -from ert.gui.tools.plot.plot_api import EnsembleObject +if TYPE_CHECKING: + from ert.gui.tools.plot.plot_api import EnsembleObject + from ert.gui.tools.plot.plottery import PlotContext class StdDevPlot: diff --git a/src/ert/gui/tools/plot/style_chooser.py b/src/ert/gui/tools/plot/style_chooser.py index 9a63c0f369d..4594a654355 100644 --- a/src/ert/gui/tools/plot/style_chooser.py +++ b/src/ert/gui/tools/plot/style_chooser.py @@ -9,7 +9,7 @@ QWidget, ) -from ert.gui.plottery import PlotStyle +from .plottery import PlotStyle STYLE_OFF = ("Off", None) STYLE_AREA = ("Area", "#") diff --git a/src/ert/gui/tools/plot/widgets/__init__.py b/src/ert/gui/tools/plot/widgets/__init__.py index 6397b6b9943..c4a1fa986e7 100644 --- a/src/ert/gui/tools/plot/widgets/__init__.py +++ b/src/ert/gui/tools/plot/widgets/__init__.py @@ -1,3 +1,5 @@ -from ert.gui.tools.plot.widgets.copy_style_to_dialog import CopyStyleToDialog +from .clearable_line_edit import ClearableLineEdit +from .copy_style_to_dialog import CopyStyleToDialog +from .custom_date_edit import CustomDateEdit -__all__ = ["CopyStyleToDialog"] +__all__ = ["ClearableLineEdit", "CopyStyleToDialog", "CustomDateEdit"] diff --git a/src/ert/gui/tools/plot/widgets/custom_date_edit.py b/src/ert/gui/tools/plot/widgets/custom_date_edit.py index ce32b54c016..5cf0ba19f86 100644 --- a/src/ert/gui/tools/plot/widgets/custom_date_edit.py +++ b/src/ert/gui/tools/plot/widgets/custom_date_edit.py @@ -12,7 +12,7 @@ QWidgetAction, ) -from ert.gui.tools.plot.widgets.clearable_line_edit import ClearableLineEdit +from .clearable_line_edit import ClearableLineEdit class CustomDateEdit(QWidget): diff --git a/tests/ert/unit_tests/gui/plottery/test_ensemble_plot.py b/tests/ert/unit_tests/gui/plottery/test_ensemble_plot.py index 758fb79234a..13617bd3238 100644 --- a/tests/ert/unit_tests/gui/plottery/test_ensemble_plot.py +++ b/tests/ert/unit_tests/gui/plottery/test_ensemble_plot.py @@ -4,9 +4,9 @@ import pytest from matplotlib.figure import Figure -from ert.gui.plottery import PlotConfig, PlotContext -from ert.gui.plottery.plots.ensemble import EnsemblePlot from ert.gui.tools.plot.plot_api import EnsembleObject +from ert.gui.tools.plot.plottery import PlotConfig, PlotContext +from ert.gui.tools.plot.plottery.plots import EnsemblePlot from ert.summary_key_type import is_rate @@ -30,7 +30,7 @@ def plot_context(request): def test_ensemble_plot_handles_rate(plot_context: PlotContext): figure = Figure() with patch( - "ert.gui.plottery.plots.ensemble.EnsemblePlot._plotLines" + "ert.gui.tools.plot.plottery.plots.ensemble.EnsemblePlot._plotLines" ) as mock_plotLines: EnsemblePlot().plot( figure, diff --git a/tests/ert/unit_tests/gui/plottery/test_histogram.py b/tests/ert/unit_tests/gui/plottery/test_histogram.py index 4a62717b070..1c886ae232e 100644 --- a/tests/ert/unit_tests/gui/plottery/test_histogram.py +++ b/tests/ert/unit_tests/gui/plottery/test_histogram.py @@ -4,9 +4,9 @@ import pytest from matplotlib.figure import Figure -from ert.gui.plottery import PlotConfig, PlotContext -from ert.gui.plottery.plots.histogram import HistogramPlot from ert.gui.tools.plot.plot_api import EnsembleObject +from ert.gui.tools.plot.plottery import PlotConfig, PlotContext +from ert.gui.tools.plot.plottery.plots import HistogramPlot @pytest.fixture( diff --git a/tests/ert/unit_tests/gui/plottery/test_plot_config_history.py b/tests/ert/unit_tests/gui/plottery/test_plot_config_history.py index 539b0711024..04e0d195d12 100644 --- a/tests/ert/unit_tests/gui/plottery/test_plot_config_history.py +++ b/tests/ert/unit_tests/gui/plottery/test_plot_config_history.py @@ -1,4 +1,4 @@ -from ert.gui.plottery import PlotConfig, PlotConfigHistory +from ert.gui.tools.plot.plottery import PlotConfig, PlotConfigHistory def test_plot_config_history(): diff --git a/tests/ert/unit_tests/gui/plottery/test_plot_limits.py b/tests/ert/unit_tests/gui/plottery/test_plot_limits.py index 35542e0cc24..36160ce151e 100644 --- a/tests/ert/unit_tests/gui/plottery/test_plot_limits.py +++ b/tests/ert/unit_tests/gui/plottery/test_plot_limits.py @@ -1,7 +1,7 @@ import datetime from copy import copy -from ert.gui.plottery import PlotLimits +from ert.gui.tools.plot.plottery import PlotLimits def test_plot_limits_construction(): diff --git a/tests/ert/unit_tests/gui/plottery/test_plot_style.py b/tests/ert/unit_tests/gui/plottery/test_plot_style.py index 4a0c33cb55c..177c0cb40ee 100644 --- a/tests/ert/unit_tests/gui/plottery/test_plot_style.py +++ b/tests/ert/unit_tests/gui/plottery/test_plot_style.py @@ -1,6 +1,6 @@ import datetime -from ert.gui.plottery import PlotConfig, PlotLimits, PlotStyle +from ert.gui.tools.plot.plottery import PlotConfig, PlotLimits, PlotStyle def test_plot_style_test_defaults(): diff --git a/tests/ert/unit_tests/gui/plottery/test_stddev_plot.py b/tests/ert/unit_tests/gui/plottery/test_stddev_plot.py index 27d09441208..df3d7fc9df5 100644 --- a/tests/ert/unit_tests/gui/plottery/test_stddev_plot.py +++ b/tests/ert/unit_tests/gui/plottery/test_stddev_plot.py @@ -5,9 +5,9 @@ import pytest from matplotlib.figure import Figure -from ert.gui.plottery import PlotConfig, PlotContext -from ert.gui.plottery.plots.std_dev import StdDevPlot from ert.gui.tools.plot.plot_api import EnsembleObject +from ert.gui.tools.plot.plottery import PlotConfig, PlotContext +from ert.gui.tools.plot.plottery.plots import StdDevPlot @pytest.fixture()