diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c11ac82..2be64700 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,9 @@ jobs: name: Flake8 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: # matches compat target in setup.py python-version: '3.8' @@ -27,7 +27,7 @@ jobs: name: Pylint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Main Script" run: | echo "- scipy" >> .test-conda-env-py3.yml @@ -39,7 +39,7 @@ jobs: name: Mypy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Main Script" run: | curl -L -O https://tiker.net/ci-support-v0 @@ -52,7 +52,7 @@ jobs: name: Pytest Conda Py3 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Main Script" run: | sudo apt update && sudo apt install octave @@ -124,7 +124,7 @@ jobs: name: Examples Conda Py3 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Main Script" run: | export MPLBACKEND=Agg @@ -141,7 +141,7 @@ jobs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: @@ -176,13 +176,16 @@ jobs: name: Tests for downstream project ${{ matrix.downstream_project }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Main Script" env: DOWNSTREAM_PROJECT: ${{ matrix.downstream_project }} run: | curl -L -O https://tiker.net/ci-support-v0 . ./ci-support-v0 + if [[ "$DOWNSTREAM_PROJECT" == "grudge" && "$GITHUB_HEAD_REF" == "group-constr-drop-index" ]]; then + DOWNSTREAM_PROJECT=https://github.com/inducer/grudge.git@grad-test-overint + fi test_downstream "$DOWNSTREAM_PROJECT" # vim: sw=4 diff --git a/meshmode/discretization/__init__.py b/meshmode/discretization/__init__.py index 6b74eddd..3f5ae457 100644 --- a/meshmode/discretization/__init__.py +++ b/meshmode/discretization/__init__.py @@ -451,13 +451,7 @@ def __init__(self, raise TypeError("'actx' must be an ArrayContext") self.mesh = mesh - groups = [] - for igrp, mg in enumerate(mesh.groups): - # TODO: setting index is deprecated - ng = group_factory(mg, index=igrp) - groups.append(ng) - - self.groups = groups + self.groups = [group_factory(mg) for mg in mesh.groups] self.real_dtype = np.dtype(real_dtype) self.complex_dtype = np.dtype({ diff --git a/test/test_meshmode.py b/test/test_meshmode.py index 846ee00c..b9b93b25 100644 --- a/test/test_meshmode.py +++ b/test/test_meshmode.py @@ -36,7 +36,8 @@ PytestPyOpenCLArrayContextFactory, ]) -from meshmode.mesh import SimplexElementGroup, TensorProductElementGroup +from meshmode.mesh import ( + MeshElementGroup, SimplexElementGroup, TensorProductElementGroup) from meshmode.discretization.poly_element import ( InterpolatoryQuadratureSimplexGroupFactory, default_simplex_group_factory, @@ -914,6 +915,7 @@ def test_mesh_multiple_groups(actx_factory, ambient_dim, visualize=False): mesh.vertices[0, mesh.groups[0].vertex_indices] < 0.0, axis=1).astype(np.int64) mesh = split_mesh_groups(mesh, element_flags) + assert isinstance(mesh, Mesh) assert len(mesh.groups) == 2 # pylint: disable=no-member assert mesh.facial_adjacency_groups @@ -932,10 +934,19 @@ def test_mesh_multiple_groups(actx_factory, ambient_dim, visualize=False): from meshmode.discretization import Discretization - def grp_factory(mesh_el_group, index): + def grp_factory(mesh_el_group: MeshElementGroup): + index = None + + for i, meg in enumerate(mesh.groups): # pylint: disable=no-member + if meg is mesh_el_group: + index = i + + if mesh_el_group.dim == mesh.ambient_dim: + assert index is not None + return default_simplex_group_factory( base_dim=ambient_dim, order=order + 2 if index == 0 else order - )(mesh_el_group, index) + )(mesh_el_group) discr = Discretization(actx, mesh, grp_factory)