Skip to content

Commit

Permalink
fixing project testing
Browse files Browse the repository at this point in the history
- TypeError: assert_frame_equal() got an unexpected keyword argument 'check_less_precise'
- upgrade requirements.txt for numpy/pandas
- upgrading minimum python version: py3.9+
- other misc changes
  • Loading branch information
msusol committed Apr 23, 2023
1 parent 67d13f4 commit 13d9414
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
language: python

python:
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7"

env:
- DEPS="pytest gensim smart_open==2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.8, 3.9, 3.10, 3.11, and for PyPI. Check
3. The pull request should work for Python 3.9, 3.10, 3.11, and for PyPI. Check
https://travis-ci.org/bmabey/pyLDAvis/pull_requests
and make sure that the tests pass for all supported Python versions.

Expand Down
8 changes: 4 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name = "pypi"

[packages]
pyLDAvis = {editable = true, path = "."}
numpy = ">=1.22.0"
numpy = ">=1.24.2"
scipy = "*"
pandas = ">=1.3.4"
pandas = ">=2.0.0"
joblib = ">=1.2.0"
numexpr = "*"
funcy = "*"
Expand All @@ -17,7 +17,7 @@ Jinja2 = "*"
reproducer = {editable = true, path = "."}

[dev-packages]
pytest = ">=3.8"
pytest = ">=3.9"

[requires]
python_version = "3.10"
python_version = "3.11"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
numpy>=1.22.0
numpy>=1.24.2
scipy
pandas>=1.3.4
pandas>=2.0.0
joblib>=1.2.0
jinja2
numexpr
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
name='pyLDAvis',
version='3.4.1',
description='Interactive topic model visualization. Port of the R package.',
long_description_content_type="text/x-rst",
long_description=readme,
author='Ben Mabey',
author_email='[email protected]',
url='https://github.com/bmabey/pyLDAvis',
download_url='https://github.com/bmabey/pyLDAvis/tarball/3.4.0',
download_url='https://github.com/bmabey/pyLDAvis/tarball/3.4.1',
packages=['pyLDAvis'],
package_dir={'pyLDAvis': 'pyLDAvis'},
tests_require=['pytest'],
python_requires=">=3.8",
python_requires=">=3.9",
include_package_data=True,
install_requires=requirements,
license='BSD-3-Clause',
Expand All @@ -41,7 +42,6 @@
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
Expand Down
4 changes: 2 additions & 2 deletions tests/pyLDAvis/test_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def both(f):

join_percent = float(len(joined)) / len(etinfo)
print('Topic Info join was %.0f%%' % (100 * join_percent))
assert_frame_equal(ejoined, ojoined, check_less_precise=True)
assert_frame_equal(ejoined, ojoined, check_exact=False, rtol=0.1)
assert join_percent > 0.95

def abs_basis(df):
Expand All @@ -71,7 +71,7 @@ def abs_basis(df):

emds, omds = both(lambda r: abs_basis(pd.DataFrame(r['mdsDat'])))
assert_frame_equal(emds.reindex(sorted(oddf.columns), axis=1),
omds.reindex(sorted(oddf.columns), axis=1), check_less_precise=True)
omds.reindex(sorted(oddf.columns), axis=1), check_exact=False, rtol=0.1)

def rounded_token_table(r):
tt = pd.DataFrame(r['token.table'])
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38, py39, py310, py311
envlist = py39, py310, py311

[testenv]
install_command = pip3 install {opts} {packages}
Expand Down

0 comments on commit 13d9414

Please sign in to comment.