Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/workflows/python-test-with-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
run: |
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install -r requirements-test-petsc.txt
- name: Python test
env:
CC: ${{ matrix.compiler }}
Expand Down
2 changes: 1 addition & 1 deletion examples/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ setup:

TEST_OPTS ?= --ceed /cpu/self/ref/serial
test: setup
$(PYTHON) -m pytest ex_test.py $(TEST_OPTS)
$(PYTHON) -m pytest ex_test.py bps_test.py $(TEST_OPTS)

.PHONY: clean setup test
67 changes: 67 additions & 0 deletions examples/python/bps_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env python3
# Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors
# All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
#
# SPDX-License-Identifier: BSD-2-Clause
#
# This file is part of CEED: http://github.com/ceed

import pytest
from argparse import Namespace

# The BP examples use PETSc, unlike ex1-ex3, so skip them where it is unavailable
pytest.importorskip("petsc4py")
import bpsraw # noqa: E402

# -------------------------------------------------------------------------------


def test_bp1_degree_1(ceed_resource):
args = Namespace(
ceed=ceed_resource,
problem='bp1',
degree=1,
q_extra=None,
local=1000,
test=True,
benchmark=False,
write_solution=False,
ksp_max_it_clip=[15, 15],
)
bpsraw.example_bps(args)

# -------------------------------------------------------------------------------


def test_bp1_degree_2(ceed_resource):
args = Namespace(
ceed=ceed_resource,
problem='bp1',
degree=2,
q_extra=None,
local=1000,
test=True,
benchmark=False,
write_solution=False,
ksp_max_it_clip=[15, 15],
)
bpsraw.example_bps(args)

# -------------------------------------------------------------------------------


def test_bp1_degree_3(ceed_resource):
args = Namespace(
ceed=ceed_resource,
problem='bp1',
degree=3,
q_extra=None,
local=1000,
test=True,
benchmark=False,
write_solution=False,
ksp_max_it_clip=[15, 15],
)
bpsraw.example_bps(args)

# -------------------------------------------------------------------------------
Loading
Loading