Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into fix_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
piskvorky committed Mar 18, 2022
2 parents 490676c + 86b1832 commit 65b7fb2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ jobs:
fail-fast: false
matrix:
include:
- {name: Linux, python: 3.6, os: ubuntu-20.04, tox: 'flake8,flake8-docs'}
- {name: Linux, python: 3.6, os: ubuntu-20.04, tox: 'py36-linux'}
- {name: Linux, python: 3.7, os: ubuntu-20.04, tox: 'flake8,flake8-docs'}
- {name: Linux, python: 3.7, os: ubuntu-20.04, tox: 'py37-linux'}
- {name: Linux, python: 3.8, os: ubuntu-20.04, tox: 'py38-linux'}
- {name: Windows, python: 3.6, os: windows-2019, tox: 'py36-win'}
- {name: Linux, python: 3.8, os: ubuntu-20.04, tox: 'py38-linux-cov'}
- {name: Windows, python: 3.7, os: windows-2019, tox: 'py37-win'}
- {name: Windows, python: 3.8, os: windows-2019, tox: 'py38-win'}
env:
Expand Down Expand Up @@ -72,4 +70,4 @@ jobs:
run: |
pwd
COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1)
if [[ -f "$COREFILE" ]]; then EXECFILE=$(gdb -c "$COREFILE" -batch | grep "Core was generated" | tr -d "\`" | cut -d' ' -f5); file "$COREFILE"; gdb -c "$COREFILE" "$EXECFILE" -x continuous_integration/debug.gdb -batch; fi
if [[ -f "$COREFILE" ]]; then EXECFILE=$(gdb -c "$COREFILE" -batch | grep "Core was generated" | tr -d "\`" | cut -d' ' -f5); file "$COREFILE"; gdb -c "$COREFILE" "$EXECFILE" -x continuous_integration/debug.gdb -batch; fi
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changes
* [#3250](https://github.com/RaRe-Technologies/gensim/pull/3250): Make negative ns_exponent work correctly, by [@menshikh-iv](https://github.com/menshikh-iv)
* [#3258](https://github.com/RaRe-Technologies/gensim/pull/3258): Adding another check to _check_corpus_sanity for compressed files, adding test, by [@dchaplinsky](https://github.com/dchaplinsky)
* [#3274](https://github.com/RaRe-Technologies/gensim/pull/3274): Migrate setup.py from distutils to setuptools, by [@geojacobm6](https://github.com/geojacobm6)
* [#3286](https://github.com/RaRe-Technologies/gensim/pull/3286): Fixes 'not enough arguments for format string' error, by [@gilbertfrancois](https://github.com/gilbertfrancois)

## 4.1.2, 2021-09-17

Expand Down
4 changes: 3 additions & 1 deletion gensim/models/doc2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,9 @@ def _scan_vocab(self, corpus_iterable, progress_per, trim_rule):
logger.warning(
"Highest int doctag (%i) larger than count of documents (%i). This means "
"at least %i excess, unused slots (%i bytes) will be allocated for vectors.",
max_rawint, corpus_count, ((max_rawint - corpus_count) * self.vector_size * 4))
max_rawint, corpus_count, max_rawint - corpus_count,
(max_rawint - corpus_count) * self.vector_size * dtype(REAL).itemsize,
)
if max_rawint > -1:
# adjust indexes/list to account for range of pure-int keyed doctags
for key in doctags_list:
Expand Down
8 changes: 5 additions & 3 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import logging
import unittest
import os
import shutil
import subprocess
import struct
import sys
Expand Down Expand Up @@ -44,7 +45,8 @@
BUCKET = 10000

FT_HOME = os.environ.get("FT_HOME")
FT_CMD = os.path.join(FT_HOME, "fasttext") if FT_HOME else None
FT_CMD = shutil.which("fasttext", path=FT_HOME) or \
shutil.which("fasttext")


new_sentences = [
Expand Down Expand Up @@ -1661,7 +1663,7 @@ def _save_test_model(out_base_fname, model_params):
subprocess.check_call(cmd)


@unittest.skipIf(not FT_HOME, "FT_HOME env variable not set, skipping test")
@unittest.skipIf(not FT_CMD, "fasttext not in FT_HOME or PATH, skipping test")
class SaveFacebookByteIdentityTest(unittest.TestCase):
"""
This class containts tests that check the following scenario:
Expand Down Expand Up @@ -1708,7 +1710,7 @@ def line_to_array(line):
return np.array([line_to_array(line) for line in out.splitlines()], dtype=np.float32)


@unittest.skipIf(not os.environ.get("FT_HOME", None), "FT_HOME env variable not set, skipping test")
@unittest.skipIf(not FT_CMD, "fasttext not in FT_HOME or PATH, skipping test")
class SaveFacebookFormatReadingTest(unittest.TestCase):
"""
This class containts tests that check the following scenario:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def run(self):
core_testenv = [
'pytest',
'pytest-cov',
# 'pytest-rerunfailures', # disabled 2020-08-28 for <https://github.com/pytest-dev/pytest-rerunfailures/issues/128>
'mock',
'cython',
'testfixtures',
Expand Down
11 changes: 7 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 2.0
envlist = {py36,py37,py38, py39}-{win,linux}, flake8, docs, docs-upload, download-wheels, upload-wheels, test-pypi
envlist = {py36,py37,py38, py39}-{win,linux}, py38-linux-cov, flake8, docs, docs-upload, download-wheels, upload-wheels, test-pypi
skipsdist = True
platform = linux: linux
win: win64
Expand Down Expand Up @@ -42,9 +42,11 @@ exclude_lines =

ignore_errors = True

#
# Conditional factors https://tox.wiki/en/latest/config.html#factors
#
[pytest]
addopts = -rfxEXs --durations=20 --showlocals --cov=gensim/ --cov-report=xml

addopts = -rfxEXs --durations=20 --showlocals

[testenv]
recreate = True
Expand Down Expand Up @@ -72,7 +74,8 @@ commands =
python --version
pip --version
python setup.py build_ext --inplace
pytest {posargs:gensim/test}
cov: pytest {posargs:gensim/test} --cov=gensim/ --cov-report=xml
!cov: pytest {posargs:gensim/test}


[testenv:flake8]
Expand Down

0 comments on commit 65b7fb2

Please sign in to comment.