Skip to content

Fix documentation for gensim.models.wrappers#1859

Merged
menshikh-iv merged 16 commits into
piskvorky:developfrom
kakshay21:akshay-wrapper-doc-string
Feb 16, 2018
Merged

Fix documentation for gensim.models.wrappers#1859
menshikh-iv merged 16 commits into
piskvorky:developfrom
kakshay21:akshay-wrapper-doc-string

Conversation

@kakshay21
Copy link
Copy Markdown
Contributor

@kakshay21 kakshay21 commented Jan 25, 2018

[WIP]

  • Add docstring.

  • Description starts with captal letter.

  • Add installation guide for all wrappers.

  • Improve example with all initialization.

@menshikh-iv menshikh-iv changed the title Add numpy style docstring Fix documentation for gensim.models.wrappers Jan 26, 2018
Copy link
Copy Markdown
Contributor

@menshikh-iv menshikh-iv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice start @kakshay21, please continue 👍

"""
Python wrapper for Dynamic Topic Models (DTM) and the Document Influence Model (DIM) [1].
"""Python wrapper for Dynamic Topic Models (DTM) and the Document Influence Model (DIM) [1].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be really great if you add short instruction "How to install 'backend' for it" for each wrapper.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!, I forgot about it.

Comment thread gensim/models/wrappers/dtmmodel.py Outdated
----------
dtm_path : str
path to the dtm executable, e.g. `C:/dtm/dtm-win64.exe`.
corpus : sparse vector
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typical corpus type is iterable of iterable of (int, int)

Comment thread gensim/models/wrappers/dtmmodel.py Outdated
Parameters
----------
dtm_path : str
path to the dtm executable, e.g. `C:/dtm/dtm-win64.exe`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All descriptions must begin with a capital letter.

Comment thread gensim/models/wrappers/dtmmodel.py Outdated

Examples
--------
>>> model = gensim.models.wrappers.DtmModel('dtm-win64.exe', my_corpus, my_timeslices,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add imports to examples (this impossible to make it really executable, but this can be very near to executable variant (i.e. all needed imports, define all variables, etc), here and everywhere.

@kakshay21
Copy link
Copy Markdown
Contributor Author

@menshikh-iv I've added reference to installation guide (link to repo) in
References
-----------
tag. Please check

@menshikh-iv
Copy link
Copy Markdown
Contributor

I fix & cleanup ldamallet & dtmmodel, main remarks:

  • missed methods (and missed arguments for existent docstrings)
  • lack of description for methods that generate path to temporary file
  • lack of links to concrete classes / methods (this needed for fast navigation in documentation), I mean something like
:class:`~gensim.models.wrappers.ldamallet.LdaMallet`
  • problem with block-formatting (for installation examples)

So, please make same cleanup for other files + add description, what's stored in file for functions like (for other + for ldamallet & dtm)

    def fcorpusmallet(self):
        """Get path to temporary file.

        Returns
        -------
        str
            Path to file.

        """

@menshikh-iv menshikh-iv merged commit 0659c10 into piskvorky:develop Feb 16, 2018
@kakshay21 kakshay21 deleted the akshay-wrapper-doc-string branch February 16, 2018 13:46
sj29-innovate pushed a commit to sj29-innovate/gensim that referenced this pull request Feb 21, 2018
* Add numpy style docstring

* First letter caps in description

* Add instalation guide and example

* Fix build failures

* fix PEP8

* fix dtmmodel

* fix dtmmodel[2]

* fix dtmmodel[3]

* fix ldamallet + typo in dtm

* Fix format of installation and docstring mistakes

* fix missing docstring in dtm & fix build (wordrank)

* fix vw[1]

* fix vw[2]

* fix varembed

* fix wordrank[1] & massive warnings about wrapper

* fix wordrank[2]
----------
dtm_path : str
Path to the dtm executable, e.g. `C:/dtm/dtm-win64.exe`.
Path to the dtm binary, e.g. `/home/username/dtm/dtm/main`.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1: the Windows example was better. Windows users are generally more clueless; Linux ppl can easily do the mental bridge between Windows .exe => Linux binary, but Windows users can't.

Or just simply use both examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants