Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up references to Morfessor, tox and gensim.models.wrappers #3345

Merged
merged 3 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Thumbs.db

# Other #
#########
.tox/
.cache/
.project
.pydevproject
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
# them here for now. They'll get picked up by the multibuild stuff
# running in multibuild/common_utils.sh.
#
- TEST_DEPENDS="pytest mock cython nmslib pyemd testfixtures Morfessor==2.0.2a4 python-levenshtein==0.12.0 visdom==0.1.8.9 scikit-learn"
- TEST_DEPENDS="pytest mock cython nmslib pyemd testfixtures python-levenshtein==0.12.0 visdom==0.1.8.9 scikit-learn"

matrix:
#
Expand Down
8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ Also, please check the [Gensim FAQ](https://github.com/RaRe-Technologies/gensim/
- For windows: `pip install -e .[test-win]`
5. Implement your changes
6. Check that everything's OK in your branch:
- Check it for PEP8: `tox -e flake8`
- Build its documentation (works only for MacOS/Linux): `tox -e docs` (documentation stored in `docs/src/_build`)
- Run unit tests: `tox -e py{version}-{os}`, for example `tox -e py35-linux` or `tox -e py36-win` where
- `{version}` is one of `35`, `36`
- `{os}` is either `win` or `linux`
- Check it for PEP8: `flake8 --ignore E12,W503 --max-line-length 120 --show-source gensim`
- Build its documentation (works only for MacOS/Linux): `make -C docs/src html` (documentation stored in `docs/src/_build`)
- Run unit tests: `pytest -v gensim/test`
7. Add files, commit and push: `git add ... ; git commit -m "my commit message"; git push origin my-feature`
8. [Create a PR](https://help.github.com/articles/creating-a-pull-request/) on Github. Write a **clear description** for your PR, including all the context and relevant information, such as:
- The issue that you fixed, e.g. `Fixes #123`
Expand Down
18 changes: 7 additions & 11 deletions gensim/models/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ def get_value(self, **kwargs):
Key word arguments to override the object's internal attributes.
One of the following parameters are expected:

* `model` - pre-trained topic model of type :class:`~gensim.models.ldamodel.LdaModel`, or one
of its wrappers, such as :class:`~gensim.models.wrappers.ldamallet.LdaMallet` or
:class:`~gensim.models.wrappers.ldavowpalwabbit.LdaVowpalWabbit`.
* `model` - pre-trained topic model of type :class:`~gensim.models.ldamodel.LdaModel`.
* `topics` - list of tokenized topics.

Returns
Expand Down Expand Up @@ -290,10 +288,8 @@ def get_value(self, **kwargs):
----------
**kwargs
Key word arguments to override the object's internal attributes.
A trained topic model is expected using the 'model' key. This can be of type
:class:`~gensim.models.ldamodel.LdaModel`, or one of its wrappers, such as
:class:`~gensim.models.wrappers.ldamallet.LdaMallet` or
:class:`~gensim.models.wrapper.ldavowpalwabbit.LdaVowpalWabbit`.
A trained topic model is expected using the 'model' key.
This must be of type :class:`~gensim.models.ldamodel.LdaModel`.

Returns
-------
Expand Down Expand Up @@ -354,8 +350,8 @@ def get_value(self, **kwargs):
----------
**kwargs
Key word arguments to override the object's internal attributes.
Two models of type :class:`~gensim.models.ldamodelLdaModel` or its wrappers are expected using the keys
`model` and `other_model`.
Two models of type :class:`~gensim.models.ldamodelLdaModel`
are expected using the keys `model` and `other_model`.

Returns
-------
Expand Down Expand Up @@ -424,8 +420,8 @@ def get_value(self, **kwargs):
----------
**kwargs
Key word arguments to override the object's internal attributes.
Two models of type :class:`~gensim.models.ldamodel.LdaModel` or its wrappers are expected using the keys
`model` and `other_model`.
Two models of type :class:`~gensim.models.ldamodel.LdaModel`
are expected using the keys `model` and `other_model`.

Returns
-------
Expand Down
3 changes: 1 addition & 2 deletions gensim/models/coherencemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ def __init__(self, model=None, topics=None, texts=None, corpus=None, dictionary=
model : :class:`~gensim.models.basemodel.BaseTopicModel`, optional
Pre-trained topic model, should be provided if topics is not provided.
Currently supports :class:`~gensim.models.ldamodel.LdaModel`,
:class:`~gensim.models.ldamulticore.LdaMulticore`, :class:`~gensim.models.wrappers.ldamallet.LdaMallet` and
:class:`~gensim.models.wrappers.ldavowpalwabbit.LdaVowpalWabbit`.
:class:`~gensim.models.ldamulticore.LdaMulticore`.
Use `topics` parameter to plug in an as yet unsupported model.
topics : list of list of str, optional
List of tokenized topics, if this is preferred over model - dictionary should be provided.
Expand Down
3 changes: 1 addition & 2 deletions gensim/models/keyedvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
and various similarity look-ups.

Since trained word vectors are independent from the way they were trained (:class:`~gensim.models.word2vec.Word2Vec`,
:class:`~gensim.models.fasttext.FastText`,
:class:`~gensim.models.wrappers.varembed.VarEmbed` etc), they can be represented by a standalone structure,
:class:`~gensim.models.fasttext.FastText` etc), they can be represented by a standalone structure,
as implemented in this module.

The structure is called "KeyedVectors" and is essentially a mapping between *keys*
Expand Down
70 changes: 0 additions & 70 deletions gensim/test/test_dtm.py

This file was deleted.

2 changes: 1 addition & 1 deletion gensim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,7 @@ def keep_vocab_item(word, count, min_count, trim_rule=None):
def check_output(stdout=subprocess.PIPE, *popenargs, **kwargs):
r"""Run OS command with the given arguments and return its output as a byte string.

Backported from Python 2.7 with a few minor modifications. Widely used for :mod:`gensim.models.wrappers`.
Backported from Python 2.7 with a few minor modifications. Used in word2vec/glove2word2vec tests.
Behaves very similar to https://docs.python.org/2/library/subprocess.html#subprocess.check_output.

Examples
Expand Down
3 changes: 2 additions & 1 deletion release/upload_docs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tox -e compile,docs
python setup.py build_ext --inplace
cd docs/src
make html
make upload