Voting-Rights-Code / Equitable-Polling-Locations

Optimization tool for selecting the most equiatable set of polling locations (by Kolm-Pollack distance)
GNU General Public License v3.0
9 stars 3 forks source link

Graph functions 2 testing #51

Closed Amasus closed 2 months ago

Amasus commented 2 months ago

This pull request is mostly about a refactoring of graph_functions.r (now graph_functions_deprecated.r) so that it reads data from the config files. Key changes include:

  1. Automated descriptor generation
    1. This requires checking that every config folder varies in exactly 1 field
    2. This was not previously true. Therefore,
      1. Config files have been rearranged
      2. A new config field has been added
    3. The automatically generated descriptor is informative but does not necessarily give descriptors that are useful for graphing. Thereofore in many of the graph description files, a second "change descriptor" step is added. This is a manual process, and feels like it should be up near the constants. REVIEWER ASK: Please review this process and give feedback
    4. REVIEWER ASK: If you find places where graph functions or map_functions is still identifying what to do based on grepl calls, please tag and ask me to fix. This is no longer an acceptable solution.
    5. REVIEWER ASK: Currently, the flow feels like the config files are being read in multiple times. While this doesn't affect the functionality, it seems inefficient. Thoughts welcomed.
  2. Errors found in config files for Madison. The straight line versions of these have been corrected and rerun. The driving distances have not been.
  3. Automated global driving distance generation.
  4. A new function to compare the placements across two different config folders (needed for Gwinnett_12_for_2024)
  5. Refactoring of the 2 Madison and Savannah files to accommodate the above changes. Same for Gwinnett_12_for_2024. FFA_maps and FFA_graphs should now be deprecated, and replaced by basic_analysis
    1. I've made an attempt to combine the mapping and the graphing into one file in the above cases.
  6. CLC_analysis and Engage_VA_analysis have not been refactored. They should be clearly marked as deprecated.
  7. REVIEWER ASK: Before you approve these changes, please delete the graph_functions_deprecated file to keep the working tree clean.
antisocialscientist commented 2 months ago

get_driving_flag and set_global_driving_flag need to be cleaned up

antisocialscientist commented 2 months ago

rename intermediate config_file_name

antisocialscientist commented 2 months ago

graph_functions.R line 235: update documentation

antisocialscientist commented 2 months ago

Confirm before merging: The function combine_results has not changed, we are just making the final passed parameter a bit clearer to the reader?

Amasus commented 2 months ago

Confirm before merging: The function combine_results has not changed, we are just making the final passed parameter a bit clearer to the reader?

No, combine results is one of the files that has changed the most.