From 9464b112f2a045981149637a5bc4dcd19ea986a0 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 14:17:43 +0500 Subject: [PATCH 01/11] init config for circle --- .circleci/config.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..e8dadf309a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,31 @@ +# Python CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-python/ for more details +# +version: 2 +jobs: + build: + docker: + - image: circleci/python:2.7 + + working_directory: ~/gensim + + steps: + - checkout + + - restore_cache: + keys: + - v1-dependencies-{{ checksum "setup.py" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: build documentation + command: | + pip install tox + tox -e docs -vv + + - save_cache: + paths: + - .tox/ + key: v1-dependencies-{{ checksum "setup.py" }} From 33a502a04f21bd6f73e8df96ee6867d5695753f0 Mon Sep 17 00:00:00 2001 From: Menshikh Ivan Date: Fri, 29 Dec 2017 14:33:49 +0500 Subject: [PATCH 02/11] change --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8dadf309a..7ef9fce364 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,3 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# version: 2 jobs: build: From ae56abdfa4dfd9755ddda368ca9aace0a80cc28d Mon Sep 17 00:00:00 2001 From: Menshikh Ivan Date: Fri, 29 Dec 2017 14:40:31 +0500 Subject: [PATCH 03/11] rm cache, install tox distinctly --- .circleci/config.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ef9fce364..701e94fd7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,20 +8,14 @@ jobs: steps: - checkout - - - restore_cache: - keys: - - v1-dependencies-{{ checksum "setup.py" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + - run: basic installation + command: | + python -m venv venv + . venv/bin/activate + pip install tox - run: name: build documentation command: | pip install tox tox -e docs -vv - - - save_cache: - paths: - - .tox/ - key: v1-dependencies-{{ checksum "setup.py" }} From f326dac76ed55c604ed6058834e4b6ff2d584dcf Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 14:43:49 +0500 Subject: [PATCH 04/11] fix indentation & command --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 701e94fd7c..7822791c9b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,14 +8,14 @@ jobs: steps: - checkout - - run: basic installation - command: | - python -m venv venv - . venv/bin/activate - pip install tox + - run: + name: basic installation + command: | + python -m venv venv + . venv/bin/activate + pip install tox - run: name: build documentation command: | - pip install tox tox -e docs -vv From 1316e1ba042e2bae72cddca2f621f15b44a31439 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 14:47:11 +0500 Subject: [PATCH 05/11] update venv --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7822791c9b..2d6978ef32 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,11 +11,12 @@ jobs: - run: name: basic installation command: | - python -m venv venv - . venv/bin/activate + python -m virtualenv venv + source venv/bin/activate pip install tox - run: name: build documentation command: | + source venv/bin/activate tox -e docs -vv From ff2ff8e3b2a310bc1dbc53ea96e7d144305fd3b7 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 15:04:19 +0500 Subject: [PATCH 06/11] add pip-cache --- .circleci/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d6978ef32..3c450810aa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,10 @@ jobs: steps: - checkout + + - restore_cache: + key: pip-cache + - run: name: basic installation command: | @@ -20,3 +24,10 @@ jobs: command: | source venv/bin/activate tox -e docs -vv + + - save_cache: + key: pip-cache + paths: + - "~/.cache/pip" + - "~/.ccache" + - "~/.pip-cache" From 7b343ed2d2f563c1dbfbadc3e186a0c89838f7e3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 15:18:30 +0500 Subject: [PATCH 07/11] add apt packages for latex --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c450810aa..a924360b94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,13 @@ jobs: - restore_cache: key: pip-cache + - run: + name: install apt packages (for latex rendering) + command: | + sudo apt-get -yq update + sudo apt-get -yq remove texlive-binaries --purge + sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install dvipng texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended latexmk + - run: name: basic installation command: | From e1cfa7de75d457615d1adb96369ca2b9da6d4617 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 15:54:37 +0500 Subject: [PATCH 08/11] rename --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a924360b94..4f9e7a6423 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,21 +13,21 @@ jobs: key: pip-cache - run: - name: install apt packages (for latex rendering) + name: Apt install (for latex render) command: | sudo apt-get -yq update sudo apt-get -yq remove texlive-binaries --purge sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install dvipng texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended latexmk - run: - name: basic installation + name: Basic installation (tox) command: | python -m virtualenv venv source venv/bin/activate pip install tox - run: - name: build documentation + name: Build documentation command: | source venv/bin/activate tox -e docs -vv From 06264921d085f67263656f39a01bb36eb7cb58d1 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 16:04:14 +0500 Subject: [PATCH 09/11] enable latex rendering --- .gitignore | 3 ++- docs/src/conf.py | 2 +- gensim/topic_coherence/direct_confirmation_measure.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6939309d25..aef8db9736 100644 --- a/.gitignore +++ b/.gitignore @@ -72,4 +72,5 @@ data *_out.txt *.html *.inv -*.js \ No newline at end of file +*.js +docs/_images/ diff --git a/docs/src/conf.py b/docs/src/conf.py index 7f2c19236b..d9b2935295 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -25,7 +25,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.napoleon'] +extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.napoleon', 'sphinx.ext.imgmath'] autoclass_content = "both" # Add any paths that contain templates here, relative to this directory. diff --git a/gensim/topic_coherence/direct_confirmation_measure.py b/gensim/topic_coherence/direct_confirmation_measure.py index 0dc9dc30e8..dfda360447 100644 --- a/gensim/topic_coherence/direct_confirmation_measure.py +++ b/gensim/topic_coherence/direct_confirmation_measure.py @@ -21,7 +21,7 @@ def log_conditional_probability(segmented_topics, accumulator, with_std=False, w """ This function calculates the log-conditional-probability measure which is used by coherence measures such as U_mass. - This is defined as: m_lc(S_i) = log[(P(W', W*) + e) / P(W*)] + This is defined as :math:`m_{lc}(S_i) = log \\frac{P(W', W^{*}) + \epsilon}{P(W^{*})}`. Args: segmented_topics (list): Output from the segmentation module of the segmented From 8526ae573cc6973ed0997146cc0a2bbdf26489b5 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 16:10:17 +0500 Subject: [PATCH 10/11] remove doc building from Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f97bac263f..3cbccc0b0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ language: python matrix: include: - python: '2.7' - env: TOXENV="flake8, docs" + env: TOXENV="flake8" - python: '2.7' env: TOXENV="py27-linux" From 846685df19104d9e314c9ccc745f9fc16f3bf292 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2017 16:32:48 +0500 Subject: [PATCH 11/11] store new doc version --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f9e7a6423..d2125123c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,6 +32,10 @@ jobs: source venv/bin/activate tox -e docs -vv + - store_artifacts: + path: docs/src/_build + destination: documentation + - save_cache: key: pip-cache paths: