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

Fix datafiles #98

Merged
merged 17 commits into from
Oct 17, 2024
Merged

Fix datafiles #98

merged 17 commits into from
Oct 17, 2024

Conversation

kjetilbjorke
Copy link
Contributor

@kjetilbjorke kjetilbjorke commented Sep 24, 2024

Currently sim2sumo finds all paths to datafiles with valid filetypes .DATA, .afi and .in. However only the stem name are used as table name (and not the subfolders). Hence if two datafiles has same stem the random first one will be chosen, not taking into account the seedpoint (or datafile:) given in the config file. This does not fix that, but it does at least prioritize the .DATA file over .afi and .afi over .in making the results consistent over an ensemble. This tries to fix that 😅

@equinor-ruaj
Copy link
Contributor

Tests are failing (seemingly) due to the "from" branch being on a fork.
Could you remake the PR on a branch directly from this repo?

@equinor-ruaj equinor-ruaj marked this pull request as ready for review October 10, 2024 12:09
This was referenced Oct 10, 2024
@equinor-ruaj
Copy link
Contributor

The tests should also be updated to match the code changes.
In tests/test_functions.py:

  • Completely remove the test test_find_datafiles_no_seedpoint(tmp_path) - The function that is tested has been removed.
  • Remove the import of find_datafiles_no_seedpoint at the top of the file - The function has been removed
  • In test_find_datafiles_reek() change datafiles = find_datafiles(None, {}) to datafiles = find_datafiles(None)
  • Update the test parameters to test_create_config_dict():
    • Should be
@pytest.mark.parametrize(
    "config,nrdatafiles,nrsubmodules",
    [
        ({}, 5, 4),
        (
            {
                "datafile": {
                    "3_R001_REEK": {"summary": {"column_keys": "F*P*"}}
                }
            },
            1,
            2,
        ),
        (
            {"datafile": {"3_R001_REEK": ["summary", "rft"]}},
            1,
            3,
        ),
        ({"datafile": ["3_R001_REEK", "OOGRE_PF.in"]}, 2, 4),
        ({"datafile": ["3_R001_REEK"]}, 1, 4),
        ({"datafile": ["3_R001_REEK-1.DATA"]}, 1, 4),
        ({"datafile": ["OOGRE_IX.afi"]}, 1, 4),
        ({"datafile": ["opm/model/OOGRE_OPM.DATA"]}, 1, 4),
        ({"grid3d": True}, 5, 4),
    ],
)

@kjetilbjorke
Copy link
Contributor Author

Tests updated as mentioned in 4132fcf.

Copy link
Contributor

@equinor-ruaj equinor-ruaj left a comment

Choose a reason for hiding this comment

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

lgtm

@equinor-ruaj equinor-ruaj merged commit bed4337 into equinor:main Oct 17, 2024
2 of 6 checks passed
@equinor-ruaj
Copy link
Contributor

Tests failing here due to failing Azure login since PR is from a fork.
Tests passing when running locally so merging should be OK.

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.

2 participants