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 reading designmatrix #8800

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

larsevj
Copy link
Contributor

@larsevj larsevj commented Sep 25, 2024

Issue
Resolves #8902

Supports reading excel files containing design matrix with ert parameters into pandas dataframes.

  • 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_reading_designmatrix branch 3 times, most recently from 6fe00b5 to 3165420 Compare September 26, 2024 13:09
@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch 2 times, most recently from 1d0ec6d to b45b9f6 Compare October 3, 2024 11:23
@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 96.29630% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.70%. Comparing base (fc6244f) to head (87fa0ff).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/ert/config/design_matrix.py 96.05% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8800      +/-   ##
==========================================
+ Coverage   91.65%   91.70%   +0.04%     
==========================================
  Files         343      343              
  Lines       21168    21231      +63     
==========================================
+ Hits        19402    19470      +68     
+ Misses       1766     1761       -5     
Flag Coverage Δ
cli-tests 39.78% <27.16%> (-0.05%) ⬇️
gui-tests 73.66% <27.16%> (-0.17%) ⬇️
performance-tests 50.32% <27.16%> (-0.08%) ⬇️
unit-tests 80.38% <96.29%> (+0.07%) ⬆️

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.

@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch from b45b9f6 to 92ddf3a Compare October 3, 2024 12:51
@larsevj
Copy link
Contributor Author

larsevj commented Oct 3, 2024

  • A lot of tests can probably be ported over from Semeio.

@jonathan-eq jonathan-eq self-requested a review October 4, 2024 10:12
@@ -90,6 +88,9 @@ def __post_init__(self) -> None:
)
self._validate()

def __contains__(self, item: str) -> bool:
return item in [v.name for v in self.transform_function_definitions]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can do this lazily?

Suggested change
return item in [v.name for v in self.transform_function_definitions]
return any(item in v.name for v in self.transform_function_definitions)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if that does the same thing, but will see if there is a better way for this?

@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch 3 times, most recently from 4dc66f7 to 7e0671a Compare October 8, 2024 09:05
@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch from 0e23365 to 6732ce9 Compare October 9, 2024 12:28
@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch from ce7cee8 to 010fe9f Compare October 9, 2024 14:59
@larsevj larsevj added release-notes:unreleased-feature-changes PR with changes to a feature which is not yet released. Not for introduction of new features! release-notes:new-feature Automatically categorise as new feature in release notes and removed release-notes:unreleased-feature-changes PR with changes to a feature which is not yet released. Not for introduction of new features! labels Oct 10, 2024
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.

Very nice PR @larsevj ! 🎉 🚀
Could you squash the commits since I think you can't really separate it to a clever chunks.

@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch 3 times, most recently from 19c1699 to 897a4a0 Compare October 10, 2024 14:40
@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch from 8d5cade to e5ad2c4 Compare October 10, 2024 15:41
- Adds functionality to the DesignMatrix dataclass for reading
design matrix excel files into pandas dataframes, akin to design2params
in semeio.
@larsevj larsevj force-pushed the add_support_for_reading_designmatrix branch from e5ad2c4 to 87fa0ff Compare October 10, 2024 15:51
@larsevj larsevj merged commit d1ac7cf into equinor:main Oct 10, 2024
56 checks passed
@larsevj larsevj deleted the add_support_for_reading_designmatrix branch October 10, 2024 22:05
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
None yet
Development

Successfully merging this pull request may close these issues.

Read excel sheets from DESIGN_MATRIX keyword
4 participants