Skip to content

Commit d076961

Browse files
committed
Merge branch 'polar-coords' of https://github.com/ssagynbayeva/pyro2 into polar-coords
2 parents 55c8377 + ffdce53 commit d076961

Some content is hidden

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

55 files changed

+187
-180
lines changed

pyro/advection/problems/smooth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

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

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

pyro/advection/problems/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
def init_data(my_data, rp):
77
""" an init routine for unit testing """
8+
del rp # this problem doesn't use runtime params
89

910
# make sure that we are passed a valid patch object
1011
if not isinstance(my_data, patch.CellCenterData2d):

pyro/advection/problems/tophat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
def init_data(myd, rp):
88
""" initialize the tophat advection problem """
9+
del rp # this problem doesn't use runtime params
910

1011
msg.bold("initializing the tophat advection problem...")
1112

pyro/advection_fv4/interface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def states(a, ng, idir):
2828
out : ndarray, ndarray
2929
The state predicted to the left and right edges.
3030
"""
31+
# pylint: disable=too-many-nested-blocks
3132

3233
qx, qy = a.shape
3334

pyro/advection_fv4/problems/smooth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
def init_data(my_data, rp):
88
""" initialize the smooth advection problem """
9+
del rp # this problem doesn't use runtime params
910

1011
msg.bold("initializing the smooth FV advection problem...")
1112

pyro/advection_nonuniform/problems/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
def init_data(my_data, rp):
66
""" an init routine for unit testing """
7+
del rp # this problem doesn't use runtime params
78

89
# make sure that we are passed a valid patch object
910
if not isinstance(my_data, patch.CellCenterData2d):

pyro/analysis/convergence.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ def compare(fine, coarse):
2525
return float(np.abs(e).max()), e.norm()
2626

2727

28-
if __name__ == "__main__":
29-
28+
def main():
3029
if len(sys.argv) != 3:
3130
print(usage)
3231
sys.exit(2)
@@ -40,3 +39,7 @@ def compare(fine, coarse):
4039
result = compare(ff.cc_data, cc.cc_data)
4140

4241
print("inf norm of density: ", result)
42+
43+
44+
if __name__ == "__main__":
45+
main()

pyro/analysis/dam_compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def abort(string):
106106
h0 = rp.get_param("dam.h_right")
107107

108108

109-
def find_h2(h2):
109+
def find_h2(h2): # pylint: disable=redefined-outer-name
110110
return (h2/h1)**3 - 9*(h2/h1)**2*(h0/h1) + \
111111
16*(h2/h1)**1.5*(h0/h1) - (h2/h1)*(h0/h1)*(h0/h1+8) + \
112112
(h0/h1)**3

pyro/analysis/gauss_diffusion_compare.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ def process(file):
104104
return bin_centers, phi_exact, phi_bin
105105

106106

107-
if __name__ == "__main__":
108-
107+
def main():
109108
if len(sys.argv) < 2:
110109
print(usage)
111110
sys.exit(2)
@@ -137,3 +136,7 @@ def process(file):
137136

138137
plt.savefig("gauss_diffusion_compare.png", bbox_inches="tight")
139138
plt.savefig("gauss_diffusion_compare.pdf", bbox_inches="tight", dpi=100)
139+
140+
141+
if __name__ == "__main__":
142+
main()

pyro/analysis/incomp_converge_error.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_errors(file):
4242
return udiff.norm(), vdiff.norm()
4343

4444

45-
if __name__ == "__main__":
45+
def main():
4646
if len(sys.argv) != 2:
4747
print(usage)
4848
sys.exit(2)
@@ -55,3 +55,7 @@ def get_errors(file):
5555

5656
errors = get_errors(file)
5757
print("errors: ", errors[0], errors[1])
58+
59+
60+
if __name__ == "__main__":
61+
main()

0 commit comments

Comments
 (0)