Skip to content

Commit 57bbe1d

Browse files
author
Michael Zingale
committed
for backwards compability, alias the old patch.py class names to the
new ones -- this lets the comparison to the old benchmarks work.
1 parent f72a0ae commit 57bbe1d

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

DEVELOPMENT

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ This is a simple list of the improvements we wish to make to pyro.
33

44
coding:
55

6+
-- make compatible with python 3.x
7+
68
-- rewrite to adhere to python style guidelines
79

810
-- docstrings should be added everywhere possible

compare.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
def compare(myg1, myd1, myg2, myd2):
1818

1919
# compare the grids
20-
if (not myg1 == myg2):
20+
if not myg1 == myg2:
2121
return "gridbad"
2222

2323
# compare the data
24-
if (not myd1.vars == myd2.vars):
24+
if not myd1.vars == myd2.vars:
2525
return "namesbad"
2626

2727

@@ -31,7 +31,7 @@ def compare(myg1, myd1, myg2, myd2):
3131
result = 0
3232

3333
n = 0
34-
while (n < myd1.nvar):
34+
while n < myd1.nvar:
3535

3636
d1 = myd1.get_var(myd1.vars[n])
3737
d2 = myd2.get_var(myd2.vars[n])
@@ -63,7 +63,7 @@ def compare(myg1, myd1, myg2, myd2):
6363

6464
result = compare(myg1, myd1, myg2, myd2)
6565

66-
if (result == 0):
66+
if result == 0:
6767
print "SUCCESS: files agree"
6868
else:
6969
print "ERROR: ", errors[result]

mesh/patch.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,11 @@ def pretty_print(self, varname):
888888
print " "
889889
j += 1
890890

891+
# backwards compatibility
892+
ccData2d = CellCenterData2d
893+
grid2d = Grid2d
894+
bcObject = BCObject
895+
891896
def read(filename):
892897
"""
893898
Read a CellCenterData object from a file and return it and the grid

util/profile.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848

4949
class timer:
5050

51-
52-
5351
def __init__ (self, name):
5452
global timers, stackCount, timerNesting, timerOrder
5553

0 commit comments

Comments
 (0)