Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for design matrix keyword in ert config #8803

Merged

Conversation

larsevj
Copy link
Contributor

@larsevj larsevj commented Sep 26, 2024

Issue
Resolves #8689

Adds the new keyword DESIGN_MATRIX to ert config. Intended to be used to read a design_matrix excel file for sensitivity analysis in the future.

No documentation, will probably be better to write this after it is fully functional.

  • 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 'pytest tests/ert/unit_tests -n logical -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@larsevj larsevj force-pushed the add_support_for_design_matrix_keyword branch from 7cb27a8 to 7da32b3 Compare September 26, 2024 13:17
@larsevj larsevj force-pushed the add_support_for_design_matrix_keyword branch from 7da32b3 to f29e219 Compare September 27, 2024 18:16
@larsevj
Copy link
Contributor Author

larsevj commented Sep 27, 2024

Wondering if I should separate the dataclass DesignMatrixArgs into its own file, maybe rename to DesignMatrix and then the read into dataframe functionality could be part of that class?

@xjules
Copy link
Contributor

xjules commented Sep 30, 2024

Wondering if I should separate the dataclass DesignMatrixArgs into its own file, maybe rename to DesignMatrix and then the read into dataframe functionality could be part of that class?

I was actually thinking the same :) Let's move it to a standalone file 👍

def test_invalid_design_matrix_format_raises_validation_error():
with pytest.raises(
ConfigValidationError,
match="DESIGN_MATRIX must be of format .xls or .xslx; is 'my_matrix.txt'",
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be updated:

tests/ert/unit_tests/config/test_analysis_config.py::test_invalid_design_matrix_format_raises_validation_error - AssertionError: Regex pattern did not match.
 Regex: "DESIGN_MATRIX must be of format .xls or .xslx; is 'my_matrix.txt'"
 Input: 'DESIGN_MATRIX must be of format .xls or .xslx; is my_matrix.txt'

@larsevj larsevj marked this pull request as ready for review September 30, 2024 10:06
@larsevj larsevj force-pushed the add_support_for_design_matrix_keyword branch from f29e219 to 138faf4 Compare September 30, 2024 10:13
@larsevj larsevj added the release-notes:new-feature Automatically categorise as new feature in release notes label Sep 30, 2024
@larsevj larsevj requested a review from xjules September 30, 2024 10:49
@larsevj larsevj force-pushed the add_support_for_design_matrix_keyword branch 2 times, most recently from 6ccd250 to d3fbff2 Compare September 30, 2024 14:20
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.38%. Comparing base (e607feb) to head (d3fbff2).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8803      +/-   ##
==========================================
+ Coverage   91.31%   91.38%   +0.07%     
==========================================
  Files         342      343       +1     
  Lines       21028    21063      +35     
==========================================
+ Hits        19202    19249      +47     
+ Misses       1826     1814      -12     
Flag Coverage Δ
cli-tests 39.62% <54.28%> (-0.02%) ⬇️
gui-tests 73.54% <54.28%> (+0.09%) ⬆️
performance-tests 50.06% <54.28%> (+<0.01%) ⬆️
unit-tests 79.86% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@xjules xjules left a comment

Choose a reason for hiding this comment

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

Nice @larsevj ! Could you squash the commits before you hit merge? 🚀

@larsevj larsevj force-pushed the add_support_for_design_matrix_keyword branch from d3fbff2 to aee9f51 Compare October 1, 2024 10:04
@larsevj larsevj enabled auto-merge (rebase) October 1, 2024 10:25
- Expects the format:
DESIGN_MATRIX file.xlsx DESIGN_SHEET:design DEFAULT_SHEET:default
where file.xlsx is an existing file.
- Scaffolding for further support for reading parameter values from
design matrix excel files.
@larsevj larsevj force-pushed the add_support_for_design_matrix_keyword branch from aee9f51 to ae264ca Compare October 2, 2024 08:07
@larsevj larsevj merged commit 18017c7 into equinor:main Oct 2, 2024
49 checks passed
@larsevj larsevj deleted the add_support_for_design_matrix_keyword branch October 2, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:new-feature Automatically categorise as new feature in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement support for DESIGN_MATRIX keyword
3 participants