Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ksagiyam/merge_upst…
Browse files Browse the repository at this point in the history
…ream
  • Loading branch information
ksagiyam committed Feb 24, 2023
2 parents 13435fb + 2d3992d commit f4babc4
Show file tree
Hide file tree
Showing 98 changed files with 2,354 additions and 1,259 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
branches:
- "**"
tags:
- "v*"
- "**"
pull_request:
branches:
- main
Expand Down
6 changes: 5 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# future
[metadata]
name = fenics-ufl
version = 2022.3.0.dev0
version = 2023.2.0.dev0
author = FEniCS Project Contributors
email = [email protected]
maintainer = FEniCS Project Steering Council
Expand Down Expand Up @@ -59,6 +59,10 @@ ci =

[flake8]
ignore = E501, W504,
# Line break before operator, no longer PEP8.
W503,
# Indentation, can trigger for valid code.
E129,
# ambiguous variable name
E741
builtins = ufl
Expand Down
2 changes: 1 addition & 1 deletion test/test_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from pprint import *

from ufl import (FiniteElement, TestFunction, TrialFunction, triangle,
from ufl import (FiniteElement, TestFunction, TrialFunction, Matrix, triangle,
div, grad, Argument, dx, adjoint, Coefficient,
FacetNormal, inner, dot, ds)
from ufl.algorithms import (extract_arguments, expand_derivatives,
Expand Down
6 changes: 3 additions & 3 deletions test/test_apply_restrictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def test_apply_restrictions():
n = FacetNormal(cell)
x = SpatialCoordinate(cell)

assert raises(UFLException, lambda: apply_restrictions(f0))
assert raises(UFLException, lambda: apply_restrictions(grad(f)))
assert raises(UFLException, lambda: apply_restrictions(n))
assert raises(BaseException, lambda: apply_restrictions(f0))
assert raises(BaseException, lambda: apply_restrictions(grad(f)))
assert raises(BaseException, lambda: apply_restrictions(n))

# Continuous function gets default restriction if none
# provided otherwise the user choice is respected
Expand Down
4 changes: 2 additions & 2 deletions test/test_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ def test_remove_complex_nodes(self):

assert remove_complex_nodes(a) == v
assert remove_complex_nodes(b) == u
with pytest.raises(ufl.log.UFLException):
with pytest.raises(BaseException):
remove_complex_nodes(c)
with pytest.raises(ufl.log.UFLException):
with pytest.raises(BaseException):
remove_complex_nodes(d)


Expand Down
10 changes: 5 additions & 5 deletions test/test_conditionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def g():
def test_conditional_does_not_allow_bool_condition(f, g):
# The reason for this test is that it protects from the case
# conditional(a == b, t, f) in which a == b means comparing representations
with pytest.raises(UFLException):
with pytest.raises(BaseException):
conditional(True, 1, 0)


Expand Down Expand Up @@ -123,7 +123,7 @@ def test_lt_produces_ufl_expr(f, g):
# Representations are the same:
assert bool(expr1 == expr2)
# Protection from misuse in boolean python expression context:
with pytest.raises(UFLException):
with pytest.raises(BaseException):
bool(expr1)


Expand All @@ -136,7 +136,7 @@ def test_gt_produces_ufl_expr(f, g):
# Representations are the same:
assert bool(expr1 == expr2)
# Protection from misuse in boolean python expression context:
with pytest.raises(UFLException):
with pytest.raises(BaseException):
bool(expr1)


Expand All @@ -149,7 +149,7 @@ def test_le_produces_ufl_expr(f, g):
# Representations are the same:
assert bool(expr1 == expr2)
# Protection from misuse in boolean python expression context:
with pytest.raises(UFLException):
with pytest.raises(BaseException):
bool(expr1)


Expand All @@ -162,5 +162,5 @@ def test_ge_produces_ufl_expr(f, g):
# Representations are the same:
assert bool(expr1 == expr2)
# Protection from misuse in boolean python expression context:
with pytest.raises(UFLException):
with pytest.raises(BaseException):
bool(expr1)
16 changes: 8 additions & 8 deletions test/test_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ def test_join_domains():
assert 2 == len(join_domains([Mesh(xa), Mesh(xb)]))

# Incompatible cells require labeling
# self.assertRaises(UFLException, lambda: join_domains([Mesh(triangle), Mesh(triangle3)])) # FIXME: Figure out
# self.assertRaises(UFLException, lambda: join_domains([Mesh(triangle),
# self.assertRaises(BaseException, lambda: join_domains([Mesh(triangle), Mesh(triangle3)])) # FIXME: Figure out
# self.assertRaises(BaseException, lambda: join_domains([Mesh(triangle),
# Mesh(quadrilateral)])) # FIXME: Figure out

# Incompatible coordinates require labeling
xc = Coefficient(FunctionSpace(Mesh(triangle), VectorElement("CG", triangle, 1)))
xd = Coefficient(FunctionSpace(Mesh(triangle), VectorElement("CG", triangle, 1)))
with pytest.raises(UFLException):
with pytest.raises(BaseException):
join_domains([Mesh(xc), Mesh(xd)])

# Incompatible data is checked if and only if the domains are the same
Expand All @@ -167,14 +167,14 @@ def test_join_domains():
assert 2 == len(join_domains([Mesh(triangle, ufl_id=7, cargo=mesh7),
Mesh(quadrilateral, ufl_id=8, cargo=mesh8)]))
# Geometric dimensions must match
with pytest.raises(UFLException):
with pytest.raises(BaseException):
join_domains([Mesh(triangle),
Mesh(triangle3)])
with pytest.raises(UFLException):
with pytest.raises(BaseException):
join_domains([Mesh(triangle, ufl_id=7, cargo=mesh7),
Mesh(triangle3, ufl_id=8, cargo=mesh8)])
# Cargo and mesh ids must match
with pytest.raises(UFLException):
with pytest.raises(BaseException):
Mesh(triangle, ufl_id=7, cargo=mesh8)

# Nones are removed
Expand Down Expand Up @@ -284,8 +284,8 @@ def xtest_mixed_elements_on_overlapping_regions(): # Old sketch, not working
# data.

# These should fail because the functions are undefined on the integration domains
# self.assertRaises(UFLException, lambda: mr**2*dx(DD)) # FIXME: Make this fail
# self.assertRaises(UFLException, lambda: mr**2*dx(DD)) # FIXME: Make this
# self.assertRaises(BaseException, lambda: mr**2*dx(DD)) # FIXME: Make this fail
# self.assertRaises(BaseException, lambda: mr**2*dx(DD)) # FIXME: Make this
# fail


Expand Down
Loading

0 comments on commit f4babc4

Please sign in to comment.