Changes to ensemble-matrix#123
Merged
rolfjl merged 107 commits intoPython-Ensemble-Toolbox:mainfrom Jan 16, 2026
Merged
Conversation
Merge branch 'main' of https://github.com/MathiasMNilsen/PET
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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_statefunction to work with matrices instead of dictionaries - Modified logging infrastructure to use a custom
PetLoggerclass 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
approved these changes
Jan 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.