This is a PR broken out from #372 to ease the code review process.
As noted in #368, the cut_edges updater is forcibly enabled by default for every Partition object. However, the user has no way of opting out of this expensive updater. Prior to pcompress, this wasn't a big deal. However, now that GerryChain runs are replayable (and since most analysis is now done with replayable chains), it doesn't make sense to force every partition to calculate the cut_edges updater.
As an example case where this would be useful, let's say that we want to draw election histograms or simply export a few sample maps in a recorded chain run (a fairly common occurrence). In this case, there would be no need to calculate the cut_edges and disabling the updater by providing the use_cut_edges flag would result in a significant speedup.
Note that this PR is backwards compatible. By default, cut_edges are calculated (use_cut_edges defaults to True and is an optional argument).
For some context, my replay speeds are roughly 1260 it/s (3-4x speedup) with this flag set to False. I'm open to renaming the flag name, if it seems unwieldy.
This is a PR broken out from #372 to ease the code review process.
As noted in #368, the
cut_edges
updater is forcibly enabled by default for every Partition object. However, the user has no way of opting out of this expensive updater. Prior topcompress
, this wasn't a big deal. However, now that GerryChain runs are replayable (and since most analysis is now done with replayable chains), it doesn't make sense to force every partition to calculate thecut_edges
updater.As an example case where this would be useful, let's say that we want to draw election histograms or simply export a few sample maps in a recorded chain run (a fairly common occurrence). In this case, there would be no need to calculate the
cut_edges
and disabling the updater by providing theuse_cut_edges
flag would result in a significant speedup.Note that this PR is backwards compatible. By default,
cut_edges
are calculated (use_cut_edges
defaults toTrue
and is an optional argument).Fixes #368