Skip to content

Commit

Permalink
fix various documentation warnings (#3077)
Browse files Browse the repository at this point in the history
* fix various documentation warnings

I encountered the following while building under Sphinx 3.5.2 on MacOS:

docstring of gensim.corpora._mmreader.MmReader.num_docs:1:duplicate object description of gensim.corpora._mmreader.MmReader.num_docs, other instance in corpora/_mmreader, use :noindex: for one of them

gensim/gensim/utils.py:docstring of gensim.utils.chunkize:9:Inline interpreted text or phrase reference start-string without end-string.

gensim/docs/src/_matutils.rst:document isn't included in any toctree

* update pins

* update sphinx pin in setup.py

* explicitly install sbt

* fixup, use sudo
  • Loading branch information
mpenkov authored Mar 16, 2021
1 parent 338ef33 commit 2589c5a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 43 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ jobs:
python-version: ${{ matrix.python }}
- name: Update pip
run: python -m pip install -U pip

#
# Work-around mysterious build problem
# https://github.com/RaRe-Technologies/gensim/pull/3078/checks?check_run_id=2117914443
# https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html
#
- name: Update sbt
run: |
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt-get update -y
sudo apt-get install -y sbt
- name: Install tox, gdb
run: |
pip install tox
Expand Down
9 changes: 0 additions & 9 deletions docs/src/_matutils.rst

This file was deleted.

2 changes: 0 additions & 2 deletions docs/src/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Modules:
interfaces
utils
matutils
_matutils
downloader
corpora/bleicorpus
corpora/csvcorpus
Expand All @@ -21,7 +20,6 @@ Modules:
corpora/lowcorpus
corpora/malletcorpus
corpora/mmcorpus
corpora/_mmreader
corpora/sharded_corpus
corpora/svmlightcorpus
corpora/textcorpus
Expand Down
9 changes: 0 additions & 9 deletions docs/src/corpora/_mmreader.rst

This file was deleted.

11 changes: 0 additions & 11 deletions gensim/corpora/mmcorpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ class MmCorpus(matutils.MmReader, IndexedCorpus):
Wrap a term-document matrix on disk (in matrix-market format), and present it
as an object which supports iteration over the matrix rows (~documents).
Notable instance attributes:
Attributes
----------
num_docs : int
Number of documents in the market matrix file.
num_terms : int
Number of features (terms, topics).
num_nnz : int
Number of non-zero elements in the sparse MM matrix.
Notes
-----
The file is read into memory one document at a time, not the whole matrix at once,
Expand Down
2 changes: 1 addition & 1 deletion gensim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ def chunkize(corpus, chunksize, maxsize=0, as_numpy=False):
maxsize : int, optional
Ignored. For interface compatibility only.
as_numpy : bool, optional
Yield chunks as `np.ndarray`s instead of lists?
Yield chunks as `np.ndarray` s instead of lists?
Yields
------
Expand Down
19 changes: 9 additions & 10 deletions requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
Sphinx==2.2.0
sphinx-gallery==0.4.0
sphinxcontrib-napoleon==0.7
sphinxcontrib-programoutput==0.15
memory-profiler==0.55.0
Pyro4==4.77
Sphinx==3.5.2
annoy==1.16.2
scikit-learn==0.21.3
plotly==4.2.1
memory-profiler==0.55.0
nltk==3.4.5
testfixtures==6.10.0
statsmodels==0.10.1
pandas==1.2.3
pyemd==0.5.1
pandas==0.25.2
scikit-learn==0.24.1
sphinx-gallery==0.8.2
sphinxcontrib-napoleon==0.7
sphinxcontrib-programoutput==0.15
statsmodels==0.12.2
testfixtures==6.17.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def run(self):
#

docs_testenv = core_testenv + distributed_env + visdom_req + [
'sphinx <= 2.4.4', # avoid `sphinx >= 3.0` that breaks the build
'sphinx',
'sphinx-gallery',
'sphinxcontrib.programoutput',
'sphinxcontrib-napoleon',
Expand Down

0 comments on commit 2589c5a

Please sign in to comment.