-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationmetaGeneral notes or goalsGeneral notes or goals
Description
In several functions, we have doctests that are effectively info-dumping a large and complex dictionary. This might be fine for internal tests, but we should simplify the doctests for user readability. For instance:
gender_analysis/gender_analysis/analysis/gender_frequency.py
Lines 266 to 271 in ee1d41f
| >>> from gender_analysis.corpus import Corpus | |
| >>> from gender_analysis.common import TEST_DATA_PATH | |
| >>> filepath = TEST_DATA_PATH / 'test_corpus' | |
| >>> csvpath = TEST_DATA_PATH / 'test_corpus' / 'test_corpus.csv' | |
| >>> subject_vs_object_pronoun_freqs(Corpus(filepath, csv_path=csvpath)) | |
| ({<Document (aanrud_longfrock)>: 0.7947761194029851, <Document (abbott_flatlandromance)>: 0.6775956284153005, <Document (abbott_indiscreetletter)>: 0.7938931297709924, <Document (adams_fighting)>: 0.7188093730208993, <Document (alcott_josboys)>: 0.6339066339066339, <Document (alcott_littlemen)>: 0.6444245409762652, <Document (alcott_littlewomen)>: 0.6580560420315237, <Document (alden_chautauqua)>: 0.7583798882681564, <Document (austen_emma)>: 0.7038087520259318, <Document (austen_persuasion)>: 0.6743697478991596}, {<Document (aanrud_longfrock)>: 0.5380577427821522, <Document (abbott_flatlandromance)>: 0.21666666666666667, <Document (abbott_indiscreetletter)>: 0.4457831325301205, <Document (adams_fighting)>: 0.4358523725834798, <Document (alcott_josboys)>: 0.38636363636363635, <Document (alcott_littlemen)>: 0.43631613324624424, <Document (alcott_littlewomen)>: 0.41256335988414194, <Document (alden_chautauqua)>: 0.5462994836488813, <Document (austen_emma)>: 0.4831533477321814, <Document (austen_persuasion)>: 0.48742004264392325}) |
This outputted dictionary is much too long to act as a meaningful example for someone that is trying to understand the function, and we could probably simplify it by just breaking up the output into different components or trimming down the dictionary.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationmetaGeneral notes or goalsGeneral notes or goals