Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub actions workflow #91

Merged
merged 8 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/flownet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flownet/ahm/_assisted_history_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("------------------------------------------------------------------")

Expand Down
6 changes: 3 additions & 3 deletions src/flownet/ahm/_run_ahm.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -62,7 +62,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
Expand Down Expand Up @@ -300,7 +300,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()),
)
Expand Down
2 changes: 1 addition & 1 deletion src/flownet/data/from_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/flownet/prediction/_run_pred.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down