Clean up /plot-folder#13600
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13600 +/- ##
==========================================
+ Coverage 89.67% 89.68% +0.01%
==========================================
Files 461 464 +3
Lines 32605 32635 +30
==========================================
+ Hits 29239 29270 +31
+ Misses 3366 3365 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
80ffb76 to
086b3ad
Compare
|
Missing checkboxes in the first PR comment. |
There was a problem hiding this comment.
Pull request overview
This PR restructures the ERT GUI plotting tool package (src/ert/gui/tools/plot) by splitting the former mixed plottery layout into clearer subpackages (ert_plots, everest_plots, shared_plots, utils, widgets, models) and updates imports throughout the GUI and test suite accordingly.
Changes:
- Moved plot implementations into
ert_plots/,everest_plots/, andshared_plots/, and moved config/context/style helpers intoutils/. - Introduced
models/andwidgets/subpackages and updated GUI code to import from the new locations. - Updated unit/UI tests and internal modules to use the new import paths.
Reviewed changes
Copilot reviewed 47 out of 55 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/ert/unit_tests/gui/tools/plot/test_plot_window.py | Updates imports/monkeypatch paths to new widgets/, models/, and utils/ locations. |
| tests/ert/unit_tests/gui/plottery/test_stddev_plot.py | Switches plot import to ert_plots and config/context to utils. |
| tests/ert/unit_tests/gui/plottery/test_plot_style.py | Switches style/config imports to utils and plot tools import to utils.plot_tools. |
| tests/ert/unit_tests/gui/plottery/test_plot_limits.py | Switches PlotLimits import to utils. |
| tests/ert/unit_tests/gui/plottery/test_plot_config_history.py | Switches PlotConfig/PlotConfigHistory import to utils. |
| tests/ert/unit_tests/gui/plottery/test_misfits_plot.py | Switches MisfitsPlot import to ert_plots and config/context to utils. |
| tests/ert/unit_tests/gui/plottery/test_histogram.py | Switches HistogramPlot import to ert_plots and updates monkeypatch target module path. |
| tests/ert/unit_tests/gui/plottery/test_ensemble_plot.py | Switches EnsemblePlot to shared_plots, widgets to widgets/, and config/context to utils. |
| tests/ert/unit_tests/gui/ertwidgets/test_plot_case_selection_widget.py | Updates widget import path to widgets/. |
| tests/ert/unit_tests/config/test_observations.py | Updates observation plotting import to ert_plots and PlotConfig import to utils. |
| tests/ert/ui_tests/gui/test_rft_visualizations.py | Updates widget imports to widgets/. |
| tests/ert/ui_tests/gui/test_plotting_of_snake_oil.py | Updates widget imports to widgets/. |
| tests/ert/ui_tests/gui/test_main_window.py | Updates widget imports to widgets/. |
| tests/ert/ui_tests/gui/test_docs_screenshots.py | Updates widget imports to widgets/. |
| tests/ert/ui_tests/gui/test_breakthrough_visualization.py | Updates widget import to widgets/. |
| src/ert/gui/tools/plot/widgets/plot_widget.py | Updates type-checking imports and plot/context references to new packages. |
| src/ert/gui/tools/plot/widgets/plot_ensemble_selection_widget.py | Switches to absolute import for EnsembleObject. |
| src/ert/gui/tools/plot/widgets/data_type_keys_widget.py | Updates imports to new models/ and local widget module layout. |
| src/ert/gui/tools/plot/widgets/init.py | Expands exports to include key plot widgets. |
| src/ert/gui/tools/plot/utils/plot_tools.py | Updates PlotType/PlotContext imports to new utils location. |
| src/ert/gui/tools/plot/utils/plot_style.py | Introduces PlotStyle implementation under utils/. |
| src/ert/gui/tools/plot/utils/plot_limits.py | Introduces PlotLimits dataclass under utils/. |
| src/ert/gui/tools/plot/utils/plot_context.py | Introduces PlotContext and PlotType under utils/. |
| src/ert/gui/tools/plot/utils/plot_config.py | Introduces PlotConfig under utils/. |
| src/ert/gui/tools/plot/utils/plot_config_history.py | Introduces PlotConfigHistory under utils/. |
| src/ert/gui/tools/plot/utils/plot_config_factory.py | Introduces PlotConfigFactory under utils/. |
| src/ert/gui/tools/plot/utils/init.py | Adds utils package exports and registers matplotlib converters on import. |
| src/ert/gui/tools/plot/shared_plots/ensemble.py | Moves shared ensemble plotting to shared_plots/ and updates imports. |
| src/ert/gui/tools/plot/shared_plots/init.py | Exposes EnsemblePlot from shared_plots. |
| src/ert/gui/tools/plot/plot_window.py | Rewires plot/window composition to use new plot packages, widgets, and utils. |
| src/ert/gui/tools/plot/models/data_type_proxy_model.py | Introduces DataTypeProxyModel under models/. |
| src/ert/gui/tools/plot/models/data_type_keys_list_model.py | Updates PlotApiKeyDefinition import to new absolute module path. |
| src/ert/gui/tools/plot/everest_plots/everest_objective_function_plot.py | Updates PlotTools/PlotContext imports to utils. |
| src/ert/gui/tools/plot/everest_plots/everest_gradients_plot.py | Updates PlotType/PlotTools/PlotContext imports to utils. |
| src/ert/gui/tools/plot/everest_plots/everest_controls_plot.py | Updates PlotTools/PlotContext imports to utils. |
| src/ert/gui/tools/plot/everest_plots/everest_constraints_plot.py | Updates PlotTools/PlotContext imports to utils. |
| src/ert/gui/tools/plot/everest_plots/everest_batch_objective_function_plot.py | Updates PlotTools/PlotContext imports to utils. |
| src/ert/gui/tools/plot/everest_plots/init.py | Narrows exports to only Everest plot types. |
| src/ert/gui/tools/plot/ert_plots/std_dev.py | Updates PlotContext import to utils. |
| src/ert/gui/tools/plot/ert_plots/statistics.py | Moves PlotTools import to utils and config/context/style to utils. |
| src/ert/gui/tools/plot/ert_plots/observations.py | Updates PlotConfig/PlotContext imports to utils. |
| src/ert/gui/tools/plot/ert_plots/misfits.py | Updates PlotContext import to utils. |
| src/ert/gui/tools/plot/ert_plots/history.py | Updates PlotContext import to utils. |
| src/ert/gui/tools/plot/ert_plots/histogram.py | Moves PlotTools import to utils and PlotContext/PlotStyle to utils. |
| src/ert/gui/tools/plot/ert_plots/gaussian_kde.py | Moves PlotTools import to utils and PlotConfig/PlotContext to utils. |
| src/ert/gui/tools/plot/ert_plots/distribution.py | Moves PlotTools import to utils and PlotConfig/PlotContext to utils. |
| src/ert/gui/tools/plot/ert_plots/cesp.py | Moves PlotTools import to utils and PlotConfig/PlotContext to utils. |
| src/ert/gui/tools/plot/ert_plots/init.py | Introduces ert_plots public export surface. |
| src/ert/gui/tools/plot/customize/style_customization_view.py | Updates PlotConfig type-checking import to utils. |
| src/ert/gui/tools/plot/customize/style_chooser.py | Updates PlotStyle import to utils. |
| src/ert/gui/tools/plot/customize/statistics_customization_view.py | Updates PlotConfig type-checking import to utils. |
| src/ert/gui/tools/plot/customize/limits_customization_view.py | Updates PlotContext/PlotLimits/PlotConfig imports to utils. |
| src/ert/gui/tools/plot/customize/default_customization_view.py | Updates PlotConfig type-checking import to utils. |
| src/ert/gui/tools/plot/customize/customize_plot_dialog.py | Updates PlotConfig-related imports to utils. |
| src/ert/gui/tools/plot/customize/customization_view.py | Updates PlotConfig type-checking import to utils. |
| from .data_type_keys_widget import DataTypeKeysWidget | ||
| from .filter_popup import FilterPopup | ||
| from .plot_ensemble_selection_widget import EnsembleSelectionWidget | ||
| from .plot_widget import PlotWidget |
There was a problem hiding this comment.
@eilskra this is probably new for this PR, but it might not affect runtime in practice (?) Could tests become slower?
There was a problem hiding this comment.
@berland correct, previously PlotWidget and EnsembleSelectionWidget were stored under tools/plot/ with no init in the corresponding __init__-file (file was empty). I guess we could omit them from this __init_ too?
There was a problem hiding this comment.
Unless we are hit with the potential downside described here, we can value consistency more (thus keep the changes)
Issue
Resolves #13588
Approach
🧑💻 ➕🤕➕🔨
git rebase -i main --exec 'just rapid-tests')