Fix bug -- row partition was incorrectly recorded.
I suspect itertools.groupby wasn't behaving as we expected.
@@ -967,9 +967,12 @@ class CGPM_Backend(BayesDB_Backend):
# cluster number.
clusters_for_views = [
[
- [rowno for (rowno, _) in group]
- for (_, group) in itertools.groupby(sorted(view.Zr().items()),
- key=operator.itemgetter(1))
+ sorted([
+ rowid
+ for (rowid, current_cluster_index) in view.Zr().items()
+ if current_cluster_index==cluster_index
+ ])
+ for cluster_index in sorted(set(view.Zr().values()))
]
for view in state.views.values()
]
