[pyfr] 37/88: Cleanups and documentation.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Nov 16 12:05:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository pyfr.

commit 4c9895f27a4b0227ee4e9fccdcacfc774397f0a1
Author: Freddie Witherden <freddie at witherden.org>
Date:   Mon May 23 12:02:40 2016 +0100

    Cleanups and documentation.
---
 doc/src/user_guide.rst | 13 ++++++++++++-
 pyfr/plugins/base.py   |  9 +++++----
 setup.py               |  2 +-
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/doc/src/user_guide.rst b/doc/src/user_guide.rst
index 07c3d53..cae9d0a 100644
--- a/doc/src/user_guide.rst
+++ b/doc/src/user_guide.rst
@@ -25,7 +25,7 @@ Python packages:
 2. `mako <http://www.makotemplates.org/>`_ >= 1.0.0
 3. `mpi4py <http://mpi4py.scipy.org/>`_ >= 2.0
 4. `numpy <http://www.numpy.org/>`_ >= 1.8
-5. `pytools <https://pypi.python.org/pypi/pytools>`_ >= 2014.3
+5. `pytools <https://pypi.python.org/pypi/pytools>`_ >= 2016.2.1
 
 Note that due to a bug in `numpy <http://www.numpy.org/>`_ PyFR is not
 compatible with 32-bit Python distributions.
@@ -795,12 +795,23 @@ Parameterised with
 
     *string*
 
+4. ``post-action`` --- command to execute after writing the file:
+
+    *string*
+
+5. ``post-action-mode`` --- how the post-action command should be
+   executed:
+
+    ``blocking`` | ``non-blocking``
+
 Example::
 
     [soln-plugin-writer]
     dt-out = 0.01
     basedir = .
     basename = files-{t:.2f}
+    post-action = echo "Wrote file {soln} at time {t} for mesh {mesh}."
+    post-action-mode = blocking
 
 [soln-plugin-fluidforce-name]
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/pyfr/plugins/base.py b/pyfr/plugins/base.py
index bb1a9c7..00187cb 100644
--- a/pyfr/plugins/base.py
+++ b/pyfr/plugins/base.py
@@ -52,10 +52,11 @@ class BasePlugin(object, metaclass=ABCMeta):
 
         if self.cfg.hasopt(cfgsect, 'post-action'):
             self.postact = self.cfg.getpath(cfgsect, 'post-action', abs=False)
-            self.postactmode = self.cfg.get(cfgsect, 'post-action-mode')
+            self.postactmode = self.cfg.get(cfgsect, 'post-action-mode',
+                                            'blocking')
 
             if self.postactmode not in {'blocking', 'non-blocking'}:
-                raise ValueError('Invalid post action type')
+                raise ValueError('Invalid post action mode')
 
         # Check that we support this particular system
         if not ('*' in self.systems or intg.system.name in self.systems):
@@ -71,14 +72,14 @@ class BasePlugin(object, metaclass=ABCMeta):
 
         # If we have a post-action and are the root rank then fire it
         if rank == root and self.postact:
-            # First, wait for any running post-actions to complete
+            # If a post-action is currently running then wait for it
             if self.postactaid is not None:
                 prefork.wait(self.postactaid)
 
             # Prepare the command line
             cmdline = shlex.split(self.postact.format(**kwargs))
 
-            # Invoke; either synchronously or asynchronously
+            # Invoke
             if self.postactmode == 'blocking':
                 prefork.call(cmdline)
             else:
diff --git a/setup.py b/setup.py
index b24b7f3..4d4b4f0 100755
--- a/setup.py
+++ b/setup.py
@@ -97,7 +97,7 @@ install_requires = [
     'mako >= 1.0.0',
     'mpi4py >= 2.0',
     'numpy >= 1.8',
-    'pytools >= 2014.3'
+    'pytools >= 2016.2.1'
 ]
 
 # Soft dependencies

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyfr.git



More information about the debian-science-commits mailing list