alarm-redist / redist

Simulation methods for legislative redistricting.
https://alarm-redist.github.io/redist/
GNU General Public License v2.0
66 stars 23 forks source link

QoL Feature: Auto-generate reference plans with `redist_plans()` from `colnames(plans)`. #159

Closed christopherkenny closed 11 months ago

christopherkenny commented 1 year ago

If an input to plans has names, we should have an option to automatically make those reference plans with those names as the draw column.

CoryMcCartan commented 11 months ago

This is handled automatically now in the sense that a named plan at the start is identified as a reference (see get_n_ref() on the resulting object). But that's not reflected in the draw column. So I'll have the constructor use the names, when available, in creating draw. We'll leave it undocumented since it gets messy fast once you start to allow named plans in locations other than the leftmost positions (need to rearrange everything to move them to the front, etc...). But the round-trip of plans -> matrix -> plans will be a lot better.