diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..d2125123c3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,44 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/python:2.7 + + working_directory: ~/gensim + + steps: + - checkout + + - restore_cache: + key: pip-cache + + - run: + 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 (tox) + command: | + python -m virtualenv venv + source venv/bin/activate + pip install tox + + - run: + name: Build documentation + command: | + source venv/bin/activate + tox -e docs -vv + + - store_artifacts: + path: docs/src/_build + destination: documentation + + - save_cache: + key: pip-cache + paths: + - "~/.cache/pip" + - "~/.ccache" + - "~/.pip-cache" 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/.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" 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