Skip to content

Commit 34af2ec

Browse files
authored
Add missing docstrings, remove pydocstyle skips (#667)
* docs in codegeneration * docstrings * docstyle * flake * docs in demos * doc
1 parent c080573 commit 34af2ec

84 files changed

Lines changed: 632 additions & 373 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

demo/BiharmonicHHJ.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Copyright (C) 2016 Lizao Li
2-
#
3-
# The bilinear form a(u, v) and linear form L(v) for
4-
# Biharmonic equation in Hellan-Herrmann-Johnson (HHJ)
5-
# formulation.
2+
"""Biharmonis HHJ demo.
3+
4+
The bilinear form a(u, v) and linear form L(v) for Biharmonic equation
5+
in Hellan-Herrmann-Johnson (HHJ) formulation.
6+
"""
7+
68
import basix.ufl
79
from ufl import (Coefficient, FacetNormal, FunctionSpace, Mesh, TestFunctions,
810
TrialFunctions, dot, dS, ds, dx, grad, inner, jump)
@@ -20,6 +22,7 @@
2022

2123

2224
def b(sigma, v):
25+
"""The form b."""
2326
n = FacetNormal(domain)
2427
return inner(sigma, grad(grad(v))) * dx \
2528
- dot(dot(sigma('+'), n('+')), n('+')) * jump(grad(v), n) * dS \

demo/BiharmonicRegge.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Copyright (C) 2016 Lizao Li
2-
#
3-
# The bilinear form a(u, v) and linear form L(v) for
4-
# Biharmonic equation in Regge formulation.
2+
"""Biharmonic Regge demo.
3+
4+
The bilinear form a(u, v) and linear form L(v) for Biharmonic equation in Regge formulation.
5+
"""
56
import basix.ufl
67
from ufl import (Coefficient, FacetNormal, FunctionSpace, Identity, Mesh,
78
TestFunctions, TrialFunctions, dot, dS, ds, dx, grad, inner,
@@ -20,10 +21,12 @@
2021

2122

2223
def S(mu):
24+
"""The form S."""
2325
return mu - Identity(3) * tr(mu)
2426

2527

2628
def b(mu, v):
29+
"""The form b."""
2730
n = FacetNormal(domain)
2831
return inner(S(mu), grad(grad(v))) * dx \
2932
- dot(dot(S(mu('+')), n('+')), n('+')) * jump(grad(v), n) * dS \

demo/CellGeometry.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Copyright (C) 2013 Martin S. Alnaes
2-
#
3-
# A functional M involving a bunch of cell geometry quantities.
2+
"""Cell geometry demo.
3+
4+
A functional M involving a bunch of cell geometry quantities.
5+
"""
6+
47
import basix.ufl
58
from ufl import (CellVolume, Circumradius, Coefficient, FacetArea, FacetNormal,
69
FunctionSpace, Mesh, SpatialCoordinate, TrialFunction, ds, dx)

demo/ComplexPoisson.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
#
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with FFCx. If not, see <http://www.gnu.org/licenses/>.
17-
#
18-
# The bilinear form a(u, v) and linear form L(v) for
19-
# Poisson's equation using bilinear elements on bilinear mesh geometry.
17+
"""Complex Poisson demo.
18+
19+
The bilinear form a(u, v) and linear form L(v) for
20+
Poisson's equation using bilinear elements on bilinear mesh geometry.
21+
"""
22+
2023
import basix.ufl
2124
from ufl import (Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction,
2225
dx, grad, inner)

demo/Components.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
#
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with FFCx. If not, see <http://www.gnu.org/licenses/>.
17-
#
18-
# This example demonstrates how to create vectors component-wise
17+
"""Components demo.
18+
19+
This example demonstrates how to create vectors component-wise.
20+
"""
21+
1922
import basix.ufl
2023
from ufl import (Coefficient, FunctionSpace, Mesh, TestFunction, as_vector, dx,
2124
inner)

demo/Conditional.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
#
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with FFCx. If not, see <http://www.gnu.org/licenses/>.
17-
#
18-
# Illustration on how to use Conditional to define a source term
17+
"""Conditional demo.
18+
19+
Illustration on how to use Conditional to define a source term.
20+
"""
21+
1922
import basix.ufl
2023
from ufl import (And, Constant, FunctionSpace, Mesh, Not, Or,
2124
SpatialCoordinate, TestFunction, conditional, dx, ge, gt,

demo/ExpressionInterpolation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
#
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with FFC. If not, see <http://www.gnu.org/licenses/>.
17-
#
18-
# Defines an Expression which evaluates the several different functions at
19-
# a set of interpolation points
17+
"""Expression interpolation demo.
18+
19+
Defines an Expression which evaluates the several different functions at
20+
a set of interpolation points.
21+
"""
2022

2123
import basix
2224
import basix.ufl

demo/FacetIntegrals.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with FFCx. If not, see <http://www.gnu.org/licenses/>.
17-
#
18-
# First added: 2009-03-20
19-
# Last changed: 2011-03-08
20-
#
21-
# Simple example of a form defined over exterior and interior facets.
17+
"""Facet integrals demo.
18+
19+
Simple example of a form defined over exterior and interior facets.
20+
"""
21+
2222
import basix.ufl
2323
from ufl import (FacetNormal, FunctionSpace, Mesh, TestFunction, TrialFunction,
2424
avg, ds, dS, grad, inner, jump)

demo/FacetRestrictionAD.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
#
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with FFCx. If not, see <http://www.gnu.org/licenses/>.
17+
"""Facet restriction demo."""
18+
1719
import basix.ufl
1820
from ufl import (Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction,
19-
avg, derivative, dot, dS, dx, grad, inner)
21+
avg, derivative, dS, dx, grad, inner)
2022

2123
element = basix.ufl.element("Discontinuous Lagrange", "triangle", 1)
2224
domain = Mesh(basix.ufl.element("Lagrange", "triangle", 1, shape=(2, )))

demo/HyperElasticity.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
#
21
# Author: Martin Sandve Alnes
32
# Date: 2008-12-22
4-
#
3+
# Modified by Garth N. Wells, 2009
4+
"""Hyper-elasticity demo."""
55

66
import basix.ufl
7-
# Modified by Garth N. Wells, 2009
87
from ufl import (Coefficient, Constant, FacetNormal, FunctionSpace, Identity,
98
Mesh, SpatialCoordinate, TestFunction, TrialFunction,
10-
derivative, det, diff, dot, ds, dx, exp, grad, inner, inv,
9+
derivative, det, diff, ds, dx, exp, grad, inner, inv,
1110
tetrahedron, tr, variable)
1211

1312
# Cell and its properties

0 commit comments

Comments
 (0)