Skip to content

Commit

Permalink
fixed for GDMR without metadata_range
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Jun 6, 2020
1 parent c05cdf0 commit c063c74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python/py_GDMR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ static int GDMR_init(TopicModelObject *self, PyObject *args, PyObject *kwargs)
self->minWordDf = minDf;
self->removeTopWord = rmTop;

if (objRange)
if (objRange && objRange != Py_None)
{
vector<float> vMin, vMax;
py::UniqueObj rangeIter = PyObject_GetIter(objRange), item;
if(!rangeIter) throw runtime_error{ "`metadata_range` must be a list of pairs." };
while (item = PyIter_Next(rangeIter))
{
item = PyObject_GetIter(item);
Expand Down

0 comments on commit c063c74

Please sign in to comment.