Skip to content

Commit ee1c359

Browse files
authored
Final pylint cleanup (#155)
This resolves the remaining pylint warnings and enables warnings for the CI action.
1 parent 70af790 commit ee1c359

23 files changed

Lines changed: 50 additions & 74 deletions

File tree

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ jobs:
4141
run: pip install .
4242

4343
- name: Validate
44-
run: pylint --errors-only pyro pyro/analysis pyro/**/tests/*.py
44+
run: pylint --disable=fixme pyro pyro/analysis pyro/**/tests/*.py
4545

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ disable = [
2121
"missing-function-docstring",
2222
"missing-module-docstring",
2323
"pointless-string-statement",
24+
"cyclic-import",
25+
"duplicate-code",
2426
]
2527
enable = [
2628
"useless-suppression",

pyro/advection_fv4/fluxes.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pyro.advection_fv4 import interface
33

44

5-
def fluxes(my_data, rp, dt):
5+
def fluxes(my_data, rp):
66
r"""Construct the fluxes through the interfaces for the linear advection
77
equation:
88
@@ -41,11 +41,6 @@ def fluxes(my_data, rp, dt):
4141
we are advecting.
4242
rp : RuntimeParameters object
4343
The runtime parameters for the simulation
44-
dt : float
45-
The timestep we are advancing through.
46-
scalar_name : str
47-
The name of the variable contained in my_data that we are
48-
advecting
4944
5045
Returns
5146
-------

pyro/advection_fv4/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def substep(self, myd):
4848

4949
k = myg.scratch_array()
5050

51-
flux_x, flux_y = flx.fluxes(myd, self.rp, self.dt)
51+
flux_x, flux_y = flx.fluxes(myd, self.rp)
5252

5353
F_x = ai.ArrayIndexer(d=flux_x, grid=myg)
5454
F_y = ai.ArrayIndexer(d=flux_y, grid=myg)

pyro/advection_rk/fluxes.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pyro.mesh import reconstruction
22

33

4-
def fluxes(my_data, rp, dt):
4+
def fluxes(my_data, rp):
55
"""
66
Construct the fluxes through the interfaces for the linear advection
77
equation:
@@ -42,11 +42,6 @@ def fluxes(my_data, rp, dt):
4242
we are advecting.
4343
rp : RuntimeParameters object
4444
The runtime parameters for the simulation
45-
dt : float
46-
The timestep we are advancing through.
47-
scalar_name : str
48-
The name of the variable contained in my_data that we are
49-
advecting
5045
5146
Returns
5247
-------

pyro/advection_rk/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def substep(self, myd):
1616

1717
k = myg.scratch_array()
1818

19-
flux_x, flux_y = flx.fluxes(myd, self.rp, self.dt)
19+
flux_x, flux_y = flx.fluxes(myd, self.rp)
2020

2121
F_x = ai.ArrayIndexer(d=flux_x, grid=myg)
2222
F_y = ai.ArrayIndexer(d=flux_y, grid=myg)

pyro/advection_weno/fluxes.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def fvs(q, order, u, alpha):
4141
return flux
4242

4343

44-
def fluxes(my_data, rp, dt):
44+
def fluxes(my_data, rp):
4545
r"""
4646
Construct the fluxes through the interfaces for the linear advection
4747
equation
@@ -62,11 +62,6 @@ def fluxes(my_data, rp, dt):
6262
we are advecting.
6363
rp : RuntimeParameters object
6464
The runtime parameters for the simulation
65-
dt : float
66-
The timestep we are advancing through.
67-
scalar_name : str
68-
The name of the variable contained in my_data that we are
69-
advecting
7065
7166
Returns
7267
-------

pyro/advection_weno/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def substep(self, myd):
1616

1717
k = myg.scratch_array()
1818

19-
flux_x, flux_y = flx.fluxes(myd, self.rp, self.dt)
19+
flux_x, flux_y = flx.fluxes(myd, self.rp)
2020

2121
F_x = ai.ArrayIndexer(d=flux_x, grid=myg)
2222
F_y = ai.ArrayIndexer(d=flux_y, grid=myg)

pyro/burgers/advective_fluxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pyro.incompressible.incomp_interface as interface
2-
import pyro.mesh.reconstruction as reconstruction
2+
from pyro.mesh import reconstruction
33

44

55
def unsplit_fluxes(my_data, rp, dt):

pyro/burgers/problems/smooth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
import numpy
44

5-
import pyro.mesh.patch as patch
5+
from pyro.mesh import patch
66
from pyro.util import msg
77

88

99
def init_data(my_data, rp):
1010
""" initialize the smooth burgers problem """
11+
del rp # this problem doesn't use runtime params
1112

1213
msg.bold("initializing the smooth burgers problem...")
1314

@@ -41,4 +42,3 @@ def init_data(my_data, rp):
4142

4243
def finalize():
4344
""" print out any information to the user at the end of the run """
44-
pass

0 commit comments

Comments
 (0)