Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ disable = [
"missing-function-docstring",
"missing-module-docstring",
]
enable = [
"useless-suppression",
"use-symbolic-message-instead",
]

[tool.pylint.CLASSES]
defining-attr-methods = [
"__init__",
"__new__",
"setUp",
"__post_init__",
"initialize",
"__array_finalize__",
]

[tool.pylint.FORMAT]
max-line-length = 132
2 changes: 1 addition & 1 deletion pyro/advection/advective_fluxes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyro.mesh.reconstruction as reconstruction
from pyro.mesh import reconstruction


def unsplit_fluxes(my_data, rp, dt, scalar_name):
Expand Down
3 changes: 1 addition & 2 deletions pyro/advection/problems/smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy

import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down Expand Up @@ -34,4 +34,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
3 changes: 1 addition & 2 deletions pyro/advection/problems/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

import pyro.mesh.patch as patch
from pyro.mesh import patch


def init_data(my_data, rp):
Expand All @@ -23,4 +23,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
3 changes: 1 addition & 2 deletions pyro/advection/problems/tophat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down Expand Up @@ -37,4 +37,3 @@ def init_data(myd, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
6 changes: 3 additions & 3 deletions pyro/advection/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import numpy as np

import pyro.advection.advective_fluxes as flx
import pyro.mesh.patch as patch
import pyro.particles.particles as particles
import pyro.util.plot_tools as plot_tools
from pyro.mesh import patch
from pyro.particles import particles
from pyro.simulation_null import NullSimulation, bc_setup, grid_setup
from pyro.util import plot_tools


class Simulation(NullSimulation):
Expand Down
2 changes: 1 addition & 1 deletion pyro/advection_fv4/fluxes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pyro.advection_fv4.interface as interface
import pyro.mesh.array_indexer as ai
from pyro.advection_fv4 import interface


def fluxes(my_data, rp, dt):
Expand Down
24 changes: 12 additions & 12 deletions pyro/advection_fv4/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def states(a, ng, idir):
jhi = ng + ny

# we need interface values on all faces of the domain
if (idir == 1):
if idir == 1:

for i in range(ilo - 2, ihi + 3):
for j in range(jlo - 1, jhi + 1):
Expand Down Expand Up @@ -110,14 +110,14 @@ def states(a, ng, idir):
# MC Eq. 27
rho = d2a_lim / d2af[i, j]

if (rho < 1.0 - 1.e-12):
if rho < 1.0 - 1.e-12:
# we may need to limit -- these quantities are at cell-centers
d3a_min = min(d3a[i - 1, j], d3a[i, j],
d3a[i + 1, j], d3a[i + 2, j])
d3a_max = max(d3a[i - 1, j], d3a[i, j],
d3a[i + 1, j], d3a[i + 2, j])

if (C3 * max(abs(d3a_min), abs(d3a_max)) <= (d3a_max - d3a_min)):
if C3 * max(abs(d3a_min), abs(d3a_max)) <= (d3a_max - d3a_min):
# limit
if (dafm[i, j] * dafp[i, j] < 0.0):
# Eqs. 29, 30
Expand All @@ -135,13 +135,13 @@ def states(a, ng, idir):

else:
# if Eqs. 24 or 25 didn't hold we still may need to limit
if (abs(dafm[i, j]) >= 2.0 * abs(dafp[i, j])):
if abs(dafm[i, j]) >= 2.0 * abs(dafp[i, j]):
ar[i, j] = a[i, j] - 2.0 * dafp[i, j]

if (abs(dafp[i, j]) >= 2.0 * abs(dafm[i, j])):
if abs(dafp[i, j]) >= 2.0 * abs(dafm[i, j]):
al[i + 1, j] = a[i, j] + 2.0 * dafm[i, j]

elif (idir == 2):
elif idir == 2:

for i in range(ilo - 1, ihi + 1):
for j in range(jlo - 2, jhi + 3):
Expand Down Expand Up @@ -199,14 +199,14 @@ def states(a, ng, idir):
# MC Eq. 27
rho = d2a_lim / d2af[i, j]

if (rho < 1.0 - 1.e-12):
if rho < 1.0 - 1.e-12:
# we may need to limit -- these quantities are at cell-centers
d3a_min = min(d3a[i, j - 1], d3a[i, j],
d3a[i, j + 1], d3a[i, j + 2])
d3a_max = max(d3a[i, j - 1], d3a[i, j],
d3a[i, j + 1], d3a[i, j + 2])

if (C3 * max(abs(d3a_min), abs(d3a_max)) <= (d3a_max - d3a_min)):
if C3 * max(abs(d3a_min), abs(d3a_max)) <= (d3a_max - d3a_min):
# limit
if (dafm[i, j] * dafp[i, j] < 0.0):
# Eqs. 29, 30
Expand All @@ -224,10 +224,10 @@ def states(a, ng, idir):

else:
# if Eqs. 24 or 25 didn't hold we still may need to limit
if (abs(dafm[i, j]) >= 2.0 * abs(dafp[i, j])):
if abs(dafm[i, j]) >= 2.0 * abs(dafp[i, j]):
ar[i, j] = a[i, j] - 2.0 * dafp[i, j]

if (abs(dafp[i, j]) >= 2.0 * abs(dafm[i, j])):
if abs(dafp[i, j]) >= 2.0 * abs(dafm[i, j]):
al[i, j + 1] = a[i, j] + 2.0 * dafm[i, j]

return al, ar
Expand Down Expand Up @@ -273,7 +273,7 @@ def states_nolimit(a, qx, qy, ng, idir):
jhi = ng + ny

# we need interface values on all faces of the domain
if (idir == 1):
if idir == 1:

for i in range(ilo - 2, ihi + 3):
for j in range(jlo - 1, jhi + 1):
Expand All @@ -285,7 +285,7 @@ def states_nolimit(a, qx, qy, ng, idir):
al[i, j] = a_int[i, j]
ar[i, j] = a_int[i, j]

elif (idir == 2):
elif idir == 2:

for i in range(ilo - 1, ihi + 1):
for j in range(jlo - 2, jhi + 3):
Expand Down
3 changes: 1 addition & 2 deletions pyro/advection_fv4/problems/smooth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy

import pyro.mesh.fv as fv
from pyro.mesh import fv
from pyro.util import msg


Expand Down Expand Up @@ -45,4 +45,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
6 changes: 3 additions & 3 deletions pyro/advection_fv4/simulation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import importlib

import pyro.advection_fv4.fluxes as flx
import pyro.advection_rk as advection_rk
import pyro.mesh.array_indexer as ai
import pyro.mesh.fv as fv
import pyro.particles.particles as particles
from pyro import advection_rk
from pyro.mesh import fv
from pyro.particles import particles
from pyro.simulation_null import bc_setup, grid_setup


Expand Down
2 changes: 1 addition & 1 deletion pyro/advection_nonuniform/advective_fluxes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

import pyro.mesh.reconstruction as reconstruction
from pyro.mesh import reconstruction


def unsplit_fluxes(my_data, rp, dt, scalar_name):
Expand Down
3 changes: 1 addition & 2 deletions pyro/advection_nonuniform/problems/slotted.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down Expand Up @@ -51,4 +51,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
3 changes: 1 addition & 2 deletions pyro/advection_nonuniform/problems/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down Expand Up @@ -27,4 +27,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
6 changes: 3 additions & 3 deletions pyro/advection_nonuniform/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import numpy as np

import pyro.advection_nonuniform.advective_fluxes as flx
import pyro.mesh.patch as patch
import pyro.particles.particles as particles
import pyro.util.plot_tools as plot_tools
from pyro.mesh import patch
from pyro.particles import particles
from pyro.simulation_null import NullSimulation, bc_setup, grid_setup
from pyro.util import plot_tools


class Simulation(NullSimulation):
Expand Down
2 changes: 1 addition & 1 deletion pyro/advection_rk/fluxes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyro.mesh.reconstruction as reconstruction
from pyro.mesh import reconstruction


def fluxes(my_data, rp, dt):
Expand Down
4 changes: 2 additions & 2 deletions pyro/advection_rk/simulation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pyro.advection as advection
import pyro.advection_rk.fluxes as flx
import pyro.mesh.array_indexer as ai
import pyro.mesh.integration as integration
from pyro import advection
from pyro.mesh import integration


class Simulation(advection.Simulation):
Expand Down
2 changes: 1 addition & 1 deletion pyro/advection_weno/fluxes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

import pyro.mesh.reconstruction as reconstruction
from pyro.mesh import reconstruction


def fvs(q, order, u, alpha):
Expand Down
4 changes: 2 additions & 2 deletions pyro/advection_weno/simulation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pyro.advection as advection
import pyro.advection_weno.fluxes as flx
import pyro.mesh.array_indexer as ai
import pyro.mesh.integration as integration
from pyro import advection
from pyro.mesh import integration


class Simulation(advection.Simulation):
Expand Down
2 changes: 1 addition & 1 deletion pyro/analysis/dam_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def find_h2(h2):
ax.set_ylabel(r"$u$")
ax.set_xlim(0, 1.0)

if (myg.nx > myg.ny):
if myg.nx > myg.ny:
ax.set_xlabel(r"x")
else:
ax.set_xlabel(r"y")
Expand Down
2 changes: 1 addition & 1 deletion pyro/analysis/gauss_diffusion_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import matplotlib.pyplot as plt
import numpy as np

import pyro.diffusion.problems.gaussian as gaussian
import pyro.util.io_pyro as io
from pyro.diffusion.problems import gaussian

mpl.rcParams["text.usetex"] = True
mpl.rcParams['mathtext.fontset'] = 'cm'
Expand Down
2 changes: 1 addition & 1 deletion pyro/analysis/plotvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import matplotlib.pyplot as plt
import numpy as np

import pyro.mesh.patch as patch
import pyro.util.io_pyro as io
from pyro.mesh import patch

# plot a single variable from an output file
#
Expand Down
2 changes: 1 addition & 1 deletion pyro/analysis/smooth_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import numpy as np

import pyro.mesh.patch as patch
import pyro.util.io_pyro as io
from pyro.mesh import patch

usage = """
compare the output in file from the smooth advection problem to
Expand Down
2 changes: 1 addition & 1 deletion pyro/analysis/sod_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def abort(string):
ax.plot(x_exact, e_exact)
ax.scatter(x, e, marker="x", s=7, color="r")

if (myg.nx > myg.ny):
if myg.nx > myg.ny:
ax.set_xlabel(r"x")
else:
ax.set_xlabel(r"y")
Expand Down
3 changes: 1 addition & 2 deletions pyro/compressible/problems/acoustic_pulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

import pyro.mesh.fv as fv
from pyro.mesh import fv
from pyro.util import msg


Expand Down Expand Up @@ -57,4 +57,3 @@ def init_data(myd, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
2 changes: 1 addition & 1 deletion pyro/compressible/problems/advect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down
3 changes: 1 addition & 2 deletions pyro/compressible/problems/bubble.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down Expand Up @@ -79,4 +79,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
3 changes: 1 addition & 2 deletions pyro/compressible/problems/gresho.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy

import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down Expand Up @@ -78,4 +78,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the userad at the end of the run """
pass
3 changes: 1 addition & 2 deletions pyro/compressible/problems/hse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

import pyro.mesh.patch as patch
from pyro.mesh import patch
from pyro.util import msg


Expand Down Expand Up @@ -60,4 +60,3 @@ def init_data(my_data, rp):

def finalize():
""" print out any information to the user at the end of the run """
pass
Loading