fmu-pem 0.0.1__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 (95) hide show
  1. fmu_pem-0.0.1/.github/workflows/build_test_deploy.yml +107 -0
  2. fmu_pem-0.0.1/.gitignore +16 -0
  3. fmu_pem-0.0.1/ERT/run_pem.ert +41 -0
  4. fmu_pem-0.0.1/LICENSE +674 -0
  5. fmu_pem-0.0.1/PKG-INFO +768 -0
  6. fmu_pem-0.0.1/README.md +47 -0
  7. fmu_pem-0.0.1/SECURITY.md +16 -0
  8. fmu_pem-0.0.1/pyproject.toml +92 -0
  9. fmu_pem-0.0.1/setup.cfg +4 -0
  10. fmu_pem-0.0.1/src/fmu/__init__.py +2 -0
  11. fmu_pem-0.0.1/src/fmu/pem/__init__.py +19 -0
  12. fmu_pem-0.0.1/src/fmu/pem/__main__.py +53 -0
  13. fmu_pem-0.0.1/src/fmu/pem/forward_models/__init__.py +7 -0
  14. fmu_pem-0.0.1/src/fmu/pem/forward_models/pem_model.py +72 -0
  15. fmu_pem-0.0.1/src/fmu/pem/hook_implementations/__init__.py +0 -0
  16. fmu_pem-0.0.1/src/fmu/pem/hook_implementations/jobs.py +19 -0
  17. fmu_pem-0.0.1/src/fmu/pem/pem_functions/__init__.py +17 -0
  18. fmu_pem-0.0.1/src/fmu/pem/pem_functions/density.py +55 -0
  19. fmu_pem-0.0.1/src/fmu/pem/pem_functions/effective_pressure.py +168 -0
  20. fmu_pem-0.0.1/src/fmu/pem/pem_functions/estimate_saturated_rock.py +90 -0
  21. fmu_pem-0.0.1/src/fmu/pem/pem_functions/fluid_properties.py +281 -0
  22. fmu_pem-0.0.1/src/fmu/pem/pem_functions/mineral_properties.py +230 -0
  23. fmu_pem-0.0.1/src/fmu/pem/pem_functions/regression_models.py +261 -0
  24. fmu_pem-0.0.1/src/fmu/pem/pem_functions/run_friable_model.py +119 -0
  25. fmu_pem-0.0.1/src/fmu/pem/pem_functions/run_patchy_cement_model.py +120 -0
  26. fmu_pem-0.0.1/src/fmu/pem/pem_functions/run_t_matrix_and_pressure.py +186 -0
  27. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/__init__.py +66 -0
  28. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/cumsum_properties.py +104 -0
  29. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/delta_cumsum_time.py +104 -0
  30. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/enum_defs.py +54 -0
  31. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/export_routines.py +272 -0
  32. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/import_config.py +93 -0
  33. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/import_routines.py +161 -0
  34. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/pem_class_definitions.py +113 -0
  35. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/pem_config_validation.py +505 -0
  36. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/rpm_models.py +177 -0
  37. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/update_grid.py +54 -0
  38. fmu_pem-0.0.1/src/fmu/pem/pem_utilities/utils.py +262 -0
  39. fmu_pem-0.0.1/src/fmu/pem/run_pem.py +98 -0
  40. fmu_pem-0.0.1/src/fmu/pem/version.py +21 -0
  41. fmu_pem-0.0.1/src/fmu_pem.egg-info/PKG-INFO +768 -0
  42. fmu_pem-0.0.1/src/fmu_pem.egg-info/SOURCES.txt +93 -0
  43. fmu_pem-0.0.1/src/fmu_pem.egg-info/dependency_links.txt +1 -0
  44. fmu_pem-0.0.1/src/fmu_pem.egg-info/entry_points.txt +5 -0
  45. fmu_pem-0.0.1/src/fmu_pem.egg-info/requires.txt +25 -0
  46. fmu_pem-0.0.1/src/fmu_pem.egg-info/top_level.txt +1 -0
  47. fmu_pem-0.0.1/tests/__init__.py +0 -0
  48. fmu_pem-0.0.1/tests/conftest.py +8 -0
  49. fmu_pem-0.0.1/tests/data/ECLIPSE.EGRID +0 -0
  50. fmu_pem-0.0.1/tests/data/ECLIPSE.INIT +0 -0
  51. fmu_pem-0.0.1/tests/data/ECLIPSE.UNRST +0 -0
  52. fmu_pem-0.0.1/tests/data/carbonate_pressure_model_vp_exp.pkl +0 -0
  53. fmu_pem-0.0.1/tests/data/carbonate_pressure_model_vs_exp.pkl +0 -0
  54. fmu_pem-0.0.1/tests/data/export_grid.roff +0 -0
  55. fmu_pem-0.0.1/tests/data/export_prop.roff +0 -0
  56. fmu_pem-0.0.1/tests/data/global_variables.yml +1308 -0
  57. fmu_pem-0.0.1/tests/data/global_variables_pred.yml +171 -0
  58. fmu_pem-0.0.1/tests/data/run_pem_condensate.ert +15 -0
  59. fmu_pem-0.0.1/tests/data/run_pem_no_condensate.ert +15 -0
  60. fmu_pem-0.0.1/tests/data/simgrid--ntg_pem.roff +0 -0
  61. fmu_pem-0.0.1/tests/data/simgrid.roff +0 -0
  62. fmu_pem-0.0.1/tests/data/t_mat_params_exp.pkl +0 -0
  63. fmu_pem-0.0.1/tests/data/t_mat_params_petec.pkl +0 -0
  64. fmu_pem-0.0.1/tests/data/test_pem_config_condensate.yml +122 -0
  65. fmu_pem-0.0.1/tests/data/test_pem_config_no_condensate.yml +122 -0
  66. fmu_pem-0.0.1/tests/data/vp_exp_model.pkl +0 -0
  67. fmu_pem-0.0.1/tests/data/vs_exp_model.pkl +0 -0
  68. fmu_pem-0.0.1/tests/test_config_file_validation.py +33 -0
  69. fmu_pem-0.0.1/tests/test_dry_rock.py +49 -0
  70. fmu_pem-0.0.1/tests/test_ert_hooks.py +205 -0
  71. fmu_pem-0.0.1/tests/test_ert_hooks_condensate.py +178 -0
  72. fmu_pem-0.0.1/tests/test_friable.py +161 -0
  73. fmu_pem-0.0.1/tests/test_patchy_cement.py +177 -0
  74. fmu_pem-0.0.1/tests/test_pem.py +25 -0
  75. fmu_pem-0.0.1/tests/test_regression.py +141 -0
  76. fmu_pem-0.0.1/tests/test_t_matrix.py +200 -0
  77. fmu_pem-0.0.1/tests/test_utils.py +259 -0
  78. fmu_pem-0.0.1/tests/yaml_files/new_pem_config.yml +121 -0
  79. fmu_pem-0.0.1/user-interface-config/.prettierrc +1 -0
  80. fmu_pem-0.0.1/user-interface-config/eslint.config.js +28 -0
  81. fmu_pem-0.0.1/user-interface-config/index.html +22 -0
  82. fmu_pem-0.0.1/user-interface-config/package-lock.json +7033 -0
  83. fmu_pem-0.0.1/user-interface-config/package.json +45 -0
  84. fmu_pem-0.0.1/user-interface-config/postcss.config.js +6 -0
  85. fmu_pem-0.0.1/user-interface-config/src/App.tsx +153 -0
  86. fmu_pem-0.0.1/user-interface-config/src/fmu-pem-schema.json +20 -0
  87. fmu_pem-0.0.1/user-interface-config/src/index.css +65 -0
  88. fmu_pem-0.0.1/user-interface-config/src/main.tsx +10 -0
  89. fmu_pem-0.0.1/user-interface-config/src/schema.tsx +5 -0
  90. fmu_pem-0.0.1/user-interface-config/src/vite-env.d.ts +1 -0
  91. fmu_pem-0.0.1/user-interface-config/tailwind.config.js +8 -0
  92. fmu_pem-0.0.1/user-interface-config/tsconfig.app.json +26 -0
  93. fmu_pem-0.0.1/user-interface-config/tsconfig.json +7 -0
  94. fmu_pem-0.0.1/user-interface-config/tsconfig.node.json +24 -0
  95. fmu_pem-0.0.1/user-interface-config/vite.config.ts +7 -0
@@ -0,0 +1,107 @@
1
+ name: Build, test and (if release) deploy
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ release:
7
+ types:
8
+ - published
9
+ pull_request:
10
+
11
+ jobs:
12
+ build:
13
+ name: "Python ${{ matrix.python-version }}"
14
+ runs-on: "ubuntu-latest"
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.11"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v4
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ cache: 'pip'
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ pip install -e .[tests]
31
+
32
+ # - name: Run ruff format
33
+ # run: ruff format . --diff
34
+
35
+ - name: Run ruff check
36
+ run: ruff check .
37
+
38
+ - name: Test with pytest
39
+ run: pytest
40
+
41
+ - name: Build a binary wheel and a source tarball
42
+ if: github.event_name == 'release'
43
+ run: |
44
+ pip install build
45
+ export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FMU_PEM=$GITHUB_REF_NAME
46
+ python -m build
47
+
48
+ - name: Upload artifact
49
+ if: github.event_name == 'release'
50
+ uses: actions/upload-artifact@v4
51
+ with:
52
+ name: Python dist
53
+ path: dist/
54
+
55
+ - name: Build configuration file user interface
56
+ working-directory: ./user-interface-config
57
+ run: |
58
+ npm ci
59
+ npm run create-json-schema
60
+ npm run build
61
+
62
+ - name: 📚 Update GitHub pages
63
+ # Update on merge to main
64
+ if: github.ref_name == 'main'
65
+ run: |
66
+ # Move the built documentation out of working directory, in order to delete everything else afterwards
67
+ cp -R ./user-interface-config/dist ../dist
68
+
69
+ git config --local user.email "fmu-pem-github-action"
70
+ git config --local user.name "fmu-pem-github-action"
71
+ git fetch origin gh-pages
72
+ git checkout -f --track origin/gh-pages
73
+ git clean -f -f -d -x
74
+ git rm -r *
75
+
76
+ cp -R ../dist/* .
77
+
78
+ git add .
79
+
80
+ if git diff-index --quiet HEAD; then
81
+ echo "No changes in documentation. Skip documentation deploy."
82
+ else
83
+ git commit -m "Update Github Pages"
84
+ git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
85
+ fi
86
+
87
+ deploy:
88
+ name: Upload release to PyPI
89
+ if: github.event_name == 'release'
90
+ needs: build
91
+ runs-on: ubuntu-latest
92
+ environment:
93
+ name: pypi
94
+ url: https://pypi.org/p/fmu-pem
95
+ permissions:
96
+ id-token: write # required for Trusted Publishing to PyPI
97
+
98
+ steps:
99
+ - uses: actions/download-artifact@v4
100
+ with:
101
+ name: Python dist
102
+ path: dist/
103
+
104
+ - name: Publish package distributions to PyPI
105
+ uses: pypa/gh-action-pypi-publish@release/v1
106
+ with:
107
+ packages-dir: dist/
@@ -0,0 +1,16 @@
1
+ /.venv/
2
+ /.vscode/
3
+ # Local debug scripts etc
4
+ Notebooks_and_scripts/
5
+ Notebooks/
6
+ .env
7
+ .idea/
8
+ /build/
9
+ /dist/
10
+ /src/fmu_pem.egg-info/
11
+ **/__pycache__/
12
+ src/fmu/pem/version.py
13
+
14
+ # npm and node relevant build files
15
+ node_modules
16
+ dist
@@ -0,0 +1,41 @@
1
+ -- This script is run for test purpose of the PEM alone, whereas the PEM is normally run as part of
2
+ -- a workflow that will produce its input files. The creation of directories and copying of input
3
+ -- files may not be needed in a run where the PEM is just one part of a longer workflow.
4
+ -- The model parameter directories ../../sim2seis/model is used by the PEM and the sim2seis workflows
5
+ -- and copying of this directory may not be included in other ERT setup files
6
+ -- HFLE/2025
7
+
8
+ DEFINE <USER> $USER
9
+ DEFINE <SCRATCH> /scratch/fmu
10
+ DEFINE <CONFIG_PATH> /private/hfle/drogon_hfle/dev/rms/model
11
+
12
+ NUM_REALIZATIONS 1
13
+ RUNPATH <SCRATCH>/<USER>/fmu_sim2seis_pem/realization-<IENS>/iter-<ITER>
14
+
15
+ -- Copy required input files for the PEM, directories are automatically created by COPY_FILE
16
+ FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/../../fmuconfig/output/global_variables.yml, <TO>=<RUNPATH>/fmuconfig/output/global_variables.yml)
17
+ FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/../../fmuconfig/output/global_variables_pred.yml, <TO>=<RUNPATH>/fmuconfig/output/global_variables_pred.yml)
18
+ FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/../../sim2seis/input/pem/ECLIPSE.EGRID, <TO>=<RUNPATH>/sim2seis/input/pem/ECLIPSE.EGRID)
19
+ FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/../../sim2seis/input/pem/ECLIPSE.INIT, <TO>=<RUNPATH>/sim2seis/input/pem/ECLIPSE.INIT)
20
+ FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/../../sim2seis/input/pem/ECLIPSE.UNRST, <TO>=<RUNPATH>/sim2seis/input/pem/ECLIPSE.UNRST)
21
+ FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/../../sim2seis/input/pem/export_grid.roff, <TO>=<RUNPATH>/sim2seis/input/pem/export_grid.roff)
22
+ FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/../../sim2seis/input/pem/export_prop.roff, <TO>=<RUNPATH>/sim2seis/input/pem/export_prop.roff)
23
+
24
+ -- Copy all model files in ../../sim2seis/model for flexibility. The PEM .yml file (new_pem_config.yml) is
25
+ -- always required, .pkl model files are required if tmatrix model is used in the PEM
26
+ FORWARD_MODEL COPY_DIRECTORY(<FROM>=<CONFIG_PATH>/../../sim2seis/model, <TO>=<RUNPATH>/sim2seis)
27
+
28
+ -- Create output directories for input to seismic_forward and for QC/visualization of PEM results
29
+ FORWARD_MODEL MAKE_DIRECTORY(<DIRECTORY> = <RUNPATH>/sim2seis/output/pem)
30
+ FORWARD_MODEL MAKE_DIRECTORY(<DIRECTORY> = <RUNPATH>/share/results/grids)
31
+
32
+ -- Create start directory
33
+ FORWARD_MODEL MAKE_DIRECTORY(<DIRECTORY> = <RUNPATH>/rms/model)
34
+
35
+ -- PEM parameter setting
36
+ DEFINE <PEM_STARTDIR> <RUNPATH>/rms/model
37
+ DEFINE <RELPATH_PEM> <RUNPATH>/sim2seis/model
38
+ DEFINE <PEM_CONFIG_FILE_NAME> new_pem_config.yml
39
+
40
+ -- Run the PEM
41
+ FORWARD_MODEL PEM(<START_DIR>=<PEM_STARTDIR>, <CONFIG_DIR>=<RELPATH_PEM>, <CONFIG_FILE>=<PEM_CONFIG_FILE_NAME>)