Skip to content

Conversation

@MathiasMNilsen
Copy link
Contributor

No description provided.

@KriFos1 KriFos1 requested a review from Copilot January 16, 2026 12:25
Copy link
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 refactors the ensemble-matrix data structure across the codebase, transitioning from dictionary-based state representations to numpy array-based ensemble matrices. The changes improve performance and code clarity while maintaining functionality.

Changes:

  • Replaced dictionary-based state variables with numpy array ensemble matrices (enX)
  • Updated the toggle_ml_state function to work with matrices instead of dictionaries
  • Modified logging infrastructure to use a custom PetLogger class with formatted table output
  • Refactored update schemes to accept ensemble matrices directly

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_toggle_ml_state.py Added comprehensive test suite for the refactored toggle_ml_state function
popt/update_schemes/subroutines/subroutines.py Enhanced line search logging with formatted output and condition tracking
popt/update_schemes/linesearch.py Updated to use new logger format and corrected logical condition bug
popt/misc_tools/optim_tools.py Refactored toggle_ml_state to work with matrices; fixed variable name typo
popt/loop/optimize.py Integrated new PetLogger and updated state variable handling
popt/loop/ensemble_generalized.py Updated to use matrix-based state representation
popt/loop/ensemble_gaussian.py Major refactoring to use ensemble matrices instead of dictionaries
popt/loop/ensemble_base.py Core refactoring to matrix-based ensemble representation
popt/cost_functions/npv.py Removed extraneous blank line
pipt/update_schemes/update_methods_ns/subspace_update.py Updated to accept ensemble matrices as function parameters
pipt/update_schemes/update_methods_ns/hybrid_update.py Refactored to work with ensemble matrices
pipt/update_schemes/update_methods_ns/full_update.py Updated update method signature and implementation
pipt/update_schemes/update_methods_ns/approx_update.py Comprehensive refactoring for matrix-based updates
pipt/update_schemes/multilevel.py Significant cleanup and refactoring for multilevel ensemble handling
pipt/update_schemes/esmda.py Updated to use ensemble matrices and new logging
pipt/update_schemes/es.py Updated state variable handling
pipt/update_schemes/enrml.py Refactored for matrix-based ensembles
pipt/update_schemes/enkf.py Updated to work with ensemble matrices
pipt/misc_tools/extract_tools.py Fixed typo and added new extraction functions
pipt/misc_tools/ensemble_tools.py New module with ensemble matrix manipulation utilities
pipt/misc_tools/analysis_tools.py Added helper functions and updated existing ones
pipt/loop/ensemble.py Major refactoring to use PetLogger and ensemble matrices
pipt/loop/assimilation.py Updated to work with new ensemble matrix structure
misc/ecl.py Commented out logging statements
input_output/read_config.py Enhanced configuration reading with new formats
ensemble/logger.py New custom logger class with table formatting
ensemble/ensemble.py Core refactoring for matrix-based ensemble handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rolfjl rolfjl merged commit 70a5984 into Python-Ensemble-Toolbox:main Jan 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants