diff --git a/docs/getting_started/configuration/poly_new/guide.rst b/docs/getting_started/configuration/poly_new/guide.rst index 87d1e94fa1b..130e26d208d 100644 --- a/docs/getting_started/configuration/poly_new/guide.rst +++ b/docs/getting_started/configuration/poly_new/guide.rst @@ -256,43 +256,32 @@ Create a file named ``coeff_priors`` and add the following content: Each line of this file defines a parameter: -- The first part is the name of the parameter (e.g., ``COEFF_A``). +- The first part is the name of the parameter (e.g., ``a``). - The second part defines the type of distribution from which to sample the parameter. In this case, we're using a uniform distribution (``UNIFORM``). - The remaining parts describe the distribution's specific characteristics. For a uniform distribution, these are the lower and upper bounds. Different distributions will require different arguments. -Adding a template -***************** -Now, let's create a template that ERT can use to insert the sampled parameters. -Create a file called ``coeff.tmpl`` and add the following: - -.. include:: with_results/coeff.tmpl - :code: - -In this template, the placeholders, denoted by angle brackets (``<`` and ``>``), -will be substituted with the parameter values sampled from the distributions defined in the ``coeff_priors`` file. - -Configuring the parameter set and and corresponding template -************************************************************ +Configuring the parameter set +***************************** Now, you need to add the following line to the ``poly.ert`` config file: .. code-block:: shell - GEN_KW COEFFS coeff.tmpl coeffs.json coeff_priors + GEN_KW COEFFS coeff_priors This line uses the :ref:`GEN_KW ` keyword, which instructs ERT to generate parameters according to specified distributions. -The four required arguments for :ref:`GEN_KW ` are: +The two required arguments for :ref:`GEN_KW ` are: 1. **COEFFS**: The name assigned to the parameter set, serving as an identifier. - 2. **coeff.tmpl**: The template file you previously created, containing placeholders that correspond to the parameters. - 3. **coeffs.json**: The name of the output file where the populated template will be written. - 4. **coeff_priors**: The name of the file containing the defined priors. + 2. **coeff_priors**: The name of the file containing the defined priors. Reading Parameters in the Simulation Script ******************************************* -The simulation script must be modified to read the ``coeffs.json`` file, which is where ERT writes the sampled parameters. +The simulation script must be modified to read the parameters. ERT always outputs a file called ``parameters.json``, which +contains all the ``GEN_KW`` parameters. + Update ``poly_eval.py`` to the following: .. literalinclude:: with_results/poly_eval.py @@ -345,7 +334,7 @@ This ensures that you'll only see the new data in your results. 3. **Create Plot**: Once the simulations are complete, you have the option to press the "Create Plot" button either in the progress window or in the main window. This action will open the "Plotting" window. -4. **View Distributions**: In the "Plotting" window, you can now observe the distributions of the three different parameters you created: ``COEFFS:COEFF_A``, ``COEFFS:COEFF_B``, and ``COEFFS:COEFF_C``. +4. **View Distributions**: In the "Plotting" window, you can now observe the distributions of the three different parameters you created: ``COEFFS:a``, ``COEFFS:b``, and ``COEFFS:c``. These names are formatted with the parameter set name first, followed by a colon, and then the specific parameter name. You should see something similar to this: diff --git a/docs/getting_started/configuration/poly_new/with_observations/coeff.tmpl b/docs/getting_started/configuration/poly_new/with_observations/coeff.tmpl deleted file mode 100644 index e55ade502df..00000000000 --- a/docs/getting_started/configuration/poly_new/with_observations/coeff.tmpl +++ /dev/null @@ -1,5 +0,0 @@ -{ - "a": , - "b": , - "c": -} diff --git a/docs/getting_started/configuration/poly_new/with_observations/coeff_a.png b/docs/getting_started/configuration/poly_new/with_observations/coeff_a.png index 7680577b702..eb95a3d0aed 100644 Binary files a/docs/getting_started/configuration/poly_new/with_observations/coeff_a.png and b/docs/getting_started/configuration/poly_new/with_observations/coeff_a.png differ diff --git a/docs/getting_started/configuration/poly_new/with_observations/coeff_b.png b/docs/getting_started/configuration/poly_new/with_observations/coeff_b.png index f18091c1b3e..7e2133145f6 100644 Binary files a/docs/getting_started/configuration/poly_new/with_observations/coeff_b.png and b/docs/getting_started/configuration/poly_new/with_observations/coeff_b.png differ diff --git a/docs/getting_started/configuration/poly_new/with_observations/coeff_c.png b/docs/getting_started/configuration/poly_new/with_observations/coeff_c.png index 1f99be8e9c9..3f152cfd319 100644 Binary files a/docs/getting_started/configuration/poly_new/with_observations/coeff_c.png and b/docs/getting_started/configuration/poly_new/with_observations/coeff_c.png differ diff --git a/docs/getting_started/configuration/poly_new/with_observations/coeff_priors b/docs/getting_started/configuration/poly_new/with_observations/coeff_priors index ed3dc731012..32eac89cf81 100644 --- a/docs/getting_started/configuration/poly_new/with_observations/coeff_priors +++ b/docs/getting_started/configuration/poly_new/with_observations/coeff_priors @@ -1,3 +1,3 @@ -COEFF_A UNIFORM 0 1 -COEFF_B UNIFORM 0 2 -COEFF_C UNIFORM 0 5 +a UNIFORM 0 1 +b UNIFORM 0 2 +c UNIFORM 0 5 diff --git a/docs/getting_started/configuration/poly_new/with_observations/poly.ert b/docs/getting_started/configuration/poly_new/with_observations/poly.ert index 4ac14b971e0..4410816cf03 100644 --- a/docs/getting_started/configuration/poly_new/with_observations/poly.ert +++ b/docs/getting_started/configuration/poly_new/with_observations/poly.ert @@ -5,7 +5,7 @@ QUEUE_OPTION LOCAL MAX_RUNNING 50 RUNPATH poly_out/realization-/iter- -GEN_KW COEFFS coeff.tmpl coeffs.json coeff_priors +GEN_KW COEFFS coeff_priors GEN_DATA POLY_RES RESULT_FILE:poly.out OBS_CONFIG observations diff --git a/docs/getting_started/configuration/poly_new/with_observations/poly_eval.py b/docs/getting_started/configuration/poly_new/with_observations/poly_eval.py index 8530cb94324..d83c44c65ad 100755 --- a/docs/getting_started/configuration/poly_new/with_observations/poly_eval.py +++ b/docs/getting_started/configuration/poly_new/with_observations/poly_eval.py @@ -2,8 +2,8 @@ import json -with open("coeffs.json", encoding="utf-8") as f: - coeffs = json.load(f) +with open("parameters.json", encoding="utf-8") as f: + coeffs = json.load(f)["COEFFS"] def evaluate(coeffs, x): diff --git a/docs/getting_started/configuration/poly_new/with_observations/poly_final.ert b/docs/getting_started/configuration/poly_new/with_observations/poly_final.ert index 0a1dd473132..80625a83b9e 100644 --- a/docs/getting_started/configuration/poly_new/with_observations/poly_final.ert +++ b/docs/getting_started/configuration/poly_new/with_observations/poly_final.ert @@ -5,7 +5,7 @@ QUEUE_OPTION LOCAL MAX_RUNNING 50 RUNPATH poly_out/realization-/iter- -GEN_KW COEFFS coeff.tmpl coeffs.json coeff_priors +GEN_KW COEFFS coeff_priors GEN_DATA POLY_RES RESULT_FILE:poly.out diff --git a/docs/getting_started/configuration/poly_new/with_results/coeff.tmpl b/docs/getting_started/configuration/poly_new/with_results/coeff.tmpl deleted file mode 100644 index e55ade502df..00000000000 --- a/docs/getting_started/configuration/poly_new/with_results/coeff.tmpl +++ /dev/null @@ -1,5 +0,0 @@ -{ - "a": , - "b": , - "c": -} diff --git a/docs/getting_started/configuration/poly_new/with_results/coeff_priors b/docs/getting_started/configuration/poly_new/with_results/coeff_priors index ed3dc731012..32eac89cf81 100644 --- a/docs/getting_started/configuration/poly_new/with_results/coeff_priors +++ b/docs/getting_started/configuration/poly_new/with_results/coeff_priors @@ -1,3 +1,3 @@ -COEFF_A UNIFORM 0 1 -COEFF_B UNIFORM 0 2 -COEFF_C UNIFORM 0 5 +a UNIFORM 0 1 +b UNIFORM 0 2 +c UNIFORM 0 5 diff --git a/docs/getting_started/configuration/poly_new/with_results/poly.ert b/docs/getting_started/configuration/poly_new/with_results/poly.ert index ffb3de53a27..06ce3f14956 100644 --- a/docs/getting_started/configuration/poly_new/with_results/poly.ert +++ b/docs/getting_started/configuration/poly_new/with_results/poly.ert @@ -5,7 +5,7 @@ QUEUE_OPTION LOCAL MAX_RUNNING 50 RUNPATH poly_out/realization-/iter- -GEN_KW COEFFS coeff.tmpl coeffs.json coeff_priors +GEN_KW COEFFS coeff_priors GEN_DATA POLY_RES RESULT_FILE:poly.out diff --git a/docs/getting_started/configuration/poly_new/with_results/poly_eval.py b/docs/getting_started/configuration/poly_new/with_results/poly_eval.py index 8530cb94324..d83c44c65ad 100755 --- a/docs/getting_started/configuration/poly_new/with_results/poly_eval.py +++ b/docs/getting_started/configuration/poly_new/with_results/poly_eval.py @@ -2,8 +2,8 @@ import json -with open("coeffs.json", encoding="utf-8") as f: - coeffs = json.load(f) +with open("parameters.json", encoding="utf-8") as f: + coeffs = json.load(f)["COEFFS"] def evaluate(coeffs, x): diff --git a/test-data/poly_example/poly-ies.ert b/test-data/poly_example/poly-ies.ert index de5a1adb293..490a54ee46d 100644 --- a/test-data/poly_example/poly-ies.ert +++ b/test-data/poly_example/poly-ies.ert @@ -10,7 +10,7 @@ OBS_CONFIG observations NUM_REALIZATIONS 100 MIN_REALIZATIONS 1 -GEN_KW COEFFS coeff.tmpl coeffs.json coeff_priors +GEN_KW COEFFS coeff_priors GEN_DATA POLY_RES RESULT_FILE:poly.out INSTALL_JOB poly_eval POLY_EVAL