diff --git a/.github/workflows/flownet.yml b/.github/workflows/flownet.yml index 355e83df5..3397b2439 100644 --- a/.github/workflows/flownet.yml +++ b/.github/workflows/flownet.yml @@ -28,27 +28,31 @@ jobs: uses: actions/checkout@v2 - name: 🐍 Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: 📁 Cache virtual environment id: cache-venv - uses: actions/cache@v1 + uses: actions/cache@v2 with: - path: $VENV_PATH - key: ${{ runner.os }}-${{ hashFiles('setup.py') }}-${{ hashFiles('build_environment.sh') }} + path: ${{ env.VENV_PATH }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('build_environment.sh') }}-${{ hashFiles('setup.py') }} - name: 📦 Install non-python dependencies run: sudo bash ./apt_install.sh - name: 🏗️ Build Python environment - run: bash ./build_environment.sh $VENV_PATH /usr/bin/flow ${{ steps.cache-venv.outputs.cache-hit }} + if: steps.cache-venv.outputs.cache-hit != 'true' + run: bash ./build_environment.sh $VENV_PATH /usr/bin/flow + + - name: 🏗️ Extract Norne Dataset + if: steps.cache-venv.outputs.cache-hit == 'true' + run: tar -zxvf tests/data/norne.tar.gz -C tests/data/ - name: 📦 Install FlowNet run: | source $VENV_PATH/bin/activate - pip install "astroid==2.3.3" "pylint==2.4.4" # Bugs in what is currently the latest releases pip install . - name: 📦 Install test dependencies diff --git a/src/flownet/ahm/_assisted_history_matching.py b/src/flownet/ahm/_assisted_history_matching.py index baf837bf3..83ac5819d 100644 --- a/src/flownet/ahm/_assisted_history_matching.py +++ b/src/flownet/ahm/_assisted_history_matching.py @@ -166,7 +166,7 @@ def report(self): for distribution in parameter.random_variables } - print(f"Unique parameter distributions:") + print("Unique parameter distributions:") print("\nDistribution Minimum Mean Max") print("------------------------------------------------------------------") diff --git a/src/flownet/ahm/_run_ahm.py b/src/flownet/ahm/_run_ahm.py index 4d725903b..cb3dd970b 100644 --- a/src/flownet/ahm/_run_ahm.py +++ b/src/flownet/ahm/_run_ahm.py @@ -1,5 +1,5 @@ import argparse -from typing import Dict, Union, List, Optional +from typing import Union, List, Optional import numpy as np import pandas as pd @@ -56,7 +56,7 @@ def _find_training_set_fraction( def _get_distribution( - parameters: Union[str, List[str]], parameters_config: Dict, index: list + parameters: Union[str, List[str]], parameters_config: dict, index: list ) -> pd.DataFrame: """ Create the distribution min-max for one or more parameters @@ -294,7 +294,7 @@ def run_flownet_history_matching( # Fault transmissibility # ######################################### - if isinstance(network.faults, Dict): + if isinstance(network.faults, dict): fault_mult_dist_values = _get_distribution( ["fault_mult"], config.model_parameters, list(network.faults.keys()), ) diff --git a/src/flownet/data/from_flow.py b/src/flownet/data/from_flow.py index d9a749a69..0c8fb3d6a 100644 --- a/src/flownet/data/from_flow.py +++ b/src/flownet/data/from_flow.py @@ -172,7 +172,7 @@ def _production_data(self) -> pd.DataFrame: if df_production_data["WSTAT"].isna().all(): warnings.warn( - f"No WSTAT:* summary vectors in input case - setting default well status to OPEN." + "No WSTAT:* summary vectors in input case - setting default well status to OPEN." ) wstat_default = "OPEN" else: diff --git a/src/flownet/prediction/_run_pred.py b/src/flownet/prediction/_run_pred.py index 6063dd5d2..d4e4a85d9 100644 --- a/src/flownet/prediction/_run_pred.py +++ b/src/flownet/prediction/_run_pred.py @@ -25,7 +25,7 @@ def _run_ert(output_folder: pathlib.Path) -> None: """ subprocess.run( - f"ert ensemble_experiment pred_config.ert", + "ert ensemble_experiment pred_config.ert", cwd=output_folder, shell=True, check=True,