From 054b1cedb06d5bf833d4f87e9fa8c6f31c6410b4 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 10 Aug 2016 14:29:07 -0400 Subject: [PATCH 1/2] Add verbose option in PyLammps methods This option allows forcing LAMMPS output to be printed to the console. --- python/lammps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/lammps.py b/python/lammps.py index c2e9fa983b..6eba1b73c0 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -640,6 +640,10 @@ class PyLammps(object): with OutputCapture() as capture: self.lmp.command(' '.join(cmd_args)) output = capture.output + + if 'verbose' in kwargs and kwargs['verbose']: + print(output) + lines = output.splitlines() if len(lines) > 1: From 57d7a4a6ad5ffad17b17eab2cddeecf4979bfb4e Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 10 Aug 2016 14:35:48 -0400 Subject: [PATCH 2/2] Add utility function to IPyLammps for embedding videos --- python/lammps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/lammps.py b/python/lammps.py index 6eba1b73c0..472f27ce29 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -698,3 +698,7 @@ class IPyLammps(PyLammps): self.write_dump(*cmd_args) from IPython.core.display import Image return Image('snapshot.png') + + def video(self, filename): + from IPython.display import HTML + return HTML("")