[cig-commits] [commit] master: py: Use print function instead of statement. (5217728)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Sat Jan 17 08:39:50 PST 2015


Repository : https://github.com/geodynamics/specfem1d

On branch  : master
Link       : https://github.com/geodynamics/specfem1d/compare/58c6e68e5fc4e335b2fa135ce471179cc1f417fc...d71011cecc0efd4599edda577831565bbebd41ac

>---------------------------------------------------------------

commit 52177286d8e2287617ee1deaf9d9b3069565fd10
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Fri Jan 16 18:20:45 2015 -0500

    py: Use print function instead of statement.


>---------------------------------------------------------------

52177286d8e2287617ee1deaf9d9b3069565fd10
 Python_version/config.py    | 2 ++
 Python_version/functions.py | 2 ++
 Python_version/gll.py       | 2 ++
 Python_version/grid.py      | 2 ++
 Python_version/specfem1d.py | 4 +++-
 5 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Python_version/config.py b/Python_version/config.py
index 95d70f7..5c1ff2d 100644
--- a/Python_version/config.py
+++ b/Python_version/config.py
@@ -12,6 +12,8 @@ is implemented.
 @author: Alexis Bottero (alexis.bottero at gmail.com)
 """
 
+from __future__ import print_function
+
 import argparse
 try:
     # Python 3
diff --git a/Python_version/functions.py b/Python_version/functions.py
index 5c849fb..682b4b8 100644
--- a/Python_version/functions.py
+++ b/Python_version/functions.py
@@ -8,6 +8,8 @@ elements simulations.
 @author: Alexis Bottero (alexis.bottero at gmail.com)
 """
 
+from __future__ import print_function
+
 import numpy as np
 
 
diff --git a/Python_version/gll.py b/Python_version/gll.py
index 9187971..29c1d5f 100644
--- a/Python_version/gll.py
+++ b/Python_version/gll.py
@@ -3,6 +3,8 @@
 Functions for working with GLL points.
 """
 
+from __future__ import print_function
+
 import numpy as np
 
 
diff --git a/Python_version/grid.py b/Python_version/grid.py
index 656dc6b..131c188 100644
--- a/Python_version/grid.py
+++ b/Python_version/grid.py
@@ -3,6 +3,8 @@
 Definitions of the grid.
 '''
 
+from __future__ import print_function
+
 import numpy as np
 
 import functions
diff --git a/Python_version/specfem1d.py b/Python_version/specfem1d.py
index 309e269..d48f8ba 100755
--- a/Python_version/specfem1d.py
+++ b/Python_version/specfem1d.py
@@ -15,6 +15,8 @@ Main script for 1D spectral elements.
 @author: Alexis Bottero, CNRS Marseille, France (alexis.bottero at gmail.com)
 """
 
+from __future__ import print_function
+
 import numpy as np
 
 from config import Parameter
@@ -56,7 +58,7 @@ if param.axisym and (param.plot or param.snapshot):
 
 # Main time loop :
 for it in range(param.nts):
-    print 'it = ', it, ' (t = ', it * param.dt, 's)'
+    print('it = %d (t = %f s)' % (it, it * param.dt))
     if it > 0:
         u += param.dt * vel + acc * param.dt**2 / 2
         vel += param.dt / 2 * acc



More information about the CIG-COMMITS mailing list