Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gensim/test/test_coherencemodel.py: Make testProcesses match implementation #3564

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gensim/test/test_coherencemodel.py: Make testProcesses match implemen…
…tation

Fixes this error when building on a single-CPU system:

=================================== FAILURES ===================================
_______________________ TestCoherenceModel.testProcesses _______________________

self = <gensim.test.test_coherencemodel.TestCoherenceModel testMethod=testProcesses>

    def testProcesses(self):
        get_model = partial(CoherenceModel,
            topics=self.topics1, corpus=self.corpus, dictionary=self.dictionary, coherence='u_mass'
        )

        model, used_cpus = get_model(), mp.cpu_count() - 1
>       self.assertEqual(model.processes, used_cpus)
E       AssertionError: 1 != 0

gensim/test/test_coherencemodel.py:152: AssertionError
------------------------------ Captured log call -------------------------------
WARNING  gensim.models.ldamodel:ldamodel.py:959 too few updates, training might not converge; consid
er increasing the number of passes or iterations to improve accuracy
  • Loading branch information
sanvila committed Nov 11, 2024
commit f45ca29351d36b5c4fea3a1441cf3c9b2b653ae8
2 changes: 1 addition & 1 deletion gensim/test/test_coherencemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def testProcesses(self):
topics=self.topics1, corpus=self.corpus, dictionary=self.dictionary, coherence='u_mass'
)

model, used_cpus = get_model(), mp.cpu_count() - 1
model, used_cpus = get_model(), max(1, mp.cpu_count() - 1)
self.assertEqual(model.processes, used_cpus)
for p in range(-2, 1):
self.assertEqual(get_model(processes=p).processes, used_cpus)
Expand Down