Skip to content

Commit dd55d79

Browse files
authored
simple examples: fix python2->3 problem and use new python raw strings to protect latex (#1142)
1 parent 8d81c91 commit dd55d79

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

examples/simple/pythagorean.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Calculates the Pythagorean 3-body problem using different values for
44
the smoothing length in the n-body code.
55
"""
6-
from __future__ import print_function
6+
# from __future__ import print_function
77
# import numpy
88
# import time
99

@@ -57,11 +57,11 @@ def run_pyth(interface, tend=100, dt=0.125, parameters=[]):
5757

5858

5959
if __name__ == "__main__":
60-
codes_to_run = [('Hermite0, $\eta=0.03$', Hermite, [("dt_param", 0.03)]),
61-
('Hermite0, $\eta=0.01$', Hermite, [("dt_param", 0.01)]),
62-
('Hermite0, $\eta=0.003$', Hermite, [("dt_param", 0.003)]),
63-
('Hermite0, $\eta=0.001$', Hermite, [("dt_param", 0.001)])]
64-
N = (len(codes_to_run) - 1) / 2 + 1
60+
codes_to_run = [(r'Hermite0, $\eta=0.030$', Hermite, [("dt_param", 0.030)]),
61+
(r'Hermite0, $\eta=0.010$', Hermite, [("dt_param", 0.010)]),
62+
(r'Hermite0, $\eta=0.003$', Hermite, [("dt_param", 0.003)]),
63+
(r'Hermite0, $\eta=0.001$', Hermite, [("dt_param", 0.001)])]
64+
N = (len(codes_to_run) - 1) // 2 + 1
6565
f = pyplot.figure(figsize=(8, 4 * N))
6666

6767
for i, (label, interface, parameters) in enumerate(codes_to_run):

0 commit comments

Comments
 (0)