From 35a0d04505a2e039b10bc6f993a0c0982a841cb3 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 29 Sep 2020 19:35:25 -0500
Subject: [PATCH] Switch pytools.log -> logpyle, add to requirements.txt

---
 grudge/symbolic/compiler.py                                  | 2 +-
 requirements.txt                                             | 1 +
 test/test_mpi_communication.py                               | 2 +-
 unported-examples/advection/advection.py                     | 2 +-
 unported-examples/benchmark_grudge/benchmark_mpi.py          | 2 +-
 unported-examples/burgers/burgers.py                         | 2 +-
 unported-examples/gas_dynamics/box-in-box.py                 | 4 ++--
 unported-examples/gas_dynamics/euler/sine-wave.py            | 2 +-
 unported-examples/gas_dynamics/euler/sod-2d.py               | 2 +-
 unported-examples/gas_dynamics/euler/vortex-adaptive-grid.py | 2 +-
 unported-examples/gas_dynamics/euler/vortex-sources.py       | 2 +-
 unported-examples/gas_dynamics/euler/vortex.py               | 2 +-
 unported-examples/gas_dynamics/naca.py                       | 4 ++--
 unported-examples/gas_dynamics/navierstokes/shearflow.py     | 2 +-
 unported-examples/gas_dynamics/square.py                     | 4 ++--
 unported-examples/gas_dynamics/wing.py                       | 2 +-
 unported-examples/heat/heat.py                               | 2 +-
 unported-examples/maxwell/maxwell-2d.py                      | 4 ++--
 unported-examples/maxwell/maxwell-pml.py                     | 4 ++--
 unported-examples/wave/wiggly.py                             | 2 +-
 20 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/grudge/symbolic/compiler.py b/grudge/symbolic/compiler.py
index 85eb4514..a1671c1e 100644
--- a/grudge/symbolic/compiler.py
+++ b/grudge/symbolic/compiler.py
@@ -517,7 +517,7 @@ class Code:
                 mapper_method = getattr(exec_mapper, insn.mapper_method)
                 if log_quantities is not None:
                     if isinstance(insn, RankDataSwapAssign):
-                        from pytools.log import time_and_count_function
+                        from logpyle import time_and_count_function
                         mapper_method = time_and_count_function(
                                 mapper_method,
                                 log_quantities["rank_data_swap_timer"],
diff --git a/requirements.txt b/requirements.txt
index 650f0b79..0b012db6 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,3 +12,4 @@ git+https://github.com/inducer/modepy.git#egg=modepy
 git+https://github.com/inducer/meshmode.git#egg=meshmode
 git+https://github.com/inducer/pyvisfile.git#egg=pyvisfile
 git+https://github.com/inducer/pymetis.git#egg=pymetis
+git+https://github.com/illinois-ceesd/logpyle.git#egg=logpyle
diff --git a/test/test_mpi_communication.py b/test/test_mpi_communication.py
index 4ed9fdb2..fcd93916 100644
--- a/test/test_mpi_communication.py
+++ b/test/test_mpi_communication.py
@@ -162,7 +162,7 @@ def mpi_communication_entrypoint():
     #           Fails because: "found faces without boundary conditions"
     # op.check_bc_coverage(local_mesh)
 
-    from pytools.log import LogManager, \
+    from logpyle import LogManager, \
             add_general_quantities, \
             add_run_info, \
             IntervalTimer, EventCounter
diff --git a/unported-examples/advection/advection.py b/unported-examples/advection/advection.py
index a665ed34..80cfa0a9 100644
--- a/unported-examples/advection/advection.py
+++ b/unported-examples/advection/advection.py
@@ -108,7 +108,7 @@ def main(write_output=True, flux_type_arg="upwind"):
         print("%d elements" % len(discr.mesh.elements))
 
     # diagnostics setup -------------------------------------------------------
-    from pytools.log import LogManager, \
+    from logpyle import LogManager, \
             add_general_quantities, \
             add_simulation_quantities, \
             add_run_info
diff --git a/unported-examples/benchmark_grudge/benchmark_mpi.py b/unported-examples/benchmark_grudge/benchmark_mpi.py
index 38612322..2d47b6a3 100644
--- a/unported-examples/benchmark_grudge/benchmark_mpi.py
+++ b/unported-examples/benchmark_grudge/benchmark_mpi.py
@@ -63,7 +63,7 @@ def simple_wave_entrypoint(dim=2, num_elems=256, order=4, num_steps=30,
     fields = join_fields(vol_discr.zeros(queue),
             [vol_discr.zeros(queue) for i in range(vol_discr.dim)])
 
-    from pytools.log import LogManager, \
+    from logpyle import LogManager, \
             add_general_quantities, \
             add_run_info, \
             IntervalTimer, EventCounter
diff --git a/unported-examples/burgers/burgers.py b/unported-examples/burgers/burgers.py
index 14aef115..532e3286 100644
--- a/unported-examples/burgers/burgers.py
+++ b/unported-examples/burgers/burgers.py
@@ -152,7 +152,7 @@ def main(write_output=True, flux_type_arg="upwind",
     u = discr.interpolate_volume_function(lambda x, el: case.u0(x[0]))
 
     # diagnostics setup -------------------------------------------------------
-    from pytools.log import LogManager, \
+    from logpyle import LogManager, \
             add_general_quantities, \
             add_simulation_quantities, \
             add_run_info
diff --git a/unported-examples/gas_dynamics/box-in-box.py b/unported-examples/gas_dynamics/box-in-box.py
index 2f757ae1..a6b9aaf7 100644
--- a/unported-examples/gas_dynamics/box-in-box.py
+++ b/unported-examples/gas_dynamics/box-in-box.py
@@ -159,7 +159,7 @@ def main():
         stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         logmgr = LogManager("navierstokes-%d.dat" % order, "w", rcon.communicator)
@@ -171,7 +171,7 @@ def main():
 
         logmgr.add_watches(["step.max", "t_sim.max", "t_step.max"])
 
-        from pytools.log import LogQuantity
+        from logpyle import LogQuantity
 
         class ChangeSinceLastStep(LogQuantity):
             """Records the change of a variable between a time step and the previous
diff --git a/unported-examples/gas_dynamics/euler/sine-wave.py b/unported-examples/gas_dynamics/euler/sine-wave.py
index 4337bbd5..e5fb0bca 100644
--- a/unported-examples/gas_dynamics/euler/sine-wave.py
+++ b/unported-examples/gas_dynamics/euler/sine-wave.py
@@ -117,7 +117,7 @@ def main(final_time=1, write_output=False):
         stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         if write_output:
diff --git a/unported-examples/gas_dynamics/euler/sod-2d.py b/unported-examples/gas_dynamics/euler/sod-2d.py
index 1c4896e6..5e6ca49c 100644
--- a/unported-examples/gas_dynamics/euler/sod-2d.py
+++ b/unported-examples/gas_dynamics/euler/sod-2d.py
@@ -107,7 +107,7 @@ def main():
         #stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         logmgr = LogManager("euler-%d.dat" % order, "w", rcon.communicator)
diff --git a/unported-examples/gas_dynamics/euler/vortex-adaptive-grid.py b/unported-examples/gas_dynamics/euler/vortex-adaptive-grid.py
index a282ca14..6faeafad 100644
--- a/unported-examples/gas_dynamics/euler/vortex-adaptive-grid.py
+++ b/unported-examples/gas_dynamics/euler/vortex-adaptive-grid.py
@@ -131,7 +131,7 @@ def main(write_output=True):
         #stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         if write_output:
diff --git a/unported-examples/gas_dynamics/euler/vortex-sources.py b/unported-examples/gas_dynamics/euler/vortex-sources.py
index 47bb7ee1..a0f466f8 100644
--- a/unported-examples/gas_dynamics/euler/vortex-sources.py
+++ b/unported-examples/gas_dynamics/euler/vortex-sources.py
@@ -228,7 +228,7 @@ def main(write_output=True):
         stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         if write_output:
diff --git a/unported-examples/gas_dynamics/euler/vortex.py b/unported-examples/gas_dynamics/euler/vortex.py
index c94ba2e8..2129f882 100644
--- a/unported-examples/gas_dynamics/euler/vortex.py
+++ b/unported-examples/gas_dynamics/euler/vortex.py
@@ -110,7 +110,7 @@ def main(write_output=True):
         #stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         if write_output:
diff --git a/unported-examples/gas_dynamics/naca.py b/unported-examples/gas_dynamics/naca.py
index 85976cf5..0c200c04 100644
--- a/unported-examples/gas_dynamics/naca.py
+++ b/unported-examples/gas_dynamics/naca.py
@@ -181,7 +181,7 @@ def main():
         #stepper = LSRK4TimeStepper(dtype=discr.default_scalar_type)
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         logmgr = LogManager("cns-naca-%d.dat" % order, "w", rcon.communicator)
@@ -192,7 +192,7 @@ def main():
         discr.add_instrumentation(logmgr)
         stepper.add_instrumentation(logmgr)
 
-        from pytools.log import LogQuantity
+        from logpyle import LogQuantity
         class ChangeSinceLastStep(LogQuantity):
             """Records the change of a variable between a time step and the previous
                one"""
diff --git a/unported-examples/gas_dynamics/navierstokes/shearflow.py b/unported-examples/gas_dynamics/navierstokes/shearflow.py
index 8cae369e..6c762e12 100644
--- a/unported-examples/gas_dynamics/navierstokes/shearflow.py
+++ b/unported-examples/gas_dynamics/navierstokes/shearflow.py
@@ -132,7 +132,7 @@ def main():
         stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         logmgr = LogManager("navierstokes-cpu-%d-%d.dat" % (order, refine),
diff --git a/unported-examples/gas_dynamics/square.py b/unported-examples/gas_dynamics/square.py
index 2dd5ce2c..632cfb72 100644
--- a/unported-examples/gas_dynamics/square.py
+++ b/unported-examples/gas_dynamics/square.py
@@ -180,7 +180,7 @@ def main():
         #stepper = Dumka3TimeStepper(3, rtol=1e-7)
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         logmgr = LogManager("cns-square-sp-%d.dat" % order, "w", rcon.communicator)
@@ -190,7 +190,7 @@ def main():
         discr.add_instrumentation(logmgr)
         stepper.add_instrumentation(logmgr)
 
-        from pytools.log import LogQuantity
+        from logpyle import LogQuantity
         class ChangeSinceLastStep(LogQuantity):
             """Records the change of a variable between a time step and the previous
                one"""
diff --git a/unported-examples/gas_dynamics/wing.py b/unported-examples/gas_dynamics/wing.py
index 618b3a97..2017d0f4 100644
--- a/unported-examples/gas_dynamics/wing.py
+++ b/unported-examples/gas_dynamics/wing.py
@@ -178,7 +178,7 @@ def main():
         stepper = RK4TimeStepper()
 
         # diagnostics setup ---------------------------------------------------
-        from pytools.log import LogManager, add_general_quantities, \
+        from logpyle import LogManager, add_general_quantities, \
                 add_simulation_quantities, add_run_info
 
         logmgr = LogManager("navierstokes-%d.dat" % order, "w", rcon.communicator)
diff --git a/unported-examples/heat/heat.py b/unported-examples/heat/heat.py
index 2d25d62d..0aa8fa92 100644
--- a/unported-examples/heat/heat.py
+++ b/unported-examples/heat/heat.py
@@ -102,7 +102,7 @@ def main(write_output=True) :
     u = discr.interpolate_volume_function(u0)
 
     # diagnostics setup -------------------------------------------------------
-    from pytools.log import LogManager, \
+    from logpyle import LogManager, \
             add_general_quantities, \
             add_simulation_quantities, \
             add_run_info
diff --git a/unported-examples/maxwell/maxwell-2d.py b/unported-examples/maxwell/maxwell-2d.py
index 4a869e1b..802f391c 100644
--- a/unported-examples/maxwell/maxwell-2d.py
+++ b/unported-examples/maxwell/maxwell-2d.py
@@ -90,7 +90,7 @@ def main(write_output=True):
     t = 0
 
     # diagnostics setup ---------------------------------------------------
-    from pytools.log import LogManager, add_general_quantities, \
+    from logpyle import LogManager, add_general_quantities, \
             add_simulation_quantities, add_run_info
 
     if write_output:
@@ -105,7 +105,7 @@ def main(write_output=True):
     discr.add_instrumentation(logmgr)
     stepper.add_instrumentation(logmgr)
 
-    from pytools.log import IntervalTimer
+    from logpyle import IntervalTimer
     vis_timer = IntervalTimer("t_vis", "Time spent visualizing")
     logmgr.add_quantity(vis_timer)
 
diff --git a/unported-examples/maxwell/maxwell-pml.py b/unported-examples/maxwell/maxwell-pml.py
index 6e23bff6..2af61e4a 100644
--- a/unported-examples/maxwell/maxwell-pml.py
+++ b/unported-examples/maxwell/maxwell-pml.py
@@ -146,7 +146,7 @@ def main(write_output=True):
         print("#elements=", len(mesh.elements))
 
     # diagnostics setup ---------------------------------------------------
-    from pytools.log import LogManager, add_general_quantities, \
+    from logpyle import LogManager, add_general_quantities, \
             add_simulation_quantities, add_run_info
 
     if write_output:
@@ -161,7 +161,7 @@ def main(write_output=True):
     discr.add_instrumentation(logmgr)
     stepper.add_instrumentation(logmgr)
 
-    from pytools.log import IntervalTimer
+    from logpyle import IntervalTimer
     vis_timer = IntervalTimer("t_vis", "Time spent visualizing")
     logmgr.add_quantity(vis_timer)
 
diff --git a/unported-examples/wave/wiggly.py b/unported-examples/wave/wiggly.py
index 11c01212..db383255 100644
--- a/unported-examples/wave/wiggly.py
+++ b/unported-examples/wave/wiggly.py
@@ -85,7 +85,7 @@ def main(write_output=True,
             [discr.volume_zeros(dtype=dtype) for i in range(discr.dimensions)])
 
     # diagnostics setup -------------------------------------------------------
-    from pytools.log import LogManager, \
+    from logpyle import LogManager, \
             add_general_quantities, \
             add_simulation_quantities, \
             add_run_info
-- 
GitLab