mggg / GerryChain

Use MCMC to analyze districting plans and gerrymanders
https://mggg.github.io/GerryChain/
Other
132 stars 74 forks source link

Implement diversity stats collector (collect_diversity_stats func) #400

Closed InnovativeInventor closed 2 years ago

InnovativeInventor commented 2 years ago

This is a draft PR which adds a collect_diversity_stats() function that reports the diversity of a given chain. I will come back and add docs/tests.

codecov[bot] commented 2 years ago

Codecov Report

Merging #400 (3710eed) into main (27cc3cd) will increase coverage by 0.20%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #400      +/-   ##
==========================================
+ Coverage   87.77%   87.97%   +0.20%     
==========================================
  Files          37       39       +2     
  Lines        1742     1772      +30     
==========================================
+ Hits         1529     1559      +30     
  Misses        213      213              
Impacted Files Coverage Δ
gerrychain/meta/__init__.py 100.00% <100.00%> (ø)
gerrychain/meta/diversity.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 27cc3cd...3710eed. Read the comment docs.

InnovativeInventor commented 2 years ago

I just added docs and tests. Should be ready for review now.