dhmit / gender_analysis

A toolkit for analyzing gendered language across sets of documents
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

Remove Client-Facing Counter Objects #126

Closed samimak37 closed 4 years ago

samimak37 commented 4 years ago

The analysis functions (along with Corpus and Document classes) used a mix of dictionaries and Counter objects for their return values. This has now been standardized to only returning dictionary objects, although Counter objects are still used internally.

codecov-io commented 4 years ago

Codecov Report

Merging #126 into master will decrease coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
- Coverage   42.59%   42.55%   -0.04%     
==========================================
  Files          10       10              
  Lines        1594     1586       -8     
  Branches      353      351       -2     
==========================================
- Hits          679      675       -4     
+ Misses        861      857       -4     
  Partials       54       54              
Impacted Files Coverage Δ
gender_analysis/analysis/dunning.py 30.29% <100.00%> (ø)
gender_analysis/analysis/gender_adjective.py 38.52% <100.00%> (-0.85%) :arrow_down:
gender_analysis/analysis/gender_frequency.py 49.44% <100.00%> (-0.19%) :arrow_down:
gender_analysis/corpus.py 62.18% <100.00%> (ø)
gender_analysis/document.py 84.37% <100.00%> (ø)
gender_analysis/analysis/instance_distance.py 34.58% <0.00%> (+0.25%) :arrow_up:

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 ee1d41f...955691a. Read the comment docs.

ryaanahmed commented 4 years ago

@samimak37 is there any particular reason not to standardize all of these into Counter objects instead of dicts? Unless I'm missing something, these can all be counters, and since Counter is a dict subclass, the caller can choose to use them as dicts or Counters as they please if we standardize in that direction. Plus -- adds a little convenience for folks who are using them for common counter-y things.