mailRe: [bug #20916] Suggestion for python script for PNG/EPS/SVG conversion of grace files


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on June 18, 2013 - 13:21:
Hi,

I have a few points for improving the patch:

- As part of the coding convention, there should be two blank lines
before a function.  This is simply for easier navigation of the Python
code.  This can be seen when running the
'devel_scripts/code_validator' script on the lib/software/grace.py
file.

- I would suggest maybe the name
lib.software.grace.script_grace2images() to be a bit more clear that a
script is produced.

- For the Epydoc formatted docstring, you need the '@keyword file:
....' line as well.  This can be tested when running 'scons
api_manual_html' with epydoc installed.  Without this the API
documentation compilation for http://www.nmr-relax.com/api/2.2/ fails
for that file.

- For the text hack, you can use the triple quote convention for the
whole script.  This will make things much, much cleaner.  You can then
use as many ' and " characters as you like.  See
http://docs.python.org/release/1.4/tut/node70.html.  Or, even better,
you can copy how it was done in the lib/software/opendx/files.py file,
using \" to use " within a string.

- Small spelling correction of 'Successful' in the
lib.software.grace.write_grace2images() docstring.

Apart from these minor things, the code looks good.

Cheers,

Edward


On 18 June 2013 11:43, Troels E. Linnet
<NO-REPLY.INVALID-ADDRESS@xxxxxxx> wrote:
Follow-up Comment #1, bug #20916 (project relax):

Fix for bug #20916, (https://gna.org/bugs/?20916) - Suggestion for python
script for PNG/EPS/SVG conversion of grace files

Troels Linnet provided this patch, and was discovered during work on a 
Windows
7 system: telinnet _aaattt_ bio_dot_ku_dot _dk

This patch will provide a grace2images.py file in each folder where a call 
to
specific_analyses/relax_disp/disp_data.py is called.

It is called in: def plot_disp_curves(dir=None, force=None):
and call the function: lib.software.grace.write_grace2images()

The conversion script can be executed in linux and windows, if the PATH to
xmgrace has been specified. It will look in a folder for grace files of 
ending
*.agr and by default convert to PNG.

One can also convert to EPS and SVG. Propably more options could be added, 
as
PDF. The conversion depends on xmgrace compilation, and so PNG conversion is
for fast inspection of graphs in folder, and EPS for further external
conversion to PDF etc.

The patch, the output file, and small script to test is attached.

I miss to make the file executable in relax, so the script can be executed
directly in linux.

(file #18105, file #18106, file #18107)
    _______________________________________________________

Additional Item Attachment:

File name: patch                          Size:6 KB
File name: grace2images.py                Size:3 KB
File name: test_convert.py                Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?20916>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel



Related Messages


Powered by MHonArc, Updated Tue Jun 18 14:40:09 2013