PrincetonUniversity / gerrymandertests

Lots of metrics for quantifying gerrymandering.
GNU General Public License v3.0
25 stars 9 forks source link

Creating classes #3

Closed ojhermann closed 4 years ago

ojhermann commented 4 years ago

I've been playing with the methods in the metrics.py file and have found myself mimicking the functionality in new classes. For example, I've replaced use of _stats in metrics.py with a class I call VoteShares:

Screen Shot 2020-04-15 at 12 07 15 AM Screen Shot 2020-04-15 at 12 06 36 AM

I had hoped to put up an explanatory PR, but I'm not allowed to make pull requests. Would you have interest in adding some of these classes to your repo? They make some use of the methods a bit more concise e.g. mwu: MannWhitneyU = MannWhitneyU([.1, .2, .3, .4, .5, .6, .7, .8, .9, 1.0]) mwu.get_statistic() mwu.get_p_value()

hjohns12 commented 4 years ago

Thanks for your interest in gerrymetrics! I'm going to change your permissions so that you can submit a PR with these changes.

ojhermann commented 4 years ago

Thanks, @hjohns12

I'll submit the new classes on an individual basis over time; this should make potential debugging easier and allow me to add new classes as they're created.

Would you like me to unit testing for the classes?

hjohns12 commented 4 years ago

@ojhermann If you have time, that would be great. Thanks.

ojhermann commented 4 years ago

Hi @hjohns12 after accepting the invitation it does not appear that I have collaborator access e.g. I'm still receiving permission denied messages when I attempt to to push a branch. Would you mind adding me as a collaborator again?

indraneel commented 4 years ago

@ojhermann can you create a fork and open a PR from there?