ENH: add gridproperty_from_cube #3344
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main, "version-*"] | |
| pull_request: | |
| branches: [main, "version-*"] | |
| release: | |
| types: | |
| - published | |
| schedule: | |
| # Run nightly to check that tests are working with latest dependencies | |
| - cron: "0 0 * * *" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 25 | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| os: [ubuntu-latest] | |
| include: | |
| - os: macos-latest | |
| python-version: "3.11" | |
| - os: macos-latest | |
| python-version: "3.14" | |
| - os: windows-latest | |
| python-version: "3.11" | |
| - os: windows-latest | |
| python-version: "3.14" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup xtgeo | |
| uses: "./.github/actions/setup_xtgeo" | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| os: ${{ matrix.os }} | |
| - name: Setup testdata | |
| uses: "./.github/actions/setup_testdata" | |
| - name: Run tests (Linux/macOS) | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| run: uv run pytest -n 4 tests --disable-warnings --generate-plots | |
| - name: Run tests (Windows, skip plotting due to random TCL/TK issues) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: uv run pytest -n 4 tests --disable-warnings | |
| - name: Test dependency integration | |
| if: ${{ matrix.os != 'macos-latest' | |
| && matrix.python-version != '3.12' | |
| && matrix.python-version != '3.13' | |
| && matrix.python-version != '3.14' }} | |
| run: | | |
| uv pip install openvds # Does not build macOS wheels or 3.12+ (yet) | |
| uv run pytest tests/test_dependency_integration.py | |
| hypothesis: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get install libeigen3-dev libfmt-dev | |
| - name: Setup xtgeo | |
| uses: "./.github/actions/setup_xtgeo" | |
| with: | |
| python-version: "3.11" | |
| - name: Setup testdata | |
| uses: "./.github/actions/setup_testdata" | |
| - name: Run just hypothesis tests with more examples | |
| run: uv run pytest -n 4 tests --disable-warnings -m hypothesis --generate-plots | |
| rms: | |
| name: ${{ matrix.config.name }} | |
| runs-on: ${{ matrix.config.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { | |
| name: "RMS 14.2", | |
| os: ubuntu-latest, | |
| python: 3.11.3, | |
| pip: 23.3.1, | |
| wheel: 0.37.1, | |
| setuptools: 63.4.3, | |
| matplotlib: 3.7.1, | |
| numpy: 1.24.3, | |
| pandas: 2.0.2, | |
| scipy: 1.10.1, | |
| } | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Setup testdata | |
| uses: "./.github/actions/setup_testdata" | |
| - name: Set up Python | |
| run: uv python install ${{ matrix.config.python }} | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get install libeigen3-dev libfmt-dev | |
| - name: Build and install xtgeo | |
| run: | | |
| uv venv | |
| uv pip install pip==${{ matrix.config.pip }} | |
| uv pip install ".[dev]" | |
| uv pip install \ | |
| wheel==${{ matrix.config.wheel }} \ | |
| setuptools==${{ matrix.config.setuptools }} \ | |
| matplotlib==${{ matrix.config.matplotlib }} \ | |
| numpy==${{ matrix.config.numpy }} \ | |
| pandas==${{ matrix.config.pandas }} \ | |
| scipy==${{ matrix.config.scipy }} | |
| - name: List dependencies | |
| run: uv pip freeze | |
| - name: Run tests | |
| run: uv run pytest -n 4 tests --disable-warnings --generate-plots | |
| big: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup xtgeo | |
| uses: "./.github/actions/setup_xtgeo" | |
| with: | |
| python-version: "3.11" | |
| - name: Setup testdata | |
| uses: "./.github/actions/setup_testdata" | |
| - name: Run just tests marked big | |
| run: XTG_BIGTEST=1 uv run pytest -n 4 tests --disable-warnings -m bigtest --generate-plots | |
| codecov: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup xtgeo | |
| uses: "./.github/actions/setup_xtgeo" | |
| with: | |
| python-version: "3.11" | |
| - name: Setup testdata | |
| uses: "./.github/actions/setup_testdata" | |
| - name: Generate coverage report | |
| run: uv run pytest -n 4 tests --doctest-modules --generate-plots --disable-warnings --cov=xtgeo --cov-report=xml:xtgeocoverage.xml; | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: xtgeocoverage.xml | |
| opm-integration: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: "./.github/actions/setup_xtgeo" | |
| with: | |
| python-version: "3.11" | |
| - name: Setup testdata | |
| uses: "./.github/actions/setup_testdata" | |
| - name: Set up OPM | |
| run: | | |
| sudo apt install software-properties-common && | |
| sudo apt-add-repository ppa:opm/ppa && | |
| sudo apt install mpi-default-bin libopm-simulators-bin | |
| - name: Integration test | |
| run: HAS_OPM=1 uv run pytest -m requires_opm --disable-warnings |