Add option to disable cut_edges updater with use_cut_edges flag #375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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