cctbx_project icon indicating copy to clipboard operation
cctbx_project copied to clipboard

Precession viewer fails to export a png file

Open jglaser opened this issue 5 months ago • 1 comments

I get the following error when trying to convert reflections in an MTZ file to a png image:

$ cctbx.precession_view 7jun_-1.8.mtz labels=F-calc,PHIF-calc postscript=False output_file=7jun_-1.8.png 
Traceback (most recent call last):
  File "....../cctbx/command_line/precession_view.py", line 259, in <module>
    run(sys.argv[1:])
  File "..../cctbx/command_line/precession_view.py", line 102, in run
    print(postscript)
          ^^^^^^^^^^
UnboundLocalError: cannot access local variable 'postscript' where it is not associated with a value

The reason is a typo in the source

https://github.com/cctbx/cctbx_project/blob/157c12a0466b715053ad7d7b200756753dc11703/cctbx/command_line/precession_view.py#L101

post[s]cript

Moreover, it would be nice if the silent option could be disabled when invoked from the command line ... so as to be able to write PNG outputs

jglaser avatar Jan 07 '24 19:01 jglaser