Skip to content

Commit

Permalink
Small clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanDeHoop committed Dec 17, 2024
1 parent f178e65 commit 27f6d41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
12 changes: 0 additions & 12 deletions tests/everest/test_cvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from ert.run_models.everest_run_model import EverestRunModel
from everest.config import (
ControlConfig,
CVaRConfig,
EverestConfig,
ModelConfig,
Expand All @@ -16,17 +15,6 @@ def test_mathfunc_cvar(
):
# Arrange
config = EverestConfig.load_file("config_minimal.yml")
config.controls = [
ControlConfig(
name="point",
type="generic_control",
min=-2.0,
max=2.0,
initial_guess=0.0,
perturbation_magnitude=0.01,
variables=[{"name": "x"}, {"name": "y"}, {"name": "z"}],
)
]
config.optimization = OptimizationConfig(
backend="scipy",
algorithm="slsqp",
Expand Down
7 changes: 3 additions & 4 deletions tests/everest/test_math_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

CONFIG_FILE_MULTIOBJ = "config_multiobj.yml"
CONFIG_FILE_ADVANCED = "config_advanced.yml"
CONFIG_FILE_REMOVE_RUN_PATH = "config_remove_run_path.yml"


@pytest.mark.integration_test
Expand Down Expand Up @@ -186,7 +185,6 @@ def test_math_func_advanced(
def test_remove_run_path(
copy_math_func_test_data_to_tmp, evaluator_server_config_generator
):
# config = EverestConfig.load_file(CONFIG_FILE_REMOVE_RUN_PATH)
with open("config_minimal.yml", encoding="utf-8") as file:
config_yaml = yaml.safe_load(file)
config_yaml["simulator"] = {"delete_run_path": True}
Expand Down Expand Up @@ -248,12 +246,13 @@ def test_math_func_auto_scaled_controls(
config = EverestConfig.load_file("config_minimal.yml")
config.controls[0].auto_scale = True
config.controls[0].scaled_range = [0.3, 0.7]
config.controls[0].initial_guess = 0.2
config.input_constraints = [
InputConstraintConfig(weights={"point.x": 1.0, "point.y": 1.0}, upper_bound=0.5)
]
config.optimization.max_batch_num = 10
config.forward_model[0] += " --scaling -1 1 0.3 0.7"
# Convergence is slower that's why more batches and start closer to final solution?
config.controls[0].initial_guess = 0.2
config.optimization.max_batch_num = 10

# Act
run_model = EverestRunModel.create(config)
Expand Down

0 comments on commit 27f6d41

Please sign in to comment.