Skip to content

Commit f9afaa6

Browse files
committed
Merge branch 'polar-coords' of https://github.com/ssagynbayeva/pyro2 into polar-coords
2 parents bbe762d + 7466128 commit f9afaa6

Some content is hidden

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

101 files changed

+331
-369
lines changed

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ disable = [
2121
"missing-function-docstring",
2222
"missing-module-docstring",
2323
]
24+
enable = [
25+
"useless-suppression",
26+
"use-symbolic-message-instead",
27+
]
28+
29+
[tool.pylint.CLASSES]
30+
defining-attr-methods = [
31+
"__init__",
32+
"__new__",
33+
"setUp",
34+
"__post_init__",
35+
"initialize",
36+
"__array_finalize__",
37+
]
2438

2539
[tool.pylint.FORMAT]
2640
max-line-length = 132

pyro/advection/advective_fluxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import pyro.mesh.reconstruction as reconstruction
1+
from pyro.mesh import reconstruction
22

33

44
def unsplit_fluxes(my_data, rp, dt, scalar_name):

pyro/advection/problems/smooth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

@@ -34,4 +34,3 @@ def init_data(my_data, rp):
3434

3535
def finalize():
3636
""" print out any information to the user at the end of the run """
37-
pass

pyro/advection/problems/test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22

3-
import pyro.mesh.patch as patch
3+
from pyro.mesh import patch
44

55

66
def init_data(my_data, rp):
@@ -23,4 +23,3 @@ def init_data(my_data, rp):
2323

2424
def finalize():
2525
""" print out any information to the user at the end of the run """
26-
pass

pyro/advection/problems/tophat.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22

3-
import pyro.mesh.patch as patch
3+
from pyro.mesh import patch
44
from pyro.util import msg
55

66

@@ -37,4 +37,3 @@ def init_data(myd, rp):
3737

3838
def finalize():
3939
""" print out any information to the user at the end of the run """
40-
pass

pyro/advection/simulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import numpy as np
66

77
import pyro.advection.advective_fluxes as flx
8-
import pyro.mesh.patch as patch
9-
import pyro.particles.particles as particles
10-
import pyro.util.plot_tools as plot_tools
8+
from pyro.mesh import patch
9+
from pyro.particles import particles
1110
from pyro.simulation_null import NullSimulation, bc_setup, grid_setup
11+
from pyro.util import plot_tools
1212

1313

1414
class Simulation(NullSimulation):

pyro/advection_fv4/fluxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import pyro.advection_fv4.interface as interface
21
import pyro.mesh.array_indexer as ai
2+
from pyro.advection_fv4 import interface
33

44

55
def fluxes(my_data, rp, dt):

pyro/advection_fv4/interface.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def states(a, ng, idir):
5252
jhi = ng + ny
5353

5454
# we need interface values on all faces of the domain
55-
if (idir == 1):
55+
if idir == 1:
5656

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

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

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

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

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

144-
elif (idir == 2):
144+
elif idir == 2:
145145

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

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

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

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

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

233233
return al, ar
@@ -273,7 +273,7 @@ def states_nolimit(a, qx, qy, ng, idir):
273273
jhi = ng + ny
274274

275275
# we need interface values on all faces of the domain
276-
if (idir == 1):
276+
if idir == 1:
277277

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

288-
elif (idir == 2):
288+
elif idir == 2:
289289

290290
for i in range(ilo - 1, ihi + 1):
291291
for j in range(jlo - 2, jhi + 3):

pyro/advection_fv4/problems/smooth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy
22

3-
import pyro.mesh.fv as fv
3+
from pyro.mesh import fv
44
from pyro.util import msg
55

66

@@ -45,4 +45,3 @@ def init_data(my_data, rp):
4545

4646
def finalize():
4747
""" print out any information to the user at the end of the run """
48-
pass

pyro/advection_fv4/simulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import importlib
22

33
import pyro.advection_fv4.fluxes as flx
4-
import pyro.advection_rk as advection_rk
54
import pyro.mesh.array_indexer as ai
6-
import pyro.mesh.fv as fv
7-
import pyro.particles.particles as particles
5+
from pyro import advection_rk
6+
from pyro.mesh import fv
7+
from pyro.particles import particles
88
from pyro.simulation_null import bc_setup, grid_setup
99

1010

0 commit comments

Comments
 (0)