Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dials.background with no imageset #2163

Merged
merged 3 commits into from
Jul 20, 2022
Merged

dials.background with no imageset #2163

merged 3 commits into from
Jul 20, 2022

Conversation

dagewa
Copy link
Member

@dagewa dagewa commented Jul 7, 2022

Avoid crash like

dials.background non-existent.expt plot=background.png images=1,600
The following parameters have been modified:

images = 1 600
output {
  plot = "background.png"
}

DIALS (2018) Acta Cryst. D74, 85-97. https://doi.org/10.1107/S2059798317017235
DIALS 3.dev
Traceback (most recent call last):
  File "/home/fcx32934/sw/cctbx/build/../modules/dials/src/dials/command_line/background.py", line 247, in <module>
    run()
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/home/fcx32934/sw/cctbx/build/../modules/dials/src/dials/command_line/background.py", line 149, in run
    if len(imagesets) > 1 or len(images) > 1:
UnboundLocalError: Please report this error to dials-support@lists.sourceforge.net: local variable 'images' referenced before assignment

by checking for an empty experiment list.

dagewa and others added 3 commits July 7, 2022 11:55
Otherwise the program could be run like:

dials.background non-existent.expt images=1,600

and would crash later on.
@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #2163 (b745a21) into main (6cefa4f) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2163      +/-   ##
==========================================
- Coverage   80.59%   80.57%   -0.02%     
==========================================
  Files         585      585              
  Lines       66211    66254      +43     
  Branches     9341     9365      +24     
==========================================
+ Hits        53360    53382      +22     
- Misses      10802    10816      +14     
- Partials     2049     2056       +7     

@dagewa dagewa merged commit a0188fe into main Jul 20, 2022
@dagewa dagewa deleted the background-no-imageset branch July 20, 2022 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants