Skip to content

Commit d34f787

Browse files
committed
rename convert_int_g_to_base -> rewrite_int_g_using_base_kernel
1 parent 106816f commit d34f787

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

doc/symbolic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ Rewriting expressions with IntGs internals
7272
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7373

7474
.. automethod:: pytential.symbolic.pde.system_utils.convert_target_transformation_to_source
75-
.. automethod:: pytential.symbolic.pde.system_utils.convert_int_g_to_base
75+
.. automethod:: pytential.symbolic.pde.system_utils.rewrite_int_g_using_base_kernel
7676

pytential/symbolic/pde/system_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
as gnitstam)
3333

3434
from pytential.symbolic.primitives import (NodeCoordinateComponent,
35-
hashable_kernel_args, IntG, as_dofdesc, TAG_WITH_DEFAULT_SOURCE)
35+
hashable_kernel_args, IntG, TAG_WITH_DEFAULT_SOURCE)
3636
from pytential.symbolic.mappers import IdentityMapper
3737
from pytential.utils import chop, lu_with_post_division_callback
3838
import pytential
@@ -103,7 +103,7 @@ def map_int_g(self, expr):
103103
new_int_gs = convert_target_transformation_to_source(expr)
104104
# Convert IntGs with different kernels to expressions containing
105105
# IntGs with base_kernel or its derivatives
106-
return sum(convert_int_g_to_base(new_int_g,
106+
return sum(rewrite_int_g_using_base_kernel(new_int_g,
107107
self.base_kernel) for new_int_g in new_int_gs)
108108

109109

@@ -273,22 +273,22 @@ def _multiply_int_g(int_g: IntG, expr_multiplier: sym.Basic,
273273
return result
274274

275275

276-
def convert_int_g_to_base(int_g: IntG, base_kernel: ExpressionKernel) \
276+
def rewrite_int_g_using_base_kernel(int_g: IntG, base_kernel: ExpressionKernel) \
277277
-> ExpressionT:
278-
"""Converts an *IntG* to an expression with *IntG*s having the
278+
"""Rewrite an *IntG* to an expression with *IntG*s having the
279279
base kernel *base_kernel*.
280280
"""
281281
result = 0
282282
for knl, density in zip(int_g.source_kernels, int_g.densities):
283-
result += _convert_int_g_to_base(
283+
result += _rewrite_int_g_using_base_kernel(
284284
int_g.copy(source_kernels=(knl,), densities=(density,)),
285285
base_kernel)
286286
return result
287287

288288

289-
def _convert_int_g_to_base(int_g: IntG, base_kernel: ExpressionKernel) \
289+
def _rewrite_int_g_using_base_kernel(int_g: IntG, base_kernel: ExpressionKernel) \
290290
-> ExpressionT:
291-
"""Converts an *IntG* with only one source kernel to an expression with *IntG*s
291+
"""Rewrites an *IntG* with only one source kernel to an expression with *IntG*s
292292
having the base kernel *base_kernel*.
293293
"""
294294
target_kernel = int_g.target_kernel.replace_base_kernel(base_kernel)

test/test_pde_system_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"""
2020

2121
from pytential.symbolic.pde.system_utils import (
22-
convert_target_transformation_to_source, convert_int_g_to_base)
22+
convert_target_transformation_to_source, rewrite_int_g_using_base_kernel)
2323
from pytential.symbolic.primitives import IntG
2424
from pytential.symbolic.primitives import NodeCoordinateComponent
2525
import pytential
@@ -130,7 +130,8 @@ def test_convert_int_g_base():
130130
IntG(base_knl, [AxisSourceDerivative(d, AxisSourceDerivative(d, base_knl))],
131131
[-1], qbx_forced_limit=1) for d in range(3))
132132

133-
assert expected_int_g == convert_int_g_to_base(int_g, base_kernel=base_knl)
133+
assert expected_int_g == rewrite_int_g_using_base_kernel(int_g,
134+
base_kernel=base_knl)
134135

135136

136137
def test_convert_int_g_base_with_const():
@@ -147,7 +148,8 @@ def test_convert_int_g_base_with_const():
147148
IntG(base_knl,
148149
[AxisSourceDerivative(1, AxisSourceDerivative(1, base_knl))], [0.5],
149150
qbx_forced_limit=1)
150-
assert convert_int_g_to_base(int_g, base_kernel=base_knl) == expected_int_g
151+
assert rewrite_int_g_using_base_kernel(int_g,
152+
base_kernel=base_knl) == expected_int_g
151153

152154

153155
def test_convert_int_g_base_with_const_and_deriv():
@@ -160,4 +162,5 @@ def test_convert_int_g_base_with_const_and_deriv():
160162
[AxisSourceDerivative(1, AxisSourceDerivative(1,
161163
AxisSourceDerivative(0, base_knl)))], [0.5],
162164
qbx_forced_limit=1)
163-
assert convert_int_g_to_base(int_g, base_kernel=base_knl) == expected_int_g
165+
assert rewrite_int_g_using_base_kernel(int_g,
166+
base_kernel=base_knl) == expected_int_g

0 commit comments

Comments
 (0)