Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/2668.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``dials.cosym``: Make function return structure correct in recently added cc_weights option
6 changes: 3 additions & 3 deletions src/dials/algorithms/scaling/scaling_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def weighted_cchalf(
if not use_binning:
assert other.indices().size() == this.indices().size()
if this.data().size() == 0:
return None, None
return [(None, 0)]

if assume_index_matching:
(o, c) = (this, other)
Expand All @@ -507,7 +507,7 @@ def weighted_cchalf(
assert len(c.sigmas())
n = len(o.data())
if n == 1:
return None, 1
return [(None, 1)]
v_o = flex.pow2(o.sigmas())
v_c = flex.pow2(c.sigmas())
joint_w = 1.0 / (v_o + v_c)
Expand All @@ -522,7 +522,7 @@ def weighted_cchalf(
sx = flex.sum(flex.pow2(dx) * norm_jw)
sy = flex.sum(flex.pow2(dy) * norm_jw)
if sx == 0.0 or sy == 0.0:
return None, 0
return [(None, 1)]
# effective sample size of weighted sample
# Kish, Leslie. 1965. Survey Sampling New York: Wiley. (R documentation)
# neff = sum(w)^2 / sum(w^2). But sum(w) == 1 as normalised already
Expand Down