cctbx / cctbx_project

Computational Crystallography Toolbox
https://cci.lbl.gov/docs/cctbx
Other
207 stars 111 forks source link

Precession viewer fails to export a png file #950

Open jglaser opened 5 months ago

jglaser commented 5 months ago

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

olegsobolev commented 5 months ago

Thank you for pointing this out. Fixed typo: 66949ba22c5dee1a7ca55e6f404defa50073b872 Exposed parameter: 432483d0bc40012e789a634193ae43aa3cdbef10