From 81dab360a190ac70d5fd8c8ef871d60e1002ab00 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Mon, 22 Jun 2026 21:10:27 +0530 Subject: [PATCH] fix: rename stem_and_suffix to stem_and_affix in tests stem_and_suffix does not exist in core/forms/utils.py or anywhere else in the codebase. The correct function name is stem_and_affix. Affected files: - tests/test_adoption.py: fix import and 3 call sites - tests/test_agent.py: fix 1 call site - tests/test_compression.py: fix 2 call sites - tests/test_induction.py: fix 2 call sites Signed-off-by: Himanshu Verma --- .gitignore | 1 + tests/test_adoption.py | 8 ++++---- tests/test_agent.py | 2 +- tests/test_compression.py | 4 ++-- tests/test_induction.py | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 70c18a5..f3c5e4d 100644 --- a/.gitignore +++ b/.gitignore @@ -207,3 +207,4 @@ __marimo__/ **/simulation_*/ **/results/ exploratory_experiments/generated/ +.idea/ diff --git a/tests/test_adoption.py b/tests/test_adoption.py index 88f3aeb..fdce066 100644 --- a/tests/test_adoption.py +++ b/tests/test_adoption.py @@ -15,7 +15,7 @@ ) from core.forms.morphology import Morphology from core.phonology.phonrules import Cascade -from core.forms.utils import stem_and_suffix, make_form +from core.forms.utils import stem_and_affix, make_form # ----------------- minimal helpers/fixtures ----------------- @@ -47,7 +47,7 @@ def small_morph() -> Morphology: def alt_form(form: str) -> str: """Change the stem but keep the suffix.""" - base, suf = stem_and_suffix(form) + base, suf = stem_and_affix(form) return make_form(base + "_alt", suf) @@ -129,11 +129,11 @@ def test_bernoulli_stem_form_is_target_updates_row(self) -> None: self.assertTrue(changed) # All slots for this lexeme should share the new stem - base_new, _ = stem_and_suffix(candidate) + base_new, _ = stem_and_affix(candidate) stem = morph.stem_list[stem_id] row_forms = morph.word_forms[stem].forms for f in row_forms: - b, _ = stem_and_suffix(f) + b, _ = stem_and_affix(f) self.assertEqual(b, base_new) # ---------- DegreeAdoption ---------- diff --git a/tests/test_agent.py b/tests/test_agent.py index cbf994b..c75586e 100644 --- a/tests/test_agent.py +++ b/tests/test_agent.py @@ -29,7 +29,7 @@ def make_small_morph() -> morph.Morphology: def split_form(form: str) -> Tuple[str, str]: - base, suf = morph.stem_and_suffix(form) + base, suf = morph.stem_and_affix(form) return base, suf diff --git a/tests/test_compression.py b/tests/test_compression.py index 19c76cf..e64621a 100644 --- a/tests/test_compression.py +++ b/tests/test_compression.py @@ -35,7 +35,7 @@ def set_row_signature_by_mutating( We map index 0 -> original base, 1 -> base_x, 2 -> base_y, etc. """ # Build base strings per index - base0, _ = morph.stem_and_suffix(m.get_form(row, 0)) + base0, _ = morph.stem_and_affix(m.get_form(row, 0)) base_for: Dict[int, str] = {0: base0} # Pre-compute distinct alt bases we may need for idx in set(signature): @@ -45,7 +45,7 @@ def set_row_signature_by_mutating( # Rewrite each slot with desired base + original suffix for s, idx in enumerate(signature): - _, suf = morph.stem_and_suffix(m.get_form(row, s)) + _, suf = morph.stem_and_affix(m.get_form(row, s)) print(suf) new_form = morph.make_form(base_for[idx], suf) m.set_form(row, s, new_form) diff --git a/tests/test_induction.py b/tests/test_induction.py index 75392ee..9495cda 100644 --- a/tests/test_induction.py +++ b/tests/test_induction.py @@ -30,7 +30,7 @@ def set_row_signature_by_mutating( m: morph.Morphology, row: int, signature: Tuple[int, ...] ) -> None: """Force a row's stem-alternation signature by rewriting bases slot-wise.""" - base0, _ = morph.stem_and_suffix(m.get_form(row, 0)) + base0, _ = morph.stem_and_affix(m.get_form(row, 0)) base_for: Dict[int, str] = {0: base0} for idx in set(signature): if idx == 0: @@ -38,7 +38,7 @@ def set_row_signature_by_mutating( base_for[idx] = f"{base0}_alt{idx}" for s, idx in enumerate(signature): - _, suf = morph.stem_and_suffix(m.get_form(row, s)) + _, suf = morph.stem_and_affix(m.get_form(row, s)) new_form = morph.make_form(base_for[idx], suf) m.set_form(row, s, new_form)