Skip to content

Commit

Permalink
Run isort (#2804)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhale authored Oct 4, 2023
1 parent c72113a commit f88ca65
Show file tree
Hide file tree
Showing 39 changed files with 136 additions and 95 deletions.
1 change: 1 addition & 0 deletions python/demo/demo_lagrange_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from ufl import ds, dx, grad, inner

from mpi4py import MPI

# -

# Note that Basix and the Basix UFL wrapper are imported directly. Basix
Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_assemble_cppimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
import pybind11
import pytest
import scipy.sparse.linalg

import dolfinx.pkgconfig
import ufl
from dolfinx.fem import (FunctionSpace, assemble_matrix, dirichletbc, form,
locate_dofs_geometrical)
from dolfinx.mesh import create_unit_square
from dolfinx.wrappers import get_include_path as pybind_inc
from mpi4py import MPI

import dolfinx.pkgconfig
from mpi4py import MPI


@pytest.mark.skip_in_parallel
Expand Down
7 changes: 4 additions & 3 deletions python/test/unit/fem/test_assemble_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@

import numpy as np
import pytest

import ufl
from dolfinx import cpp as _cpp
from dolfinx import default_scalar_type, fem, la
from dolfinx.fem import (Constant, Function, FunctionSpace, assemble_scalar,
dirichletbc, form)
from dolfinx.mesh import (GhostMode, Mesh, create_unit_square, locate_entities,
locate_entities_boundary, meshtags,
meshtags_from_entities)
from mpi4py import MPI

from dolfinx import cpp as _cpp
from dolfinx import default_scalar_type, fem, la
from mpi4py import MPI


@pytest.fixture
Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_assemble_submesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

import numpy as np
import pytest

import ufl
from dolfinx import default_scalar_type, fem, la
from dolfinx.mesh import (GhostMode, create_box, create_rectangle,
create_submesh, create_unit_cube, create_unit_square,
locate_entities, locate_entities_boundary)
from mpi4py import MPI

from dolfinx import default_scalar_type, fem, la
from mpi4py import MPI


def assemble(mesh, space, k):
Expand Down
11 changes: 6 additions & 5 deletions python/test/unit/fem/test_assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

import math

import basix
import numpy as np
import pytest
import scipy.sparse

import basix
import ufl
from basix.ufl import element, mixed_element
from dolfinx import cpp as _cpp
from dolfinx import default_real_type, fem, graph, la
from dolfinx.fem import (Constant, Function, FunctionSpace, assemble_scalar,
bcs_by_block, dirichletbc, extract_function_spaces,
form, locate_dofs_geometrical,
Expand All @@ -34,13 +37,11 @@
from dolfinx.mesh import (CellType, GhostMode, create_mesh, create_rectangle,
create_unit_cube, create_unit_square,
locate_entities_boundary)
from mpi4py import MPI
from petsc4py import PETSc
from ufl import derivative, ds, dx, inner
from ufl.geometry import SpatialCoordinate

from dolfinx import cpp as _cpp
from dolfinx import default_real_type, fem, graph, la
from mpi4py import MPI
from petsc4py import PETSc


def nest_matrix_norm(A):
Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@

import numpy as np
import pytest

import ufl
from basix.ufl import element, mixed_element
from dolfinx import default_real_type, default_scalar_type, la
from dolfinx.fem import (Constant, Function, FunctionSpace, apply_lifting,
assemble_matrix, assemble_vector, create_matrix,
create_vector, dirichletbc, form,
locate_dofs_geometrical, locate_dofs_topological,
set_bc)
from dolfinx.mesh import (CellType, create_unit_cube, create_unit_square,
locate_entities_boundary)
from mpi4py import MPI
from ufl import dx, inner

from dolfinx import default_real_type, default_scalar_type, la
from mpi4py import MPI


def test_locate_dofs_geometrical():
Expand Down
7 changes: 4 additions & 3 deletions python/test/unit/fem/test_custom_jit_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@

import numpy as np
import pytest
from dolfinx.fem import Form, Function, FunctionSpace, IntegralType
from dolfinx.mesh import create_unit_square
from mpi4py import MPI

import dolfinx
from dolfinx import TimingType
from dolfinx import cpp as _cpp
from dolfinx import (default_real_type, default_scalar_type, fem, la,
list_timings)
from dolfinx.fem import Form, Function, FunctionSpace, IntegralType
from dolfinx.mesh import create_unit_square

from mpi4py import MPI

numba = pytest.importorskip("numba")

Expand Down
11 changes: 7 additions & 4 deletions python/test/unit/fem/test_discrete_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
"""Unit tests for the DiscreteOperator class"""

import numpy as np
import scipy
import pytest
import scipy

import dolfinx.la
import ufl
from dolfinx.cpp.fem import discrete_gradient
from dolfinx.fem import (Expression, Function, FunctionSpace)
import dolfinx.la
from dolfinx.mesh import (CellType, GhostMode, create_unit_cube, create_unit_square)
from dolfinx.fem import Expression, Function, FunctionSpace
from dolfinx.mesh import (CellType, GhostMode, create_unit_cube,
create_unit_square)

from mpi4py import MPI


Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_dof_permuting.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

import numpy as np
import pytest

import ufl
from basix.ufl import element
from dolfinx import default_real_type
from dolfinx.fem import Function, FunctionSpace, assemble_scalar, form
from dolfinx.mesh import create_mesh
from mpi4py import MPI

from dolfinx import default_real_type
from mpi4py import MPI


def randomly_ordered_mesh(cell_type):
Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_element_integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@

import numpy as np
import pytest

import dolfinx
import ufl
from basix.ufl import element
from dolfinx.fem import (Constant, Function, FunctionSpace, assemble_matrix,
assemble_scalar, assemble_vector, form)
from dolfinx.mesh import CellType, create_mesh, meshtags
from mpi4py import MPI

import dolfinx
from mpi4py import MPI

parametrize_cell_types = pytest.mark.parametrize(
"cell_type",
Expand Down
9 changes: 5 additions & 4 deletions python/test/unit/fem/test_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
#
# SPDX-License-Identifier: LGPL-3.0-or-later

import basix
import numpy as np
import pytest

import basix
import dolfinx.cpp
import ufl
from basix.ufl import blocked_element
from dolfinx import fem, la
from dolfinx.fem import Constant, Expression, Function, FunctionSpace, form
from dolfinx.mesh import create_unit_square
from ffcx.element_interface import QuadratureElement
from mpi4py import MPI

import dolfinx.cpp
from dolfinx import fem, la
from mpi4py import MPI

dolfinx.cpp.common.init_logging(["-v"])

Expand Down
9 changes: 5 additions & 4 deletions python/test/unit/fem/test_fem_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

from pathlib import Path

import basix
import numpy as np
import pytest

import basix
import ufl
from basix.ufl import element, mixed_element
from dolfinx import default_real_type
from dolfinx.fem import (Function, FunctionSpace, assemble_scalar, dirichletbc,
form, locate_dofs_topological)
from dolfinx.fem.petsc import (apply_lifting, assemble_matrix, assemble_vector,
Expand All @@ -19,12 +21,11 @@
from dolfinx.mesh import (CellType, create_rectangle, create_unit_cube,
create_unit_square, exterior_facet_indices,
locate_entities_boundary)
from mpi4py import MPI
from petsc4py import PETSc
from ufl import (CellDiameter, FacetNormal, SpatialCoordinate, TestFunction,
TrialFunction, avg, div, ds, dS, dx, grad, inner, jump)

from dolfinx import default_real_type
from mpi4py import MPI
from petsc4py import PETSc


def run_scalar_test(mesh, V, degree):
Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
import cffi
import numpy as np
import pytest

import ufl
from basix.ufl import element, mixed_element
from dolfinx import default_real_type, la
from dolfinx.fem import Function, FunctionSpace
from dolfinx.geometry import (bb_tree, compute_colliding_cells,
compute_collisions_points)
from dolfinx.mesh import create_mesh, create_unit_cube
from mpi4py import MPI

from dolfinx import default_real_type, la
from mpi4py import MPI


@pytest.fixture
Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_function_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
# import basix
import numpy as np
import pytest

from basix.ufl import element, mixed_element
from dolfinx import default_real_type
from dolfinx.fem import Function, FunctionSpace, FunctionSpaceBase
from dolfinx.mesh import create_mesh, create_unit_cube
from mpi4py import MPI
from ufl import Cell, Mesh, TestFunction, TrialFunction, grad

from dolfinx import default_real_type
from mpi4py import MPI


@pytest.fixture
Expand Down
7 changes: 4 additions & 3 deletions python/test/unit/fem/test_ghost_mesh_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Unit tests for assembly"""

import numpy as np
import pytest

import ufl
import numpy as np
from dolfinx import fem, la
from dolfinx.fem import Function, FunctionSpace, form
from dolfinx.mesh import GhostMode, create_unit_square
from mpi4py import MPI
from ufl import avg, inner

from dolfinx import fem, la
from mpi4py import MPI


def dx_from_ufl(mesh):
Expand Down
7 changes: 4 additions & 3 deletions python/test/unit/fem/test_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@

import random

import basix
import numpy as np
import pytest

import basix
import ufl
from basix.ufl import (blocked_element, custom_element, element,
enriched_element, mixed_element)
from dolfinx import default_real_type
from dolfinx.fem import (Expression, Function, FunctionSpace, assemble_scalar,
create_nonmatching_meshes_interpolation_data, form)
from dolfinx.geometry import bb_tree, compute_collisions_points
from dolfinx.mesh import (CellType, create_mesh, create_rectangle,
create_unit_cube, create_unit_square,
locate_entities, locate_entities_boundary, meshtags)
from mpi4py import MPI

from dolfinx import default_real_type
from mpi4py import MPI

parametrize_cell_types = pytest.mark.parametrize(
"cell_type", [
Expand Down
5 changes: 3 additions & 2 deletions python/test/unit/fem/test_mixed_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

import numpy as np
import pytest

import dolfinx
import ufl
from basix.ufl import element, mixed_element
from dolfinx.fem import FunctionSpace, form
from dolfinx.mesh import (CellType, GhostMode, create_unit_cube,
create_unit_square)
from mpi4py import MPI

import dolfinx
from mpi4py import MPI


@pytest.mark.skip_in_parallel
Expand Down
4 changes: 3 additions & 1 deletion python/test/unit/fem/test_nonlinear_assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import numpy as np
import pytest

import ufl
from basix.ufl import element, mixed_element
from dolfinx.cpp.la.petsc import scatter_local_vectors
Expand All @@ -25,9 +26,10 @@
set_bc_nest)
from dolfinx.mesh import (GhostMode, create_unit_cube, create_unit_square,
locate_entities_boundary)
from ufl import derivative, dx, inner

from mpi4py import MPI
from petsc4py import PETSc
from ufl import derivative, dx, inner


def nest_matrix_norm(A):
Expand Down
2 changes: 1 addition & 1 deletion python/test/unit/fem/test_special_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import pytest

import ufl
from dolfinx import default_scalar_type
from dolfinx.fem import Constant, assemble_scalar, form
from dolfinx.mesh import (create_unit_cube, create_unit_interval,
create_unit_square)

from mpi4py import MPI
from dolfinx import default_scalar_type


def test_facet_area1D():
Expand Down
2 changes: 1 addition & 1 deletion python/test/unit/fem/test_vector_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

import ufl
from basix.ufl import element
from dolfinx import default_real_type
from dolfinx.fem import Function, FunctionSpace
from dolfinx.mesh import create_mesh

from mpi4py import MPI
from dolfinx import default_real_type


@pytest.mark.skip_in_parallel
Expand Down
Loading

0 comments on commit f88ca65

Please sign in to comment.