fmu-pem 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/.gitignore +1 -0
  2. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/ERT/run_pem.ert +2 -1
  3. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/PKG-INFO +2 -1
  4. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/effective-pressure.md +1 -1
  5. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/ert-configuration.md +2 -1
  6. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/use-cases.md +12 -0
  7. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/package-lock.json +8 -6
  8. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/pyproject.toml +1 -0
  9. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/__init__.py +2 -0
  10. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/__main__.py +43 -6
  11. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/forward_models/pem_model.py +4 -1
  12. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/__init__.py +0 -2
  13. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/import_config.py +30 -22
  14. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/pem_config_validation.py +40 -40
  15. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/run_pem.py +6 -19
  16. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/version.py +2 -2
  17. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu_pem.egg-info/PKG-INFO +2 -1
  18. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu_pem.egg-info/SOURCES.txt +1 -1
  19. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu_pem.egg-info/requires.txt +1 -0
  20. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/ert/model/run_pem_condensate.ert +2 -1
  21. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/ert/model/run_pem_no_condensate.ert +2 -1
  22. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_config_file_validation.py +42 -2
  23. fmu_pem-0.0.4/tests/test_pem.py +105 -0
  24. fmu_pem-0.0.3/tests/test_pem.py +0 -45
  25. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/.github/workflows/build_test_deploy.yml +0 -0
  26. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/.pre-commit-config.yaml +0 -0
  27. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/LICENSE +0 -0
  28. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/README.md +0 -0
  29. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/SECURITY.md +0 -0
  30. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/.vitepress/config.mts +0 -0
  31. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/difference-properties.md +0 -0
  32. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/effective-mineral-properties.md +0 -0
  33. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/ert.tmLanguage.json +0 -0
  34. /fmu_pem-0.0.3/documentation/docs/fluid_properties.md → /fmu_pem-0.0.4/documentation/docs/fluid-properties.md +0 -0
  35. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/The-phase-transition-diagram-of-carbon-dioxide.png +0 -0
  36. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/brine_properties.png +0 -0
  37. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/brine_properties_complete.png +0 -0
  38. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/bulk_modulus_vs_brine_salinity.png +0 -0
  39. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/bulk_modulus_vs_quartz_fraction.png +0 -0
  40. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/co2_properties_complete.png +0 -0
  41. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/co2_properties_meshgrid.png +0 -0
  42. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/density_vs_brine_salinity.png +0 -0
  43. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/fluid_density_comparison.png +0 -0
  44. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/gas_properties_complete.png +0 -0
  45. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/isotope_analysis.png +0 -0
  46. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/oil_properties_complete.png +0 -0
  47. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/shear_modulus_vs_quartz_fraction.png +0 -0
  48. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/images/wood_brie.png +0 -0
  49. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/import-sim-results.md +0 -0
  50. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/index.md +0 -0
  51. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/mineral-properties.md +0 -0
  52. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/model-file-formats.md +0 -0
  53. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/pem-configuration.md +0 -0
  54. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/public/fmu_logo_dark_mode.svg +0 -0
  55. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/public/fmu_logo_light_mode.svg +0 -0
  56. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/saturated-rock.md +0 -0
  57. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/save-results.md +0 -0
  58. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/yaml-edit/YamlEdit.tsx +0 -0
  59. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/yaml-edit/schema.tsx +0 -0
  60. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/docs/yaml-validation.md +0 -0
  61. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/documentation/package.json +0 -0
  62. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/scripts/brie_test.ipynb +0 -0
  63. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/scripts/brine_properties.ipynb +0 -0
  64. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/scripts/co2_properties.ipynb +0 -0
  65. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/scripts/eff_min_props.ipynb +0 -0
  66. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/scripts/gas_properties.ipynb +0 -0
  67. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/scripts/oil_properties.ipynb +0 -0
  68. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/setup.cfg +0 -0
  69. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/__init__.py +0 -0
  70. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/forward_models/__init__.py +0 -0
  71. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/hook_implementations/__init__.py +0 -0
  72. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/hook_implementations/jobs.py +0 -0
  73. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/__init__.py +0 -0
  74. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/density.py +0 -0
  75. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/effective_pressure.py +0 -0
  76. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/estimate_saturated_rock.py +0 -0
  77. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/fluid_properties.py +0 -0
  78. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/mineral_properties.py +0 -0
  79. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/pressure_sensitivity.py +0 -0
  80. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/regression_models.py +0 -0
  81. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/run_friable_model.py +0 -0
  82. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/run_patchy_cement_model.py +0 -0
  83. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_functions/run_t_matrix_model.py +0 -0
  84. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/cumsum_properties.py +0 -0
  85. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/delta_cumsum_time.py +0 -0
  86. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/enum_defs.py +0 -0
  87. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/export_routines.py +0 -0
  88. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/fipnum_pvtnum_utilities.py +0 -0
  89. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/import_routines.py +0 -0
  90. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/pem_class_definitions.py +0 -0
  91. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/rpm_models.py +0 -0
  92. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/update_grid.py +0 -0
  93. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu/pem/pem_utilities/utils.py +0 -0
  94. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu_pem.egg-info/dependency_links.txt +0 -0
  95. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu_pem.egg-info/entry_points.txt +0 -0
  96. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/src/fmu_pem.egg-info/top_level.txt +0 -0
  97. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/__init__.py +0 -0
  98. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/conftest.py +0 -0
  99. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/fmuconfig/output/global_variables.yml +0 -0
  100. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/fmuconfig/output/global_variables_pred.yml +0 -0
  101. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/share/results/grids/eclipsegrid_pem.roff +0 -0
  102. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/ECLIPSE.EGRID +0 -0
  103. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/ECLIPSE.INIT +0 -0
  104. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/ECLIPSE.UNRST +0 -0
  105. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/export_grid.roff +0 -0
  106. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/export_prop.roff +0 -0
  107. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/simgrid--carbfraction.roff +0 -0
  108. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/simgrid--coalfraction.roff +0 -0
  109. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/input/pem/simgrid--vsh.roff +0 -0
  110. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/carbonate_pressure_model_vp_exp.pkl +0 -0
  111. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/carbonate_pressure_model_vs_exp.pkl +0 -0
  112. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/pem_config_condensate.yml +0 -0
  113. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/pem_config_condensate_multi.yml +0 -0
  114. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/pem_config_no_condensate.yml +0 -0
  115. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/t_mat_params_exp.pkl +0 -0
  116. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/t_mat_params_petec.pkl +0 -0
  117. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/vp_exp_model.pkl +0 -0
  118. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/data/sim2seis/model/vs_exp_model.pkl +0 -0
  119. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_density.py +0 -0
  120. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_ert_hooks.py +0 -0
  121. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_ert_hooks_condensate.py +0 -0
  122. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_fipnum_and_pvtnum.py +0 -0
  123. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_fipnum_pvtnum_utilities.py +0 -0
  124. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_fluids.py +0 -0
  125. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_friable.py +0 -0
  126. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_patchy_cement.py +0 -0
  127. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_pressure_sensitivity.py +0 -0
  128. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_regression.py +0 -0
  129. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_t_matrix.py +0 -0
  130. {fmu_pem-0.0.3 → fmu_pem-0.0.4}/tests/test_utils.py +0 -0
@@ -29,3 +29,4 @@ fmu-pem-schema.json
29
29
  /ERT/.runpath_list
30
30
  /logs/
31
31
  /tests/data/sim2seis/input/pem/venv_ext/
32
+ scripts/debug_lines.py
@@ -36,6 +36,7 @@ DEFINE <PEM_CONFIGDIR> <RUNPATH>/sim2seis/model
36
36
  DEFINE <PEM_CONFIG_FILE_NAME> new_pem_config.yml
37
37
  DEFINE <GLOBAL_PATH> ../../fmuconfig/output
38
38
  DEFINE <GLOBAL_CONFIG_FILE> global_variables.yml
39
+ DEFINE <MOD_PREFIX> HIST
39
40
 
40
41
  -- Run the PEM
41
- FORWARD_MODEL PEM(<CONFIG_DIR>=<PEM_CONFIGDIR>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_PATH>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>)
42
+ FORWARD_MODEL PEM(<CONFIG_DIR>=<PEM_CONFIGDIR>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_PATH>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>, <MOD_DATE_PREFIX>=<MOD_PREFIX>)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu-pem
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: pem
5
5
  License: GNU GENERAL PUBLIC LICENSE
6
6
  Version 3, 29 June 2007
@@ -695,6 +695,7 @@ Requires-Dist: xtgeo>=4.7.1
695
695
  Requires-Dist: fmu-tools
696
696
  Requires-Dist: fmu-config
697
697
  Requires-Dist: fmu-dataio
698
+ Requires-Dist: fmu-datamodels
698
699
  Requires-Dist: rock-physics-open>=0.3.3
699
700
  Requires-Dist: PyYAML>=6.0.1
700
701
  Requires-Dist: pydantic
@@ -12,7 +12,7 @@ provided by drilling or operational geology disciplines, and for most fields, it
12
12
  or in some cases one model per structure in the field. The relationship between overburden, formation and effective
13
13
  pressures is given as:
14
14
 
15
- $$P_{eff} = P_{ob} - \alpha \cdot P_f$$,
15
+ $$P_{eff} = P_{ob} - \alpha \cdot P_f$$
16
16
 
17
17
  where $\alpha$ is the formation factor, also known as the Biot coefficient.
18
18
 
@@ -9,9 +9,10 @@ DEFINE <PEM_CONFIG_FILE_NAME> pem_config.yml
9
9
  DEFINE <GLOBAL_CONFIG_DIR> ../../fmuconfig/output
10
10
  DEFINE <GLOBAL_CONFIG_FILE> global_variables.yml
11
11
  DEFINE <MODEL_PATH> /my_fmu_structure/sim2seis/model
12
+ DEFINE <MOD_PREFIX> HIST
12
13
 
13
14
  -- Run the pre-installed ERT forward model:
14
- FORWARD_MODEL PEM(<CONFIG_DIR>=<CONFIG_PATH>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_CONFIG_DIR>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>)
15
+ FORWARD_MODEL PEM(<CONFIG_DIR>=<CONFIG_PATH>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_CONFIG_DIR>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>, <MOD_DATE_PREFIX>=<MOD_PREFIX>)
15
16
  ````
16
17
 
17
18
  On the next page you will get help on setting up your `pem_config.yml`.
@@ -38,3 +38,15 @@ from the asset, it is highly likely that wrong assumptions are made. The main re
38
38
  | Production history | Reservoir Engineering, Production Engineering | Historical production data for model validation |
39
39
 
40
40
  <span id="table-1-discipline-topics"><strong>Table 1:</strong> Topics that should be coordinated between disciplines during PEM calibration.</span>
41
+
42
+ ## Command-line runs
43
+
44
+ PEM can be called from ERT, run as an external command in RMS, or run from command-line.
45
+ In all cases, there is a number of required call arguments that must be provided:
46
+
47
+ ```shell
48
+ > # Go to top of the project structure
49
+ > cd /project/fmu/tutorial/drogon/resmod/ff/users/hfle/dev
50
+ > # Call PEM, `--help` will show all call arguments
51
+ > pem --help
52
+ > pem -c ./sim2seis/model -f new_pem_config.yml -g ../../fmuconfig/output -o global_variables.yml -m ./sim2seis/model --mod-date-prefix HIST
@@ -3808,14 +3808,16 @@
3808
3808
  }
3809
3809
  },
3810
3810
  "node_modules/lodash": {
3811
- "version": "4.17.21",
3812
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
3813
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
3811
+ "version": "4.17.23",
3812
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
3813
+ "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
3814
+ "license": "MIT"
3814
3815
  },
3815
3816
  "node_modules/lodash-es": {
3816
- "version": "4.17.21",
3817
- "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
3818
- "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
3817
+ "version": "4.17.23",
3818
+ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.23.tgz",
3819
+ "integrity": "sha512-kVI48u3PZr38HdYz98UmfPnXl2DXrpdctLrFLCd3kOx1xUkOmpFPx7gCWWM5MPkL/fD8zb+Ph0QzjGFs4+hHWg==",
3820
+ "license": "MIT"
3819
3821
  },
3820
3822
  "node_modules/loose-envify": {
3821
3823
  "version": "1.4.0",
@@ -31,6 +31,7 @@ dependencies = [
31
31
  "fmu-tools",
32
32
  "fmu-config",
33
33
  "fmu-dataio",
34
+ "fmu-datamodels",
34
35
  "rock-physics-open >= 0.3.3",
35
36
  "PyYAML >=6.0.1",
36
37
  "pydantic",
@@ -11,9 +11,11 @@ except (ImportError, ModuleNotFoundError):
11
11
  else:
12
12
  INTERNAL_EQUINOR = True
13
13
 
14
+ from .__main__ import main as pem
14
15
  from .run_pem import pem_fcn
15
16
 
16
17
  __all__ = [
17
18
  "pem_fcn",
19
+ "pem",
18
20
  "INTERNAL_EQUINOR",
19
21
  ]
@@ -1,13 +1,17 @@
1
1
  # pylint: disable=missing-module-docstring
2
2
  import argparse
3
+ import sys
3
4
  from pathlib import Path
5
+ from typing import Any
4
6
  from warnings import warn
5
7
 
6
- from .pem_utilities import restore_dir
8
+ from .pem_utilities import get_global_params_and_dates, read_pem_config, restore_dir
7
9
  from .run_pem import pem_fcn
8
10
 
9
11
 
10
- def main():
12
+ def main(args_list=None):
13
+ if args_list is None:
14
+ args_list = sys.argv[1:]
11
15
  parser = argparse.ArgumentParser(__file__)
12
16
  parser.add_argument(
13
17
  "-c",
@@ -45,7 +49,29 @@ def main():
45
49
  help="For ERT run: Absolute directory name for model file, pre-experiment. Not "
46
50
  "needed for command line run",
47
51
  )
48
- args = parser.parse_args()
52
+ parser.add_argument(
53
+ "-q",
54
+ "--mod-date-prefix",
55
+ type=str,
56
+ required=True,
57
+ help="Global seismic section: Prefix for seismic dates for modelled data",
58
+ )
59
+ parser.add_argument(
60
+ "-r",
61
+ "--run-from-rms",
62
+ type=bool,
63
+ required=False,
64
+ default=False,
65
+ help="Is PEM run as part of an RMS workflow?",
66
+ )
67
+ parser.add_argument(
68
+ "-s",
69
+ "--rms-project",
70
+ required=False,
71
+ default=None,
72
+ help="In case PEM is called from RMS: RMS project",
73
+ )
74
+ args = parser.parse_args(args_list)
49
75
  cwd = args.config_dir.absolute()
50
76
  if str(cwd).endswith("sim2seis/model"):
51
77
  run_folder = cwd
@@ -57,11 +83,22 @@ def main():
57
83
  warn(f"PEM model should be run from the sim2seis/model folder. {e}")
58
84
  run_folder = cwd
59
85
  with restore_dir(run_folder):
86
+ # Read and validate all PEM parameters
87
+ config = read_pem_config(yaml_file=run_folder / args.config_file)
88
+
89
+ # Read necessary part of global configurations and parameters
90
+ config.update_with_global(
91
+ get_global_params_and_dates(
92
+ global_config_dir=(run_folder / args.global_dir).resolve(),
93
+ global_conf_file=args.global_file,
94
+ mod_prefix=args.mod_date_prefix,
95
+ )
96
+ )
60
97
  pem_fcn(
98
+ config=config,
61
99
  config_dir=run_folder,
62
- pem_config_file_name=args.config_file,
63
- global_config_dir=args.global_dir,
64
- global_config_file=args.global_file,
100
+ run_from_rms=args.run_from_rms,
101
+ proj=args.rms_project,
65
102
  )
66
103
 
67
104
 
@@ -29,6 +29,8 @@ class PetroElasticModel(ForwardModelStepPlugin):
29
29
  "<GLOBAL_FILE>",
30
30
  "--model-dir",
31
31
  "<MODEL_DIR>",
32
+ "--mod-date-prefix",
33
+ "<MOD_DATE_PREFIX>",
32
34
  ],
33
35
  )
34
36
 
@@ -40,6 +42,7 @@ class PetroElasticModel(ForwardModelStepPlugin):
40
42
  def validate_pre_experiment(self, fm_step_json: ForwardModelStepJSON) -> None:
41
43
  # Parse YAML parameter file by pydantic pre-experiment to catch errors at an
42
44
  # early stage
45
+
43
46
  config_file = Path(fm_step_json["argList"][3])
44
47
  model_dir = Path(fm_step_json["argList"][9])
45
48
  try:
@@ -58,7 +61,7 @@ class PetroElasticModel(ForwardModelStepPlugin):
58
61
  examples="""
59
62
  .. code-block:: console
60
63
 
61
- FORWARD_MODEL PEM(<CONFIG_DIR>=../../sim2seis/model, <CONFIG_FILE>=new_pem.yml, <GLOBAL_DiR>=../../fmuconfig/output, <GLOBAL_FILE>=global_variables.yml, <MODEL_DIR>=/my_fmu_structure/sim2seis/model)
64
+ FORWARD_MODEL PEM(<CONFIG_DIR>=../../sim2seis/model, <CONFIG_FILE>=new_pem.yml, <GLOBAL_DiR>=../../fmuconfig/output, <GLOBAL_FILE>=global_variables.yml, <MODEL_DIR>=/my_fmu_structure/sim2seis/model, <MOD_DATE_PREFIX>=HIST)
62
65
 
63
66
  """, # noqa: E501,
64
67
  )
@@ -30,7 +30,6 @@ from .pem_config_validation import (
30
30
  MineralProperties,
31
31
  PemConfig,
32
32
  RockMatrixProperties,
33
- possible_date_string,
34
33
  )
35
34
  from .update_grid import update_inactive_grid_cells
36
35
  from .utils import (
@@ -66,7 +65,6 @@ __all__ = [
66
65
  "input_num_string_to_list",
67
66
  "missing_num_areas",
68
67
  "num_boolean_array",
69
- "possible_date_string",
70
68
  "read_pem_config",
71
69
  "read_sim_grid_props",
72
70
  "restore_dir",
@@ -45,6 +45,8 @@ def find_key_first(d: dict, key: str) -> str | None:
45
45
  def get_global_params_and_dates(
46
46
  global_config_dir: Path,
47
47
  global_conf_file: Path,
48
+ mod_prefix: str | None = None,
49
+ obs_prefix: str | None = None,
48
50
  ) -> dict:
49
51
  """Read global configuration parameters, simulation model dates and seismic dates
50
52
  for difference calculation
@@ -58,35 +60,41 @@ def get_global_params_and_dates(
58
60
  list of tuples with
59
61
  strings of dates to calculate difference properties
60
62
  """
61
- global_config_par = yaml_load(str(global_config_dir / global_conf_file))
62
- # check if 'HIST' or 'PRED' is used
63
- if "SEISMIC_PRED_DATES" in global_config_par["global"]["dates"]:
64
- date_str = "SEISMIC_PRED_DATES"
65
- else:
66
- date_str = "SEISMIC_HIST_DATES"
67
- if "SEISMIC_PRED_DIFFDATES" in global_config_par["global"]["dates"]:
68
- diff_str = "SEISMIC_PRED_DIFFDATES"
69
- else:
70
- diff_str = "SEISMIC_HIST_DIFFDATES"
71
- seismic_dates = [
72
- str(sdate).replace("-", "")
73
- for sdate in global_config_par["global"]["dates"][date_str]
74
- ]
75
- diff_dates = [
76
- [str(sdate).replace("-", "") for sdate in datepairs]
77
- for datepairs in global_config_par["global"]["dates"][diff_str]
78
- ]
63
+ global_config_par = yaml_load(
64
+ str(global_config_dir / global_conf_file),
65
+ )
79
66
  grid_model_name = find_key_first(global_config_par["global"], "ECLGRIDNAME_PEM")
80
67
  if grid_model_name is None:
81
68
  raise ValueError(
82
69
  f"{__file__}: no value for ECLGRIDNAME_PEM in global config file"
83
70
  )
84
- return {
85
- "grid_model": grid_model_name,
86
- "seis_dates": seismic_dates,
87
- "diff_dates": diff_dates,
71
+ # Find the correct seismic dates references
72
+ dates_config = global_config_par["global"]["dates"]
73
+ return_dict = {
88
74
  "global_config": global_config_par,
75
+ "grid_model": grid_model_name,
76
+ "seismic": global_config_par["global"]["seismic"],
89
77
  }
78
+ if mod_prefix:
79
+ return_dict.update(
80
+ {
81
+ "mod_dates": dates_config.get(f"SEISMIC_{mod_prefix}_DATES", None),
82
+ "mod_diffdates": dates_config.get(
83
+ f"SEISMIC_{mod_prefix}_DIFFDATES", None
84
+ ),
85
+ }
86
+ )
87
+ if obs_prefix:
88
+ return_dict.update(
89
+ {
90
+ "obs_dates": dates_config.get(f"SEISMIC_{obs_prefix}_DATES", None),
91
+ "obs_diffdates": dates_config.get(
92
+ f"SEISMIC_{obs_prefix}_DIFFDATES", None
93
+ ),
94
+ }
95
+ )
96
+
97
+ return return_dict
90
98
 
91
99
 
92
100
  def read_pem_config(yaml_file: Path) -> PemConfig:
@@ -5,6 +5,7 @@ from typing import Any, Self
5
5
 
6
6
  import numpy as np
7
7
  from pydantic import (
8
+ AliasChoices,
8
9
  BaseModel,
9
10
  ConfigDict,
10
11
  DirectoryPath,
@@ -15,6 +16,7 @@ from pydantic import (
15
16
  from pydantic.json_schema import SkipJsonSchema
16
17
  from pydantic_core.core_schema import ValidationInfo
17
18
 
19
+ from fmu.datamodels.fmu_results.global_configuration import GlobalConfiguration
18
20
  from fmu.pem import INTERNAL_EQUINOR
19
21
 
20
22
  from .enum_defs import (
@@ -556,53 +558,51 @@ class Fluids(BaseModel):
556
558
  return v
557
559
 
558
560
 
559
- def possible_date_string(date_strings: list[str]) -> bool:
560
- """
561
- Validate a list of date strings in YYYYMMDD format.
561
+ def date_to_string(date_obj: date) -> str:
562
+ return date_obj.strftime(format="%Y%m%d")
562
563
 
563
- Args:
564
- date_strings: list of strings to validate
565
564
 
566
- Returns:
567
- bool: True if all strings are valid dates
565
+ class SeismicSurvey(BaseModel):
566
+ ecldate: list[str]
567
+ time: dict[str, str] | None = None
568
+ depth: dict[str, str] | None = None
568
569
 
569
- Raises:
570
- ValueError: If any string is not a valid date in YYYYMMDD format
571
- """
572
- for date_string in date_strings:
573
- if len(date_string) != 8:
574
- raise ValueError(
575
- f"Invalid date format: '{date_string}' must be exactly 8 characters"
576
- )
577
- try:
578
- date(
579
- year=int(date_string[0:4]),
580
- month=int(date_string[4:6]),
581
- day=int(date_string[6:]),
582
- )
583
- except ValueError:
584
- raise ValueError(
585
- f"Invalid date: '{date_string}' must be a valid date in YYYYMMDD format"
586
- )
587
- return True
570
+ @field_validator("ecldate", mode="before")
571
+ def convert_ecldate_strings(cls, v: list[date]) -> list[str]:
572
+ return [date_to_string(date) for date in v]
588
573
 
589
574
 
590
- class FromGlobal(BaseModel):
591
- grid_model: str
592
- seis_dates: list[str]
593
- diff_dates: list[list[str]]
594
- global_config: dict[str, Any]
575
+ class SeismicSection(BaseModel):
576
+ model_config = ConfigDict(populate_by_name=True)
595
577
 
596
- @field_validator("seis_dates", mode="before")
597
- def check_date_string(cls, v: list[str]) -> list[str]:
598
- possible_date_string(v)
599
- return v
578
+ templatecube_4d: str = Field(
579
+ validation_alias=AliasChoices("4d_templatecube", "templatecube_4d"),
580
+ serialization_alias="4d_templatecube",
581
+ )
582
+ real_4d_cropped_path: Path
583
+ real_4d: dict[str, SeismicSurvey]
600
584
 
601
- @field_validator("diff_dates", mode="before")
602
- def check_diffdate_string(cls, v: list[list[str]]) -> list[list[str]]:
603
- for ll in v:
604
- possible_date_string(ll)
605
- return v
585
+
586
+ class FromGlobal(BaseModel):
587
+ grid_model: str
588
+ mod_dates: list[str] | None = None
589
+ mod_diffdates: list[list[str]] | None = None
590
+ obs_dates: list[str] | None = None
591
+ obs_diffdates: list[list[str]] | None = None
592
+ seismic: SeismicSection
593
+ global_config: GlobalConfiguration
594
+
595
+ @field_validator("mod_dates", "obs_dates", mode="before")
596
+ def make_date_strings(cls, v: list[date]) -> list[str] | None:
597
+ if v:
598
+ return [date_to_string(date) for date in v]
599
+ return None
600
+
601
+ @field_validator("mod_diffdates", "obs_diffdates", mode="before")
602
+ def make_diffdate_strings(cls, v: list[list[str]]) -> list[list[str]] | None:
603
+ if v:
604
+ return [[date_to_string(date) for date in diffdate] for diffdate in v]
605
+ return None
606
606
 
607
607
 
608
608
  class PemPaths(BaseModel):
@@ -6,10 +6,8 @@ from fmu.pem import pem_utilities as pem_utils
6
6
 
7
7
 
8
8
  def pem_fcn(
9
+ config: pem_utils.PemConfig,
9
10
  config_dir: Path,
10
- pem_config_file_name: Path,
11
- global_config_dir: Path,
12
- global_config_file: Path,
13
11
  run_from_rms=False,
14
12
  proj=None,
15
13
  ) -> None:
@@ -18,24 +16,13 @@ def pem_fcn(
18
16
  yaml-file control the selections made in the PEM.
19
17
 
20
18
  """
21
- # Read and validate all PEM parameters
22
- config = pem_utils.read_pem_config(yaml_file=config_dir / pem_config_file_name)
23
-
24
- # Read necessary part of global configurations and parameters
25
- config.update_with_global(
26
- pem_utils.get_global_params_and_dates(
27
- global_config_dir=(config_dir / global_config_dir).resolve(),
28
- global_conf_file=global_config_file,
29
- )
30
- )
31
-
32
19
  # Import Eclipse simulation grid - INIT and RESTART
33
20
  sim_grid, constant_props, time_step_props = pem_utils.read_sim_grid_props(
34
21
  rel_dir_sim_files=config.eclipse_files.rel_path_simgrid,
35
22
  egrid_file=config.eclipse_files.egrid_file,
36
23
  init_property_file=config.eclipse_files.init_property_file,
37
24
  restart_property_file=config.eclipse_files.restart_property_file,
38
- seis_dates=config.global_params.seis_dates,
25
+ seis_dates=config.global_params.mod_dates,
39
26
  fipnum_name=config.alternative_fipnum_name,
40
27
  )
41
28
 
@@ -65,7 +52,7 @@ def pem_fcn(
65
52
  sim_rst=time_step_props,
66
53
  matrix_props=matrix_properties,
67
54
  fluid_props=fluid_properties,
68
- sim_dates=config.global_params.seis_dates,
55
+ sim_dates=config.global_params.mod_dates,
69
56
  fipnum=constant_props.fipnum,
70
57
  )
71
58
 
@@ -89,8 +76,8 @@ def pem_fcn(
89
76
  # Calculate difference properties. Possible properties are all that vary with time
90
77
  diff_props, diff_date_strs = pem_utils.calculate_diff_properties(
91
78
  props=[time_step_props, eff_pres, sat_rock_props, sum_delta_time],
92
- diff_dates=config.global_params.diff_dates,
93
- seis_dates=config.global_params.seis_dates,
79
+ diff_dates=config.global_params.mod_diffdates,
80
+ seis_dates=config.global_params.mod_dates,
94
81
  diff_calculation=config.diff_calculation,
95
82
  )
96
83
 
@@ -108,7 +95,7 @@ def pem_fcn(
108
95
  rms_project=proj,
109
96
  sim_grid=sim_grid,
110
97
  grid_name=config.global_params.grid_model,
111
- seis_dates=config.global_params.seis_dates,
98
+ seis_dates=config.global_params.mod_dates,
112
99
  save_to_rms=config.results.save_results_to_rms,
113
100
  save_to_disk=config.results.save_results_to_disk,
114
101
  save_intermediate=config.results.save_intermediate_results,
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.0.3'
32
- __version_tuple__ = version_tuple = (0, 0, 3)
31
+ __version__ = version = '0.0.4'
32
+ __version_tuple__ = version_tuple = (0, 0, 4)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu-pem
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: pem
5
5
  License: GNU GENERAL PUBLIC LICENSE
6
6
  Version 3, 29 June 2007
@@ -695,6 +695,7 @@ Requires-Dist: xtgeo>=4.7.1
695
695
  Requires-Dist: fmu-tools
696
696
  Requires-Dist: fmu-config
697
697
  Requires-Dist: fmu-dataio
698
+ Requires-Dist: fmu-datamodels
698
699
  Requires-Dist: rock-physics-open>=0.3.3
699
700
  Requires-Dist: PyYAML>=6.0.1
700
701
  Requires-Dist: pydantic
@@ -13,7 +13,7 @@ documentation/docs/effective-mineral-properties.md
13
13
  documentation/docs/effective-pressure.md
14
14
  documentation/docs/ert-configuration.md
15
15
  documentation/docs/ert.tmLanguage.json
16
- documentation/docs/fluid_properties.md
16
+ documentation/docs/fluid-properties.md
17
17
  documentation/docs/import-sim-results.md
18
18
  documentation/docs/index.md
19
19
  documentation/docs/mineral-properties.md
@@ -3,6 +3,7 @@ xtgeo>=4.7.1
3
3
  fmu-tools
4
4
  fmu-config
5
5
  fmu-dataio
6
+ fmu-datamodels
6
7
  rock-physics-open>=0.3.3
7
8
  PyYAML>=6.0.1
8
9
  pydantic
@@ -8,6 +8,7 @@ DEFINE <PEM_CONFIG_FILE_NAME> pem_config_condensate_multi.yml
8
8
  DEFINE <GLOBAL_PATH> ../../fmuconfig/output
9
9
  DEFINE <GLOBAL_CONFIG_FILE> global_variables.yml
10
10
  DEFINE <MODEL_PATH> <CONFIG_PATH>/../../sim2seis/model
11
+ DEFINE <MOD_PREFIX> HIST
11
12
 
12
13
  -- Run the PEM
13
- FORWARD_MODEL PEM(<CONFIG_DIR>=<PEM_PATH>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_PATH>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>)
14
+ FORWARD_MODEL PEM(<CONFIG_DIR>=<PEM_PATH>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_PATH>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>, <MOD_DATE_PREFIX>=<MOD_PREFIX>)
@@ -8,6 +8,7 @@ DEFINE <PEM_CONFIG_FILE_NAME> pem_config_no_condensate.yml
8
8
  DEFINE <GLOBAL_PATH> ../../fmuconfig/output
9
9
  DEFINE <GLOBAL_CONFIG_FILE> global_variables.yml
10
10
  DEFINE <MODEL_PATH> <CONFIG_PATH>/../../sim2seis/model
11
+ DEFINE <MOD_PREFIX> HIST
11
12
 
12
13
  -- Run the PEM
13
- FORWARD_MODEL PEM(<CONFIG_DIR>=<PEM_PATH>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_PATH>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>)
14
+ FORWARD_MODEL PEM(<CONFIG_DIR>=<PEM_PATH>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>, <GLOBAL_DIR>=<GLOBAL_PATH>, <GLOBAL_FILE>=<GLOBAL_CONFIG_FILE>, <MODEL_DIR>=<MODEL_PATH>, <MOD_DATE_PREFIX>=<MOD_PREFIX>)
@@ -3,16 +3,56 @@ from pathlib import Path
3
3
  import pytest
4
4
 
5
5
  from fmu.pem import INTERNAL_EQUINOR
6
- from fmu.pem.pem_utilities.import_config import read_pem_config
6
+ from fmu.pem.pem_utilities.import_config import (
7
+ get_global_params_and_dates,
8
+ read_pem_config,
9
+ )
7
10
  from src.fmu.pem.pem_utilities.import_config import find_key_first
8
11
 
9
12
 
10
13
  def test_validate_new_pem_config_multizone(testdata, monkeypatch, data_dir):
11
- monkeypatch.chdir(data_dir / "sim2seis" / "model")
14
+ run_folder = data_dir / "sim2seis" / "model"
15
+ monkeypatch.chdir(run_folder)
16
+ global_dir = "../../fmuconfig/output"
17
+ global_file = "global_variables.yml"
18
+ obs_date_prefix = "HIST"
19
+ mod_date_prefix = "HIST"
12
20
  pem_config_file_name = Path("../../sim2seis/model/pem_config_condensate_multi.yml")
13
21
  if INTERNAL_EQUINOR:
14
22
  try:
23
+ config = read_pem_config(pem_config_file_name)
24
+ # Read necessary part of global configurations and parameters
25
+ config.update_with_global(
26
+ get_global_params_and_dates(
27
+ global_config_dir=(run_folder / global_dir).resolve(),
28
+ global_conf_file=global_file,
29
+ mod_prefix=mod_date_prefix,
30
+ obs_prefix=obs_date_prefix,
31
+ )
32
+ )
33
+ except Exception as e:
34
+ pytest.fail(f"Validation failed: {e}")
35
+ else:
36
+ with pytest.raises(NotImplementedError):
15
37
  _ = read_pem_config(pem_config_file_name)
38
+
39
+
40
+ def test_validate_new_pem_config_multizone_no_prefix(testdata, monkeypatch, data_dir):
41
+ run_folder = data_dir / "sim2seis" / "model"
42
+ monkeypatch.chdir(run_folder)
43
+ global_dir = "../../fmuconfig/output"
44
+ global_file = "global_variables.yml"
45
+ pem_config_file_name = Path("../../sim2seis/model/pem_config_condensate_multi.yml")
46
+ if INTERNAL_EQUINOR:
47
+ try:
48
+ config = read_pem_config(pem_config_file_name)
49
+ # Read necessary part of global configurations and parameters
50
+ config.update_with_global(
51
+ get_global_params_and_dates(
52
+ global_config_dir=(run_folder / global_dir).resolve(),
53
+ global_conf_file=global_file,
54
+ )
55
+ )
16
56
  except Exception as e:
17
57
  pytest.fail(f"Validation failed: {e}")
18
58
  else:
@@ -0,0 +1,105 @@
1
+ from pathlib import Path
2
+
3
+ import pytest
4
+
5
+ from fmu.pem import INTERNAL_EQUINOR, pem, pem_fcn
6
+ from fmu.pem.pem_utilities import (
7
+ PemConfig,
8
+ get_global_params_and_dates,
9
+ read_pem_config,
10
+ )
11
+
12
+
13
+ def setup(data_dir: Path, config_file: Path) -> tuple[PemConfig, Path]:
14
+ run_folder = data_dir / "sim2seis" / "model"
15
+ global_dir = Path("../../fmuconfig/output")
16
+ global_file = Path("global_variables.yml")
17
+
18
+ config = read_pem_config(yaml_file=run_folder / config_file)
19
+
20
+ config.update_with_global(
21
+ get_global_params_and_dates(
22
+ global_config_dir=(run_folder / global_dir).resolve(),
23
+ global_conf_file=global_file,
24
+ mod_prefix="HIST",
25
+ obs_prefix="HIST",
26
+ )
27
+ )
28
+ return config, run_folder
29
+
30
+
31
+ def test_pem_fcn(data_dir, monkeypatch):
32
+ monkeypatch.chdir(data_dir / "sim2seis" / "model")
33
+
34
+ conf, config_dir = setup(
35
+ data_dir=data_dir,
36
+ config_file="pem_config_no_condensate.yml",
37
+ )
38
+
39
+ pem_fcn(
40
+ config=conf,
41
+ config_dir=config_dir,
42
+ )
43
+
44
+
45
+ def test_pem_fcn_multi(data_dir, monkeypatch):
46
+ monkeypatch.chdir(data_dir / "sim2seis" / "model")
47
+
48
+ if not INTERNAL_EQUINOR:
49
+ with pytest.raises((NotImplementedError, ImportError)):
50
+ conf, config_dir = setup(
51
+ data_dir=data_dir,
52
+ config_file="pem_config_condensate_multi.yml",
53
+ )
54
+ pem_fcn(
55
+ config=conf,
56
+ config_dir=config_dir,
57
+ )
58
+ else:
59
+ conf, config_dir = setup(
60
+ data_dir=data_dir,
61
+ config_file="pem_config_condensate_multi.yml",
62
+ )
63
+ pem_fcn(
64
+ config=conf,
65
+ config_dir=config_dir,
66
+ )
67
+
68
+
69
+ def test_pem_main(data_dir, monkeypatch):
70
+ monkeypatch.chdir(data_dir / "sim2seis" / "model")
71
+
72
+ if not INTERNAL_EQUINOR:
73
+ pem(
74
+ args_list=[
75
+ "--config-dir",
76
+ str((data_dir / "sim2seis" / "model").resolve()),
77
+ "--config-file",
78
+ "pem_config_no_condensate.yml",
79
+ "--global-dir",
80
+ "../../fmuconfig/output",
81
+ "--global-file",
82
+ "global_variables.yml",
83
+ "--model-dir",
84
+ str((data_dir / "sim2seis" / "model").resolve()),
85
+ "--mod-date-prefix",
86
+ "HIST",
87
+ ]
88
+ )
89
+ else:
90
+ pem(
91
+ args_list=[
92
+ "--config-dir",
93
+ str((data_dir / "sim2seis" / "model").resolve()),
94
+ "--config-file",
95
+ "pem_config_condensate_multi.yml",
96
+ "--global-dir",
97
+ "../../fmuconfig/output",
98
+ "--global-file",
99
+ "global_variables.yml",
100
+ "--model-dir",
101
+ str((data_dir / "sim2seis" / "model").resolve()),
102
+ "--mod-date-prefix",
103
+ "HIST",
104
+ ]
105
+ )
@@ -1,45 +0,0 @@
1
- from pathlib import Path
2
-
3
- import pytest
4
-
5
- from fmu.pem import INTERNAL_EQUINOR, pem_fcn
6
-
7
-
8
- def test_pem_fcn(data_dir, monkeypatch):
9
- monkeypatch.chdir(data_dir / "sim2seis" / "model")
10
-
11
- if not INTERNAL_EQUINOR:
12
- with pytest.raises((NotImplementedError, ImportError)):
13
- pem_fcn(
14
- config_dir=data_dir / "sim2seis" / "model",
15
- pem_config_file_name=Path("pem_config_condensate.yml"),
16
- global_config_dir=Path("../../fmuconfig/output"),
17
- global_config_file=Path("global_variables.yml"),
18
- )
19
- else:
20
- pem_fcn(
21
- config_dir=data_dir / "sim2seis" / "model",
22
- pem_config_file_name=Path("pem_config_condensate.yml"),
23
- global_config_dir=Path("../../fmuconfig/output"),
24
- global_config_file=Path("global_variables.yml"),
25
- )
26
-
27
-
28
- def test_pem_fcn_multi(data_dir, monkeypatch):
29
- monkeypatch.chdir(data_dir / "sim2seis" / "model")
30
-
31
- if not INTERNAL_EQUINOR:
32
- with pytest.raises((NotImplementedError, ImportError)):
33
- pem_fcn(
34
- config_dir=data_dir / "sim2seis" / "model",
35
- pem_config_file_name=Path("pem_config_condensate_multi.yml"),
36
- global_config_dir=Path("../../fmuconfig/output"),
37
- global_config_file=Path("global_variables.yml"),
38
- )
39
- else:
40
- pem_fcn(
41
- config_dir=data_dir / "sim2seis" / "model",
42
- pem_config_file_name=Path("pem_config_condensate_multi.yml"),
43
- global_config_dir=Path("../../fmuconfig/output"),
44
- global_config_file=Path("global_variables.yml"),
45
- )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes