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

Simplify LibresFacade by removing duplicated functionality #9376

Merged
merged 3 commits into from
Nov 29, 2024

Conversation

oyvindeide
Copy link
Collaborator

@oyvindeide oyvindeide commented Nov 28, 2024

Cleaning some code only used in tests

  • 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

@oyvindeide oyvindeide added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Nov 28, 2024
@oyvindeide oyvindeide self-assigned this Nov 28, 2024
Copy link
Contributor

@DanSava DanSava 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 🦾

@@ -122,10 +122,10 @@ def from_config_dict(cls, config_dict: ConfigDict) -> Optional[Self]:
def read_from_file(self, run_path: str, iens: int, iter: int) -> polars.DataFrame:
def _read_file(filename: Path, report_step: int) -> polars.DataFrame:
try:
data = np.loadtxt(_run_path / filename, ndmin=1)
data = np.loadtxt(filename, ndmin=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ I also stumbled on this while working on something unrelated, and forgot to follow up with more investigation on why it was so strange. I am glad to see it fixed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it works because adding two abs path together ignores the shared parents, I did not know that, and once I started using _run_path as a relative path in the tests, it stopped working

@oyvindeide oyvindeide merged commit a99ed16 into equinor:main Nov 29, 2024
40 checks passed
@oyvindeide oyvindeide deleted the fix_run_path_duplication branch November 29, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants