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

Delete get_ensemble_by_name from LocalStorage #8623

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

dafeda
Copy link
Contributor

@dafeda dafeda commented Sep 3, 2024

Ensemble names are only unique within a single experiment.

Breaking Change

@dafeda dafeda changed the title Commitin Delete get_ensemble_by_name from LocalStorage Sep 3, 2024
@dafeda dafeda self-assigned this Sep 3, 2024
@dafeda dafeda added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Sep 3, 2024
@dafeda dafeda force-pushed the delete_get_ensemble_by_name branch 2 times, most recently from 0ec3332 to fbc1e61 Compare September 3, 2024 13:04
@dafeda dafeda added release-notes:breaking-change Automatically categorise as breaking change in release notes and removed release-notes:maintenance Automatically categorise as maintenance change in release notes labels Sep 3, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.85%. Comparing base (e33136f) to head (17fe3b4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8623   +/-   ##
=======================================
  Coverage   90.84%   90.85%           
=======================================
  Files         339      339           
  Lines       20897    20894    -3     
=======================================
- Hits        18984    18983    -1     
+ Misses       1913     1911    -2     
Flag Coverage Δ
gui-tests 75.79% <100.00%> (+0.03%) ⬆️
integration-tests 53.80% <100.00%> (+0.03%) ⬆️
unit-tests 68.66% <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.

@dafeda dafeda marked this pull request as ready for review September 5, 2024 07:06
@DanSava
Copy link
Contributor

DanSava commented Sep 5, 2024

Are experiment names unique?

@dafeda
Copy link
Contributor Author

dafeda commented Sep 5, 2024

Are experiment names unique?

Yes they are. One reason why want this is that it makes it easier to read plots since we use experiment_name:ensemble_name.

@@ -314,6 +314,7 @@ def migrate_case(storage: Storage, path: Path, stack: ExitStack) -> None:
parameters=parameter_configs,
responses=response_configs,
observations=ert_config.observations,
name="migrate-case",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be made unique or is it ok for cases to be migrated (from blockfs in this case so maybe no that many) w/ the same experiment name? Logging statement above is
logger.info(f"Migrating case '{path.name}'")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Valid point, but this not change behavior as the current code does this when no name is specified:

name = datetime.today().strftime("%Y-%m-%d")

Will leave as is for now. OK?

@DanSava
Copy link
Contributor

DanSava commented Sep 5, 2024

Are experiment names unique?

Yes they are. One reason why want this is that it makes it easier to read plots since we use experiment_name:ensemble_name.

I could not find any logic in ERT that enforces the experiment name to be unique, but it might be that I did not look hard enough.

If the experiment name is unique and this is checked when a new experiment is created then to make Everest work with these changes we would need to update:

  • ert/src/ert/simulator/batch_simulator.py
experiment = storage.create_experiment(
    parameters=self.ert_config.ensemble_config.parameter_configuration,
    responses=self.ert_config.ensemble_config.response_configuration,
)

to

experiment = storage.create_experiment(
    parameters=self.ert_config.ensemble_config.parameter_configuration,
    responses=self.ert_config.ensemble_config.response_configuration,
    name=f"experiment_{case_name}"
)

Copy link
Contributor

@yngve-sk yngve-sk left a comment

Choose a reason for hiding this comment

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

Recommend double checking wrt uniqueness of experiment name in some edge cases, otherwise LGTM

@dafeda
Copy link
Contributor Author

dafeda commented Sep 5, 2024

Are experiment names unique?

Yes they are. One reason why want this is that it makes it easier to read plots since we use experiment_name:ensemble_name.

I could not find any logic in ERT that enforces the experiment name to be unique, but it might be that I did not look hard enough.

If the experiment name is unique and this is checked when a new experiment is created then to make Everest work with these changes we would need to update:

  • ert/src/ert/simulator/batch_simulator.py
experiment = storage.create_experiment(
    parameters=self.ert_config.ensemble_config.parameter_configuration,
    responses=self.ert_config.ensemble_config.response_configuration,
)

to

experiment = storage.create_experiment(
    parameters=self.ert_config.ensemble_config.parameter_configuration,
    responses=self.ert_config.ensemble_config.response_configuration,
    name=f"experiment_{case_name}"
)

You are right I think, the validation is only in the front-end. @larsevj is working on making sure it's not possible to create experiments with non-unique names I think.

@dafeda dafeda merged commit 63c6c9a into equinor:main Sep 5, 2024
33 of 35 checks passed
@dafeda dafeda deleted the delete_get_ensemble_by_name branch September 5, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:breaking-change Automatically categorise as breaking change in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants