Repository: kylebgorman/wikipron

Issue:
Phoneme count bug
As pointed out by @ajmalanoski in #387, the phoneme summary counter in `generate_phones_summary.py` is actualy counting lines, not phonemes, and we allow blank lines.


Discussion:
ajmalanoski: Ah, the same error pointed out in #390 also applies to `tests/test_data/test_summary.py`, i.e., the testing script wants the numbers in `data/phones/phones_summary.tsv` to match the length of the corresponding `.phones` file (rather than the actual number of phones within the file). I'll fix that

```
AssertionError: Number of entries in ady_phonetic.phones does not match number of entries in data/phones/phones_summary.tsv.
assert 67 == 72
  +67
  -72
def test_phones_data_matches_summary():
        """Check if each .phones file in data/phones is present in
        data/phones/phones_summary.tsv and if the number of phones in each .phones
        file matches its listed number of phones in data/phones_summary.tsv.
    
        (Basically checks whether generate_phones_summary.py has been run.)
        """
        name_to_count = {}
        with open(_PHONES_SUMMARY, "r", encoding="utf-8") as phones_summary:
            for line in phones_summary:
                language = line.rstrip().split("\t")
                name_to_count[language[0]] = int(language[-1])
    
        for phones_list in os.listdir(_PHONES_DIRECTORY):
            if phones_list.endswith(".phones"):
                with open(
                    f"{_PHONES_DIRECTORY}/{phones_list}", "r", encoding="utf-8"
                ) as tsv:
                    # Subtracting one for final blank line.
                    num_of_entries = sum(1 for line in tsv) - 1
                assert phones_list in name_to_count, (
                    f"{phones_list} in data/phones but not in "
                    "data/phones/phones_summary.tsv"
                )
>               assert name_to_count[phones_list] == num_of_entries, (
                    f"Number of entries in {phones_list} does not match "
                    "number of entries in data/phones/phones_summary.tsv."
                )
E               AssertionError: Number of entries in ady_phonetic.phones does not match number of entries in data/phones/phones_summary.tsv.
E               assert 67 == 72
E                 +67
E                 -72

project/tests/test_data/test_summary.py:69: AssertionError
```
kylebgorman: You can fix this by just rerunning `generate_phones_summary.py`, right?

On Wed, Mar 24, 2021 at 10:41 PM Aidan Malanoski ***@***.***>
wrote:

> Ah, the same error pointed out in #390
> <https://github.com/kylebgorman/wikipron/issues/390> also applies to
> tests/test_data/test_summary.py, i.e., the testing script wants the
> numbers in data/phones/phones_summary.tsv to match the length of the
> corresponding .phones file (rather than the actual number of phones
> within the file). I'll fix that
>
> AssertionError: Number of entries in ady_phonetic.phones does not match number of entries in data/phones/phones_summary.tsv.
> assert 67 == 72
>   +67
>   -72
> def test_phones_data_matches_summary():
>         """Check if each .phones file in data/phones is present in
>         data/phones/phones_summary.tsv and if the number of phones in each .phones
>         file matches its listed number of phones in data/phones_summary.tsv.
>
>         (Basically checks whether generate_phones_summary.py has been run.)
>         """
>         name_to_count = {}
>         with open(_PHONES_SUMMARY, "r", encoding="utf-8") as phones_summary:
>             for line in phones_summary:
>                 language = line.rstrip().split("\t")
>                 name_to_count[language[0]] = int(language[-1])
>
>         for phones_list in os.listdir(_PHONES_DIRECTORY):
>             if phones_list.endswith(".phones"):
>                 with open(
>                     f"{_PHONES_DIRECTORY}/{phones_list}", "r", encoding="utf-8"
>                 ) as tsv:
>                     # Subtracting one for final blank line.
>                     num_of_entries = sum(1 for line in tsv) - 1
>                 assert phones_list in name_to_count, (
>                     f"{phones_list} in data/phones but not in "
>                     "data/phones/phones_summary.tsv"
>                 )
> >               assert name_to_count[phones_list] == num_of_entries, (
>                     f"Number of entries in {phones_list} does not match "
>                     "number of entries in data/phones/phones_summary.tsv."
>                 )
> E               AssertionError: Number of entries in ady_phonetic.phones does not match number of entries in data/phones/phones_summary.tsv.
> E               assert 67 == 72
> E                 +67
> E                 -72
>
> project/tests/test_data/test_summary.py:69: AssertionError
>
> —
> You are receiving this because your review was requested.
> Reply to this email directly, view it on GitHub
> <https://github.com/kylebgorman/wikipron/pull/392#issuecomment-806320086>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AABG4OMLPBTSQACLKWQ44XDTFKPGFANCNFSM4ZYOTCGQ>
> .
>

ajmalanoski: I re-ran `generate_phones_summary.py` before I pushed (and pushed the modified README and phones summary)
kylebgorman: Ah okay. Well I guess my only recommendation is to use `.startswith`
instead of line[0]`.

On Wed, Mar 24, 2021 at 10:59 PM Aidan Malanoski ***@***.***>
wrote:

> ***@***.**** commented on this pull request.
> ------------------------------
>
> In data/src/generate_phones_summary.py
> <https://github.com/kylebgorman/wikipron/pull/392#discussion_r601007754>:
>
> > @@ -53,8 +53,10 @@ def main() -> None:
>          if file_path.endswith(".md") or file_path.endswith("tsv"):
>              continue
>          with open(f"{path}/{file_path}", "r", encoding="utf-8") as phone_list:
> -            # We subtract one for the final newline.
> -            num_of_entries = sum(1 for line in phone_list) - 1
> +            # We exclude blank lines and comments.
> +            num_of_entries = sum(
> +                1 for line in phone_list if line.strip() and line[0] != "#"
>
> Okay, that makes more sense lol. But I think this will (incorrectly) count
> blank lines, since e.g. not "\n".lstrip().startswith("#") is True.
>
> —
> You are receiving this because your review was requested.
> Reply to this email directly, view it on GitHub
> <https://github.com/kylebgorman/wikipron/pull/392#discussion_r601007754>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AABG4OIM346PJELS3RR46B3TFKRIJANCNFSM4ZYOTCGQ>
> .
>

ajmalanoski: Done. Does everything look good?

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 85a299f..79cc751 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,7 @@ Unreleased
 -   Configured and scraped Yamphu (`ybi`). (\#380)
 -   Configured and scraped Khumi Chin (`cnk`). (\#381)
 -   Made summary generation in `common_characters.py` optional. (\#382)
+-   Fixed phone counting in `data/src/generate_phones_summary.py` (\#390, \#392)
 
 ### Under `wikipron/` and elsewhere
 
diff --git a/data/phones/README.md b/data/phones/README.md
index 8dce605..2376d04 100644
--- a/data/phones/README.md
+++ b/data/phones/README.md
@@ -1,41 +1,41 @@
 See the [HOWTO](HOWTO.md) for the steps to generate phone lists.
 | Link | ISO 639-2 Code | ISO 639 Language Name | Wiktionary Language Name | Phonetic/Phonemic | # of phones |
 | :---- | :----: | :----: | :----: | :----: | :----: |
-| [phone](ady_phonetic.phones) | ady | Adygei; Adyghe | Adyghe | Phonetic | 72 |
-| [phone](afr_phonemic.phones) | afr | Afrikaans | Afrikaans | Phonemic | 66 |
-| [phone](arm_e_phonetic.phones) | arm | Armenian | Armenian (Eastern Armenian, standard) | Phonetic | 105 |
-| [phone](arm_w_phonetic.phones) | arm | Armenian | Armenian (Western Armenian, standard) | Phonetic | 110 |
-| [phone](aze_phonetic.phones) | aze | Azerbaijani | Azerbaijani | Phonetic | 70 |
-| [phone](bul_phonemic.phones) | bul | Bulgarian | Bulgarian | Phonemic | 55 |
-| [phone](bur_phonemic.phones) | bur | Burmese | Burmese | Phonemic | 88 |
-| [phone](dut_phonemic.phones) | dut | Dutch; Flemish | Dutch | Phonemic | 53 |
-| [phone](eng_uk_phonemic.phones) | eng | English | English (UK, Received Pronunciation) | Phonemic | 68 |
-| [phone](eng_us_phonemic.phones) | eng | English | English (US, General American) | Phonemic | 67 |
-| [phone](fre_phonemic.phones) | fre | French | French | Phonemic | 41 |
-| [phone](geo_phonemic.phones) | geo | Georgian | Georgian | Phonemic | 42 |
-| [phone](ger_phonemic.phones) | ger | German | German | Phonemic | 91 |
-| [phone](gre_phonemic.phones) | gre | Modern Greek (1453-) | Greek | Phonemic | 40 |
-| [phone](hin_phonemic.phones) | hin | Hindi | Hindi | Phonemic | 72 |
-| [phone](hun_phonetic.phones) | hun | Hungarian | Hungarian | Phonetic | 91 |
-| [phone](ice_phonemic.phones) | ice | Icelandic | Icelandic | Phonemic | 87 |
-| [phone](ita_phonemic.phones) | ita | Italian | Italian | Phonemic | 39 |
-| [phone](jpn_phonetic.phones) | jpn | Japanese | Japanese | Phonetic | 67 |
-| [phone](khm_phonemic.phones) | khm | Khmer | Khmer | Phonemic | 90 |
-| [phone](kor_phonetic.phones) | kor | Korean | Korean | Phonetic | 60 |
+| [phone](ady_phonetic.phones) | ady | Adygei; Adyghe | Adyghe | Phonetic | 67 |
+| [phone](afr_phonemic.phones) | afr | Afrikaans | Afrikaans | Phonemic | 61 |
+| [phone](arm_e_phonetic.phones) | arm | Armenian | Armenian (Eastern Armenian, standard) | Phonetic | 72 |
+| [phone](arm_w_phonetic.phones) | arm | Armenian | Armenian (Western Armenian, standard) | Phonetic | 72 |
+| [phone](aze_phonetic.phones) | aze | Azerbaijani | Azerbaijani | Phonetic | 54 |
+| [phone](bul_phonemic.phones) | bul | Bulgarian | Bulgarian | Phonemic | 52 |
+| [phone](bur_phonemic.phones) | bur | Burmese | Burmese | Phonemic | 70 |
+| [phone](dut_phonemic.phones) | dut | Dutch; Flemish | Dutch | Phonemic | 50 |
+| [phone](eng_uk_phonemic.phones) | eng | English | English (UK, Received Pronunciation) | Phonemic | 64 |
+| [phone](eng_us_phonemic.phones) | eng | English | English (US, General American) | Phonemic | 63 |
+| [phone](fre_phonemic.phones) | fre | French | French | Phonemic | 40 |
+| [phone](geo_phonemic.phones) | geo | Georgian | Georgian | Phonemic | 36 |
+| [phone](ger_phonemic.phones) | ger | German | German | Phonemic | 83 |
+| [phone](gre_phonemic.phones) | gre | Modern Greek (1453-) | Greek | Phonemic | 33 |
+| [phone](hin_phonemic.phones) | hin | Hindi | Hindi | Phonemic | 64 |
+| [phone](hun_phonetic.phones) | hun | Hungarian | Hungarian | Phonetic | 86 |
+| [phone](ice_phonemic.phones) | ice | Icelandic | Icelandic | Phonemic | 71 |
+| [phone](ita_phonemic.phones) | ita | Italian | Italian | Phonemic | 32 |
+| [phone](jpn_phonetic.phones) | jpn | Japanese | Japanese | Phonetic | 64 |
+| [phone](khm_phonemic.phones) | khm | Khmer | Khmer | Phonemic | 73 |
+| [phone](kor_phonetic.phones) | kor | Korean | Korean | Phonetic | 61 |
 | [phone](lat_clas_phonemic.phones) | lat | Latin | Latin (Classical) | Phonemic | 36 |
-| [phone](lav_phonetic.phones) | lav | Latvian | Latvian | Phonetic | 115 |
-| [phone](mlt_phonemic.phones) | mlt | Maltese | Maltese | Phonemic | 78 |
-| [phone](nob_phonemic.phones) | nob | Norwegian Bokmål | Norwegian Bokmål | Phonemic | 67 |
-| [phone](por_bz_phonemic.phones) | por | Portuguese | Portuguese (Brazil) | Phonemic | 61 |
-| [phone](por_po_phonemic.phones) | por | Portuguese | Portuguese (Portugal) | Phonemic | 54 |
-| [phone](rum_phonetic.phones) | rum | Romanian; Moldavian; Moldovan | Romanian | Phonetic | 55 |
-| [phone](hbs_phonemic.phones) | hbs | Serbo-Croatian | Serbo-Croatian | Phonemic | 71 |
-| [phone](slv_phonemic.phones) | slv | Slovenian | Slovene | Phonemic | 51 |
-| [phone](spa_ca_phonemic.phones) | spa | Spanish; Castilian | Spanish (Castilian) | Phonemic | 33 |
-| [phone](spa_la_phonemic.phones) | spa | Spanish; Castilian | Spanish (Latin America) | Phonemic | 29 |
-| [phone](tur_phonetic.phones) | tur | Turkish | Turkish | Phonetic | 56 |
-| [phone](vie_hue_phonetic.phones) | vie | Vietnamese | Vietnamese (Huế) | Phonetic | 63 |
-| [phone](vie_hanoi_phonetic.phones) | vie | Vietnamese | Vietnamese (Hà Nội) | Phonetic | 64 |
-| [phone](vie_hcmc_phonetic.phones) | vie | Vietnamese | Vietnamese (Hồ Chí Minh City) | Phonetic | 53 |
-| [phone](wel_nw_phonemic.phones) | wel | Welsh | Welsh (North Wales) | Phonemic | 71 |
-| [phone](wel_sw_phonemic.phones) | wel | Welsh | Welsh (South Wales) | Phonemic | 61 |
+| [phone](lav_phonetic.phones) | lav | Latvian | Latvian | Phonetic | 89 |
+| [phone](mlt_phonemic.phones) | mlt | Maltese | Maltese | Phonemic | 59 |
+| [phone](nob_phonemic.phones) | nob | Norwegian Bokmål | Norwegian Bokmål | Phonemic | 54 |
+| [phone](por_bz_phonemic.phones) | por | Portuguese | Portuguese (Brazil) | Phonemic | 55 |
+| [phone](por_po_phonemic.phones) | por | Portuguese | Portuguese (Portugal) | Phonemic | 48 |
+| [phone](rum_phonetic.phones) | rum | Romanian; Moldavian; Moldovan | Romanian | Phonetic | 51 |
+| [phone](hbs_phonemic.phones) | hbs | Serbo-Croatian | Serbo-Croatian | Phonemic | 65 |
+| [phone](slv_phonemic.phones) | slv | Slovenian | Slovene | Phonemic | 48 |
+| [phone](spa_ca_phonemic.phones) | spa | Spanish; Castilian | Spanish (Castilian) | Phonemic | 29 |
+| [phone](spa_la_phonemic.phones) | spa | Spanish; Castilian | Spanish (Latin America) | Phonemic | 27 |
+| [phone](tur_phonetic.phones) | tur | Turkish | Turkish | Phonetic | 51 |
+| [phone](vie_hue_phonetic.phones) | vie | Vietnamese | Vietnamese (Huế) | Phonetic | 53 |
+| [phone](vie_hanoi_phonetic.phones) | vie | Vietnamese | Vietnamese (Hà Nội) | Phonetic | 54 |
+| [phone](vie_hcmc_phonetic.phones) | vie | Vietnamese | Vietnamese (Hồ Chí Minh City) | Phonetic | 50 |
+| [phone](wel_nw_phonemic.phones) | wel | Welsh | Welsh (North Wales) | Phonemic | 63 |
+| [phone](wel_sw_phonemic.phones) | wel | Welsh | Welsh (South Wales) | Phonemic | 55 |
diff --git a/data/phones/phones_summary.tsv b/data/phones/phones_summary.tsv
index 8c5d7be..afec264 100644
--- a/data/phones/phones_summary.tsv
+++ b/data/phones/phones_summary.tsv
@@ -1,38 +1,38 @@
-ady_phonetic.phones	ady	Adygei; Adyghe	Adyghe	Phonetic	72
-afr_phonemic.phones	afr	Afrikaans	Afrikaans	Phonemic	66
-arm_e_phonetic.phones	arm	Armenian	Armenian (Eastern Armenian, standard)	Phonetic	105
-arm_w_phonetic.phones	arm	Armenian	Armenian (Western Armenian, standard)	Phonetic	110
-aze_phonetic.phones	aze	Azerbaijani	Azerbaijani	Phonetic	70
-bul_phonemic.phones	bul	Bulgarian	Bulgarian	Phonemic	55
-bur_phonemic.phones	bur	Burmese	Burmese	Phonemic	88
-dut_phonemic.phones	dut	Dutch; Flemish	Dutch	Phonemic	53
-eng_uk_phonemic.phones	eng	English	English (UK, Received Pronunciation)	Phonemic	68
-eng_us_phonemic.phones	eng	English	English (US, General American)	Phonemic	67
-fre_phonemic.phones	fre	French	French	Phonemic	41
-geo_phonemic.phones	geo	Georgian	Georgian	Phonemic	42
-ger_phonemic.phones	ger	German	German	Phonemic	91
-gre_phonemic.phones	gre	Modern Greek (1453-)	Greek	Phonemic	40
-hin_phonemic.phones	hin	Hindi	Hindi	Phonemic	72
-hun_phonetic.phones	hun	Hungarian	Hungarian	Phonetic	91
-ice_phonemic.phones	ice	Icelandic	Icelandic	Phonemic	87
-ita_phonemic.phones	ita	Italian	Italian	Phonemic	39
-jpn_phonetic.phones	jpn	Japanese	Japanese	Phonetic	67
-khm_phonemic.phones	khm	Khmer	Khmer	Phonemic	90
-kor_phonetic.phones	kor	Korean	Korean	Phonetic	60
+ady_phonetic.phones	ady	Adygei; Adyghe	Adyghe	Phonetic	67
+afr_phonemic.phones	afr	Afrikaans	Afrikaans	Phonemic	61
+arm_e_phonetic.phones	arm	Armenian	Armenian (Eastern Armenian, standard)	Phonetic	72
+arm_w_phonetic.phones	arm	Armenian	Armenian (Western Armenian, standard)	Phonetic	72
+aze_phonetic.phones	aze	Azerbaijani	Azerbaijani	Phonetic	54
+bul_phonemic.phones	bul	Bulgarian	Bulgarian	Phonemic	52
+bur_phonemic.phones	bur	Burmese	Burmese	Phonemic	70
+dut_phonemic.phones	dut	Dutch; Flemish	Dutch	Phonemic	50
+eng_uk_phonemic.phones	eng	English	English (UK, Received Pronunciation)	Phonemic	64
+eng_us_phonemic.phones	eng	English	English (US, General American)	Phonemic	63
+fre_phonemic.phones	fre	French	French	Phonemic	40
+geo_phonemic.phones	geo	Georgian	Georgian	Phonemic	36
+ger_phonemic.phones	ger	German	German	Phonemic	83
+gre_phonemic.phones	gre	Modern Greek (1453-)	Greek	Phonemic	33
+hin_phonemic.phones	hin	Hindi	Hindi	Phonemic	64
+hun_phonetic.phones	hun	Hungarian	Hungarian	Phonetic	86
+ice_phonemic.phones	ice	Icelandic	Icelandic	Phonemic	71
+ita_phonemic.phones	ita	Italian	Italian	Phonemic	32
+jpn_phonetic.phones	jpn	Japanese	Japanese	Phonetic	64
+khm_phonemic.phones	khm	Khmer	Khmer	Phonemic	73
+kor_phonetic.phones	kor	Korean	Korean	Phonetic	61
 lat_clas_phonemic.phones	lat	Latin	Latin (Classical)	Phonemic	36
-lav_phonetic.phones	lav	Latvian	Latvian	Phonetic	115
-mlt_phonemic.phones	mlt	Maltese	Maltese	Phonemic	78
-nob_phonemic.phones	nob	Norwegian Bokmål	Norwegian Bokmål	Phonemic	67
-por_bz_phonemic.phones	por	Portuguese	Portuguese (Brazil)	Phonemic	61
-por_po_phonemic.phones	por	Portuguese	Portuguese (Portugal)	Phonemic	54
-rum_phonetic.phones	rum	Romanian; Moldavian; Moldovan	Romanian	Phonetic	55
-hbs_phonemic.phones	hbs	Serbo-Croatian	Serbo-Croatian	Phonemic	71
-slv_phonemic.phones	slv	Slovenian	Slovene	Phonemic	51
-spa_ca_phonemic.phones	spa	Spanish; Castilian	Spanish (Castilian)	Phonemic	33
-spa_la_phonemic.phones	spa	Spanish; Castilian	Spanish (Latin America)	Phonemic	29
-tur_phonetic.phones	tur	Turkish	Turkish	Phonetic	56
-vie_hue_phonetic.phones	vie	Vietnamese	Vietnamese (Huế)	Phonetic	63
-vie_hanoi_phonetic.phones	vie	Vietnamese	Vietnamese (Hà Nội)	Phonetic	64
-vie_hcmc_phonetic.phones	vie	Vietnamese	Vietnamese (Hồ Chí Minh City)	Phonetic	53
-wel_nw_phonemic.phones	wel	Welsh	Welsh (North Wales)	Phonemic	71
-wel_sw_phonemic.phones	wel	Welsh	Welsh (South Wales)	Phonemic	61
+lav_phonetic.phones	lav	Latvian	Latvian	Phonetic	89
+mlt_phonemic.phones	mlt	Maltese	Maltese	Phonemic	59
+nob_phonemic.phones	nob	Norwegian Bokmål	Norwegian Bokmål	Phonemic	54
+por_bz_phonemic.phones	por	Portuguese	Portuguese (Brazil)	Phonemic	55
+por_po_phonemic.phones	por	Portuguese	Portuguese (Portugal)	Phonemic	48
+rum_phonetic.phones	rum	Romanian; Moldavian; Moldovan	Romanian	Phonetic	51
+hbs_phonemic.phones	hbs	Serbo-Croatian	Serbo-Croatian	Phonemic	65
+slv_phonemic.phones	slv	Slovenian	Slovene	Phonemic	48
+spa_ca_phonemic.phones	spa	Spanish; Castilian	Spanish (Castilian)	Phonemic	29
+spa_la_phonemic.phones	spa	Spanish; Castilian	Spanish (Latin America)	Phonemic	27
+tur_phonetic.phones	tur	Turkish	Turkish	Phonetic	51
+vie_hue_phonetic.phones	vie	Vietnamese	Vietnamese (Huế)	Phonetic	53
+vie_hanoi_phonetic.phones	vie	Vietnamese	Vietnamese (Hà Nội)	Phonetic	54
+vie_hcmc_phonetic.phones	vie	Vietnamese	Vietnamese (Hồ Chí Minh City)	Phonetic	50
+wel_nw_phonemic.phones	wel	Welsh	Welsh (North Wales)	Phonemic	63
+wel_sw_phonemic.phones	wel	Welsh	Welsh (South Wales)	Phonemic	55
diff --git a/data/src/generate_phones_summary.py b/data/src/generate_phones_summary.py
index 715bafd..2b8fb4c 100755
--- a/data/src/generate_phones_summary.py
+++ b/data/src/generate_phones_summary.py
@@ -53,8 +53,12 @@ def main() -> None:
         if file_path.endswith(".md") or file_path.endswith("tsv"):
             continue
         with open(f"{path}/{file_path}", "r", encoding="utf-8") as phone_list:
-            # We subtract one for the final newline.
-            num_of_entries = sum(1 for line in phone_list) - 1
+            # We exclude blank lines and comments.
+            num_of_entries = sum(
+                1
+                for line in phone_list
+                if line.strip() and not line.startswith("#")
+            )
         iso639_code = file_path[: file_path.index("_")]
         transcription_level = file_path[
             file_path.index("phone") : file_path.index(".")


Test patch:
diff --git a/tests/test_data/test_summary.py b/tests/test_data/test_summary.py
index 5d27422..1af3c3f 100644
--- a/tests/test_data/test_summary.py
+++ b/tests/test_data/test_summary.py
@@ -60,8 +60,12 @@ def test_phones_data_matches_summary():
             with open(
                 f"{_PHONES_DIRECTORY}/{phones_list}", "r", encoding="utf-8"
             ) as tsv:
-                # Subtracting one for final blank line.
-                num_of_entries = sum(1 for line in tsv) - 1
+                # We exclude blank lines and comments.
+                num_of_entries = sum(
+                    1
+                    for line in tsv
+                    if line.strip() and not line.startswith("#")
+                )
             assert phones_list in name_to_count, (
                 f"{phones_list} in data/phones but not in "
                 "data/phones/phones_summary.tsv"