Skip to content

Commit

Permalink
dont import symbols from sympy
Browse files Browse the repository at this point in the history
  • Loading branch information
e-moral-sanchez committed Nov 29, 2024
1 parent d523c70 commit dc64c77
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
3 changes: 2 additions & 1 deletion psydac/api/tests/test_2d_mapping_biharmonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from mpi4py import MPI
from sympy import pi, cos, sin, symbols
from sympy.abc import x, y
import pytest
import os
import numpy as np
Expand All @@ -43,6 +42,8 @@
base_dir = os.path.join(base_dir, '..', '..', '..')
mesh_dir = os.path.join(base_dir, 'mesh')
# ...
x,y = symbols('x,y', real=True)

#==============================================================================
def get_boundaries(*args):

Expand Down
3 changes: 2 additions & 1 deletion psydac/api/tests/test_2d_mapping_laplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from mpi4py import MPI
from sympy import pi, cos, sin, symbols
from sympy.abc import x, y
import pytest
import os
import numpy as np
Expand All @@ -43,6 +42,8 @@
base_dir = os.path.join(base_dir, '..', '..', '..')
mesh_dir = os.path.join(base_dir, 'mesh')
# ...
x,y = symbols('x,y', real=True)

#==============================================================================
def get_boundaries(*args):

Expand Down
3 changes: 2 additions & 1 deletion psydac/api/tests/test_2d_mapping_poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import os
from mpi4py import MPI
from sympy import pi, cos, sin, symbols
from sympy.abc import x, y
import pytest
import numpy as np

Expand All @@ -44,6 +43,8 @@
base_dir = os.path.join(base_dir, '..', '..', '..')
mesh_dir = os.path.join(base_dir, 'mesh')

x, y = symbols('x, y', real=True)

# backend to activate multi threading
PSYDAC_BACKEND_GPYCCEL_WITH_OPENMP = PSYDAC_BACKEND_GPYCCEL.copy()
PSYDAC_BACKEND_GPYCCEL_WITH_OPENMP['openmp'] = True
Expand Down
4 changes: 2 additions & 2 deletions psydac/api/tests/test_api_2d_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# coordinates (r, theta), but with reversed order: hence x1=theta and x2=r

from mpi4py import MPI
from sympy import pi, cos, sin, log, exp, lambdify
from sympy.abc import x, y
from sympy import pi, cos, sin, log, exp, lambdify, symbols
import pytest
import os

Expand Down Expand Up @@ -46,6 +45,7 @@
base_dir = os.path.join(base_dir, '..', '..', '..')
mesh_dir = os.path.join(base_dir, 'mesh')
# ...
x, y = symbols('x, y', real=True)

#------------------------------------------------------------------------------
def run_field_test(filename, f):
Expand Down
7 changes: 2 additions & 5 deletions psydac/api/tests/test_api_2d_vector_mapping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-

import os
from sympy import Tuple, Matrix
from sympy import Tuple, Matrix, symbols
from sympy import pi, sin

from sympde.calculus import grad, dot, inner
Expand All @@ -24,6 +24,7 @@
base_dir = os.path.join(base_dir, '..', '..', '..')
mesh_dir = os.path.join(base_dir, 'mesh')
# ...
x,y = symbols('x,y', real=True)

#==============================================================================
def run_vector_poisson_2d_dir(filename, solution, f):
Expand Down Expand Up @@ -86,8 +87,6 @@ def run_vector_poisson_2d_dir(filename, solution, f):
def test_api_vector_poisson_2d_dir_identity():
filename = os.path.join(mesh_dir, 'identity_2d.h5')

from sympy.abc import x,y

u1 = sin(pi*x)*sin(pi*y)
u2 = sin(pi*x)*sin(pi*y)
solution = Tuple(u1, u2)
Expand All @@ -108,8 +107,6 @@ def test_api_vector_poisson_2d_dir_identity():
def test_api_vector_poisson_2d_dir_collela():
filename = os.path.join(mesh_dir, 'collela_2d.h5')

from sympy.abc import x,y

u1 = sin(pi*x)*sin(pi*y)
u2 = sin(pi*x)*sin(pi*y)
solution = Tuple(u1, u2)
Expand Down
4 changes: 2 additions & 2 deletions psydac/api/tests/test_api_2d_vector_multipatch_mapping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-

import os
from sympy import Tuple, Matrix
from sympy import Tuple, Matrix, symbols
from sympy import pi, sin

from sympde.calculus import grad, dot, inner, Transpose
Expand Down Expand Up @@ -101,7 +101,7 @@ def run_vector_poisson_2d_dir(filename, solution, f):
def test_api_vector_poisson_2d_dir_identity():
filename = os.path.join(mesh_dir, 'multipatch/square.h5')

from sympy.abc import x,y
x,y = symbols('x,y', real=True)

u1 = sin(pi*x)*sin(pi*y)
u2 = sin(pi*x)*sin(pi*y)
Expand Down
6 changes: 3 additions & 3 deletions psydac/api/tests/test_api_3d_scalar_mapping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-

from mpi4py import MPI
from sympy import pi, cos, sin
from sympy import pi, cos, sin, symbols
import pytest
import os

Expand Down Expand Up @@ -240,7 +240,7 @@ def test_api_poisson_3d_dir_collela():

filename = os.path.join(mesh_dir, 'collela_3d.h5')

from sympy.abc import x,y,z
x,y,z = symbols('x,y,z', real=True)

solution = sin(pi*x)*sin(pi*y)*sin(pi*z)
f = 3*pi**2*sin(pi*x)*sin(pi*y)*sin(pi*z)
Expand All @@ -258,7 +258,7 @@ def test_api_poisson_3d_dir_collela():
def test_api_poisson_3d_dirneu_identity_2():
filename = os.path.join(mesh_dir, 'identity_3d.h5')

from sympy.abc import x,y,z
x,y,z = symbols('x,y,z', real=True)

solution = sin(0.5*pi*x)*sin(pi*y)*sin(pi*z)
f = (9./4.)*pi**2*solution
Expand Down
6 changes: 3 additions & 3 deletions psydac/api/tests/test_api_3d_vector_mapping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-

import os
from sympy import Tuple, Matrix
from sympy import Tuple, Matrix, symbols
from sympy import pi, sin

from sympde.calculus import grad, dot, inner
Expand Down Expand Up @@ -85,7 +85,7 @@ def run_vector_poisson_3d_dir(filename, solution, f):
def test_api_vector_poisson_3d_dir_identity():
filename = os.path.join(mesh_dir, 'identity_3d.h5')

from sympy.abc import x,y,z
x,y,z = symbols('x,y,z', real=True)

u1 = sin(pi*x)*sin(pi*y)*sin(pi*z)
u2 = sin(pi*x)*sin(pi*y)*sin(pi*z)
Expand All @@ -109,7 +109,7 @@ def test_api_vector_poisson_3d_dir_identity():
def test_api_vector_poisson_3d_dir_collela():
filename = os.path.join(mesh_dir, 'collela_3d.h5')

from sympy.abc import x,y,z
x,y,z = symbols('x,y,z', real=True)

u1 = sin(pi*x)*sin(pi*y)*sin(pi*z)
u2 = sin(pi*x)*sin(pi*y)*sin(pi*z)
Expand Down

0 comments on commit dc64c77

Please sign in to comment.