Skip to content

Clean up /plot-folder#13600

Open
eilskra wants to merge 1 commit into
equinor:mainfrom
eilskra:clean-up-plot-folder
Open

Clean up /plot-folder#13600
eilskra wants to merge 1 commit into
equinor:mainfrom
eilskra:clean-up-plot-folder

Conversation

@eilskra
Copy link
Copy Markdown
Contributor

@eilskra eilskra commented May 20, 2026

Issue
Resolves #13588

Approach
🧑‍💻 ➕🤕➕🔨

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'just rapid-tests')

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.68%. Comparing base (147ffb5) to head (086b3ad).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
cli-tests 35.97% <0.00%> (+0.15%) ⬆️
fuzz 43.90% <100.00%> (+0.04%) ⬆️
gui-tests 59.88% <100.00%> (+0.02%) ⬆️
performance-and-unit-tests 78.18% <100.00%> (+0.02%) ⬆️
test 45.50% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ert/gui/tools/plot/customize/customization_view.py 87.77% <ø> (ø)
.../gui/tools/plot/customize/customize_plot_dialog.py 81.11% <100.00%> (ø)
...tools/plot/customize/default_customization_view.py 81.63% <ø> (ø)
.../tools/plot/customize/limits_customization_view.py 79.32% <100.00%> (ø)
...ls/plot/customize/statistics_customization_view.py 56.98% <ø> (ø)
src/ert/gui/tools/plot/customize/style_chooser.py 95.04% <100.00%> (ø)
...i/tools/plot/customize/style_customization_view.py 88.88% <ø> (ø)
src/ert/gui/tools/plot/ert_plots/__init__.py 100.00% <100.00%> (ø)
src/ert/gui/tools/plot/ert_plots/cesp.py 60.12% <100.00%> (ø)
src/ert/gui/tools/plot/ert_plots/distribution.py 85.18% <100.00%> (ø)
... and 30 more

... and 7 files with indirect coverage changes

@eilskra eilskra force-pushed the clean-up-plot-folder branch from 80ffb76 to 086b3ad Compare May 21, 2026 06:22
@berland
Copy link
Copy Markdown
Contributor

berland commented May 21, 2026

Missing checkboxes in the first PR comment.

@eilskra eilskra added the release-notes:refactor PR changes code without changing ANY (!) behavior. label May 21, 2026
@berland berland requested a review from Copilot May 21, 2026 07:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/, and shared_plots/, and moved config/context/style helpers into utils/.
  • Introduced models/ and widgets/ 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.

Comment on lines +4 to +7
from .data_type_keys_widget import DataTypeKeysWidget
from .filter_popup import FilterPopup
from .plot_ensemble_selection_widget import EnsembleSelectionWidget
from .plot_widget import PlotWidget
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eilskra this is probably new for this PR, but it might not affect runtime in practice (?) Could tests become slower?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we are hit with the potential downside described here, we can value consistency more (thus keep the changes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes:refactor PR changes code without changing ANY (!) behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restructure/clean-up src/ert/gui/tools/plot/.

4 participants