Skip to content

Commit 696384b

Browse files
committed
make separate plugin
1 parent bfad7de commit 696384b

File tree

8 files changed

+386
-362
lines changed

8 files changed

+386
-362
lines changed

.github/workflows/subsurface.yml

+22-124
Original file line numberDiff line numberDiff line change
@@ -173,130 +173,28 @@ jobs:
173173
matrix:
174174
python-version: ["3.8"]
175175

176-
- name: 🧹 Remove unused pre-installed software
177-
run: |
178-
# https://github.com/actions/virtual-environments/issues/751
179-
# https://github.com/actions/virtual-environments/issues/709
180-
sudo apt-get purge p7zip* yarn ruby-full ghc* php7*
181-
sudo apt-get autoremove
182-
sudo apt-get clean
183-
df -h
184-
185-
- name: 📖 Checkout commit locally
186-
uses: actions/checkout@v2
187-
188-
- name: 🐍 Set up Python ${{ matrix.python-version }}
189-
uses: actions/setup-python@v2
190-
with:
191-
python-version: ${{ matrix.python-version }}
192-
193-
- name: 📦 Install webviz-subsurface with dependencies
194-
run: |
195-
pip install --upgrade pip
196-
if [[ $(pip freeze) ]]; then
197-
pip freeze | grep -vw "pip" | xargs pip uninstall -y
198-
fi
199-
pip install "bleach<5" # https://github.com/equinor/webviz-config/issues/586
200-
pip install "werkzeug<2.1" # ...while waiting for https://github.com/plotly/dash/issues/1992
201-
pip install "selenium<4.3" # breaking change in selenium==4.3
202-
pip install "scipy<1.9.3" # breaking change in scipy==1.9.3
203-
pip install "pytest<7.2.0"
204-
pip install "pytest-xdist<3.0"
205-
pip install "xtgeo<2.20.2"
206-
pip install "mypy<0.990"
207-
pip install .
208-
209-
# Testing against our latest release (including pre-releases)
210-
pip install --pre --upgrade webviz-config webviz-core-components webviz-subsurface-components
211-
212-
- name: 📦 Install test dependencies
213-
run: |
214-
pip install .[tests]
215-
wget https://chromedriver.storage.googleapis.com/$(wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE -q -O -)/chromedriver_linux64.zip
216-
unzip chromedriver_linux64.zip
217-
export PATH=$PATH:$PWD
218-
219-
- name: 🧾 List all installed packages
220-
run: pip freeze
221-
222-
- name: 🕵️ Check code style & linting
223-
run: |
224-
black --check webviz_subsurface tests setup.py
225-
pylint webviz_subsurface tests setup.py
226-
bandit -r -c ./bandit.yml webviz_subsurface tests setup.py
227-
isort --check-only webviz_subsurface tests setup.py
228-
mypy --package webviz_subsurface
229-
230-
- name: 🤖 Run tests
231-
env:
232-
# If you want the CI to (temporarily) run against your fork of the testdada,
233-
# change the value her from "equinor" to your username.
234-
TESTDATA_REPO_OWNER: equinor
235-
# If you want the CI to (temporarily) run against another branch than master,
236-
# change the value her from "master" to the relevant branch name.
237-
TESTDATA_REPO_BRANCH: master
238-
run: |
239-
git clone --depth 1 --branch $TESTDATA_REPO_BRANCH https://github.com/$TESTDATA_REPO_OWNER/webviz-subsurface-testdata.git
240-
# Copy any clientside script to the test folder before running tests
241-
mkdir ./tests/assets && cp ./webviz_subsurface/_assets/js/* ./tests/assets
242-
pytest ./tests --headless --forked --testdata-folder ./webviz-subsurface-testdata
243-
rm -rf ./tests/assets
244-
webviz docs --portable ./docs_build --skip-open
245-
246-
- name: 🐳 Build Docker example image
247-
run: |
248-
pip install --pre webviz-config-equinor
249-
export SOURCE_URL_WEBVIZ_SUBSURFACE=https://github.com/$GITHUB_REPOSITORY
250-
export GIT_POINTER_WEBVIZ_SUBSURFACE=$GITHUB_REF
251-
webviz build ./webviz-subsurface-testdata/webviz_examples/webviz-full-demo.yml --portable ./example_subsurface_app --theme equinor
252-
rm -rf ./webviz-subsurface-testdata
253-
pushd example_subsurface_app
254-
docker build -t webviz/example_subsurface_image:equinor-theme .
255-
popd
256-
257-
- name: 🐳 Update Docker Hub example image
258-
if: github.event_name != 'schedule' && github.ref == 'refs/heads/master' && matrix.python-version == '3.8'
259-
run: |
260-
echo ${{ secrets.dockerhub_webviz_token }} | docker login --username webviz --password-stdin
261-
docker push webviz/example_subsurface_image:equinor-theme
262-
263-
- name: 🐳 Update review/test Docker example image
264-
if: github.ref != 'refs/heads/master' && contains(github.event.head_commit.message, '[deploy test]') && matrix.python-version == '3.8'
265-
run: |
266-
docker tag webviz/example_subsurface_image:equinor-theme ${{ secrets.review_docker_registry_url }}/${{ secrets.review_container_name }}
267-
268-
echo ${{ secrets.review_docker_registry_token }} | docker login ${{ secrets.review_docker_registry_url }} --username ${{ secrets.review_docker_registry_username }} --password-stdin
269-
docker push ${{ secrets.review_docker_registry_url }}/${{ secrets.review_container_name }}
270-
271-
- name: 🚢 Build and deploy Python package
272-
if: github.event_name == 'release' && matrix.python-version == '3.8'
273-
env:
274-
TWINE_USERNAME: __token__
275-
TWINE_PASSWORD: ${{ secrets.pypi_webviz_token }}
276-
run: |
277-
python -m pip install --upgrade setuptools wheel twine
278-
python setup.py sdist bdist_wheel
279-
twine upload dist/*
280-
281-
- name: 📚 Update GitHub pages
282-
if: github.event_name == 'release' && matrix.python-version == '3.8'
283-
run: |
284-
cp -R ./docs_build ../docs_build
285-
286-
git config --local user.email "webviz-github-action"
287-
git config --local user.name "webviz-github-action"
288-
git fetch origin gh-pages
289-
git checkout --track origin/gh-pages
290-
git clean -f -f -d -x
291-
git rm -r *
176+
steps:
177+
- name: 📖 Checkout commit locally
178+
uses: actions/checkout@v2
292179

293-
cp -R ../docs_build/* .
180+
- name: 🐍 Set up Python ${{ matrix.python-version }}
181+
uses: actions/setup-python@v2
182+
with:
183+
python-version: ${{ matrix.python-version }}
294184

295-
git add .
185+
- name: 📦 Install webviz-subsurface with dependencies
186+
run: |
187+
pip install --upgrade pip
188+
pip install "bleach<5" # https://github.com/equinor/webviz-config/issues/586
189+
pip install "werkzeug<2.1" # ...while waiting for https://github.com/plotly/dash/issues/1992
190+
pip install "selenium<4.3" # breaking change in selenium==4.3
191+
pip install "scipy<1.9.3" # breaking change in scipy==1.9.3
192+
pip install "pytest<7.2.0"
193+
pip install "pytest-xdist<3.0"
194+
pip install "xtgeo<2.20.2"
195+
pip install .
296196
297-
if git diff-index --quiet HEAD; then
298-
echo "No changes in documentation. Skip documentation deploy."
299-
else
300-
git commit -m "Update Github Pages"
301-
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
302-
fi
197+
- name: Test import
198+
run: |
199+
import webviz_subsurface
200+
shell: python

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"RelativePermeability = webviz_subsurface.plugins:RelativePermeability",
6161
"ReservoirSimulationTimeSeries = webviz_subsurface.plugins:ReservoirSimulationTimeSeries",
6262
"ReservoirSimulationTimeSeriesOneByOne = webviz_subsurface.plugins:ReservoirSimulationTimeSeriesOneByOne",
63+
"SimulationTimeSeriesOneByOne = webviz_subsurface.plugins:SimulationTimeSeriesOneByOne",
6364
"ReservoirSimulationTimeSeriesRegional = webviz_subsurface.plugins:ReservoirSimulationTimeSeriesRegional",
6465
"RftPlotter = webviz_subsurface.plugins:RftPlotter",
6566
"RunningTimeAnalysisFMU = webviz_subsurface.plugins:RunningTimeAnalysisFMU",

webviz_subsurface/plugins/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
from ._segy_viewer import SegyViewer
5252
from ._seismic_misfit import SeismicMisfit
5353
from ._simulation_time_series import SimulationTimeSeries
54-
from ._simulation_timeseries_onebyone import ReservoirSimulationTimeSeriesOneByOne
54+
from ._simulation_timeseries_onebyone import SimulationTimeSeriesOneByOne
55+
from ._reservoir_simulation_timeseries_onebyone import (
56+
ReservoirSimulationTimeSeriesOneByOne,
57+
)
5558
from ._structural_uncertainty import StructuralUncertainty
5659
from ._subsurface_map import SubsurfaceMap
5760
from ._surface_viewer_fmu import SurfaceViewerFMU

webviz_subsurface/plugins/_parameter_analysis/controllers/parameter_response_controller.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ def _update_graphs(
131131

132132
# Make timeseries graph
133133
param_df = parametermodel.get_parameter_df_for_ensemble(
134-
ensemble, reals=realizations)
135-
134+
ensemble, reals=realizations
135+
)
136+
136137
timeseries_fig = TimeSeriesFigure(
137138
dframe=merge_dataframes_on_realization(
138139
vector_df[["DATE", "REAL", vector]], param_df[["REAL", parameter]]

0 commit comments

Comments
 (0)