Skip to content

Commit

Permalink
Merge Everest into ert
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Sep 9, 2024
1 parent 2d21583 commit fa4f6ab
Show file tree
Hide file tree
Showing 271 changed files with 28,597 additions and 22 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/mac-run-tests-build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: macos-run-tests-build-docs

on:
pull_request:
workflow_dispatch:
push:
branches:
- main
tags: "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
NO_PROJECT_RES: 1

jobs:
tests:
if: github.ref_type == 'tag' # only build for mac when tags
name: "py-${{ matrix.python-version }}_${{ matrix.test_type }}_ert-${{ matrix.ert_version }}_${{ matrix.os }}"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
os: ['macos-13', 'macos-14', 'macos-14-large']
# https://github.com/actions/runner-images/tree/main?tab=readme-ov-file#available-images
exclude:
- os: 'macos-14'
python-version: '3.8'
- os: 'macos-14-large'
python-version: '3.8'
- os: 'macos-13'
python-version: '3.12'

test_type: ['doc', 'test', 'integration-test', 'everest-models-test']
ert_version: ['release', 'main']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
pyproject.toml
- name: Install HDF5 source files
run: brew install hdf5

- name: Install Everest and dependencies
run: |
pip install .[test,docs, everest]
- name: Install latest ert main
if: matrix.ert_version == 'main'
run: |
pip install git+https://github.com/equinor/ert.git
- name: Run Tests
if: matrix.test_type == 'test'
run: |
python -m pytest tests/everest -n 4 -m "not ui_test and not integration_test and not fails_on_macos_github_workflow" --dist loadgroup
- name: Run Integration Tests
if: matrix.test_type == 'integration-test'
run: |
python -m pytest tests/everest -n 4 -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
- name: Build Documentation
if: matrix.test_type == 'doc'
run: |
pip install git+https://github.com/equinor/everest-models.git
mkdir tmp
sphinx-build -W -b html -d tmp/doctrees docs/source {envtmpdir}/html
- name: Run tests requiring everest-models
if: matrix.test_type == 'everest-models-test'
run: |
pip install git+https://github.com/equinor/everest-models.git
python -m pytest tests/everest -n 4 -m everest_models_test --dist loadgroup
79 changes: 79 additions & 0 deletions .github/workflows/run-tests-build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: run-tests-build-docs

on:
pull_request:
workflow_dispatch:
push:
branches:
- main
tags: "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
ERT_SHOW_BACKTRACE: 1
NO_PROJECT_RES: 1

jobs:
tests:
name: "py_${{ matrix.python-version }}_ert-${{ matrix.ert_version }}_${{ matrix.test_type }}"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.11', '3.12']
os: [ubuntu-22.04]
test_type: ['doc', 'ui-test', 'test', 'integration-test', 'everest-models-test']
ert_version: ['release', 'main']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install Everest and dependencies
run: |
pip install .[test,docs]
- name: Install latest ert main
if: matrix.ert_version == 'main'
run: |
sudo apt-get install build-essential
pip install git+https://github.com/equinor/ert.git
- name: Run Tests
if: matrix.test_type == 'test'
run: |
pytest tests -n 4 -m "not ui_test and not integration_test" --dist loadgroup -sv
- name: Run Integration Tests
if: matrix.test_type == 'integration-test'
run: |
pytest tests -n 4 -m "integration_test" --dist loadgroup
- name: Run UI Tests
if: matrix.test_type == 'ui-test'
env:
QT_QPA_PLATFORM: 'minimal'
run: |
python -m pytest -m "ui_test"
- name: Build Documentation
if: matrix.test_type == 'doc'
run: |
pip install git+https://github.com/equinor/everest-models.git
mkdir tmp
sphinx-build -W -b html -d tmp/doctrees docs/source {envtmpdir}/html
- name: Run tests requiring everest-models
if: matrix.test_type == 'everest-models-test'
run: |
pip install git+https://github.com/equinor/everest-models.git
python -m pytest tests -n 4 -m everest_models_test --dist loadgroup
6 changes: 3 additions & 3 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ jobs:
- name: Test GUI
if: inputs.test-type == 'gui-test'
run: |
pytest tests --junit-xml=junit.xml -v --mpl -m "requires_window_manager" --benchmark-disable
pytest tests --junit-xml=junit.xml -v --mpl -m "requires_window_manager" --benchmark-disable --ignore=everest
- name: Unit Test
if: inputs.test-type == 'unit-tests'
run: |
pytest tests --junit-xml=junit.xml -n logical --show-capture=stderr -v -m "not integration_test and not requires_window_manager" --benchmark-disable --dist loadgroup
pytest tests --junit-xml=junit.xml -n logical --show-capture=stderr -v -m "not integration_test and not requires_window_manager" --benchmark-disable --dist loadgroup --ignore=everest
- name: Integration Test
if: inputs.test-type == 'integration-tests'
run: |
pytest tests --junit-xml=junit.xml -n logical --show-capture=stderr -v -m "integration_test and not requires_window_manager" --benchmark-disable
pytest tests --junit-xml=junit.xml -n logical --show-capture=stderr -v -m "integration_test and not requires_window_manager" --benchmark-disable --ignore=everest
- name: Test for a clean repository
run: |
Expand Down
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,31 @@ types = [
"types-tqdm",
"types-psutil"
]
everest = [
"python-dateutil",
"Jinja2>=2.10",
"matplotlib",
"pandas",
"progressbar2",
"pydantic",
"ruamel.yaml",
"seaborn",
"flask",
"cryptography",
"dnspython",
"qtpy",
"pluggy",
"decorator",
"resdata",
"ert>=10.2.0b12",
"PyQt5",
"colorama",
"numpy<2",
"ropt[pandas]<0.6",
"ropt-dakota<0.6",
"seba-sqlite",
"setuptools; python_version >= '3.12'",
]

[tool.setuptools]
platforms = ["all"]
Expand All @@ -144,6 +169,12 @@ markers = [
"requires_window_manager",
"script",
"slow",
"everest_models_test",
"integration_test",
"simulation_test",
"ui_test",
"redundant_test",
"fails_on_macos_github_workflow", # Tests marked fail due to gui-related issues
]
log_cli = "false"
asyncio_mode = "auto"
Expand Down
45 changes: 45 additions & 0 deletions src/everest/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
This is the main Everest module.
"""

from .loader import load

try:
from .version import version

__version__ = version
except ImportError:
__version__ = "0.0.0"

from everest import detached, docs, jobs, templates, util
from everest.bin.utils import export_to_csv, export_with_progress
from everest.config_keys import ConfigKeys
from everest.export import MetaDataColumnNames, export, filter_data, validate_export
from everest.suite import ( # flake8: noqa F401
SIMULATOR_END,
SIMULATOR_START,
SIMULATOR_UPDATE,
start_optimization,
)

__author__ = "Equinor ASA and TNO"
__all__ = [
"load",
"start_optimization",
"SIMULATOR_START",
"SIMULATOR_UPDATE",
"SIMULATOR_END",
"ConfigKeys",
"export",
"export_with_progress",
"export_to_csv",
"validate_export",
"filter_data",
"MetaDataColumnNames",
"detached",
"docs",
"jobs",
"templates",
"util",
]
3 changes: 3 additions & 0 deletions src/everest/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from everest.api.everest_data_api import EverestDataAPI

__all__ = ["EverestDataAPI"]
Loading

0 comments on commit fa4f6ab

Please sign in to comment.