Skip to content

Commit

Permalink
Fix for scikit sparse dependency issue (#7)
Browse files Browse the repository at this point in the history
* Remove scikit-sparse from requirements in setup.py
* Add requirements.in, specifying direct dependencies
* Add requirements.txt, compiled from requirements.in
* The base python version was also switched to 3.6, as it has been
tested more than 3.8.
* Add note in README on optional scikit-sparse dep.
  • Loading branch information
af-a authored Mar 21, 2022
1 parent 9a2dc17 commit c3fbd45
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ your choice:

`pip3 install --user --src /my/preferred/location --editable git+https://github.com/Deep-MI/Lapy.git#egg=lapy`

Several functions, e.g. the Solver, require a sparse matrix decomposition, for which either the LU decomposition (from scipy sparse) or the faster Cholesky decomposition (from scikit-sparse cholmod) can be used. If the parameter flag use_cholmod is True, the code will try to import cholmod from the scikit-sparse package and will fall back to LU if the import fails. If you would like to use cholmod, you need to install scikit-sparse separately. It cannot be listed among LaPy's dependencies (e.g. in setup.py or requirements.txt) as that causes errors with pip. scikit-sparse requires numpy and scipy to be installed separately beforehand.

## References:

If you use this software for a publication please cite both these papers:
Expand Down
3 changes: 3 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy==1.17.4
scipy==1.3.1
plotly==5.5.0
19 changes: 7 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#
# This file is autogenerated by pip-compile with python 3.8
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# pip-compile
#
numpy==1.21.4
numpy==1.17.4
# via
# LaPy (setup.py)
# scikit-sparse
# -r requirements.in
# scipy
plotly==5.3.1
# via LaPy (setup.py)
scikit-sparse==0.4.6
# via LaPy (setup.py)
scipy==1.7.2
# via
# LaPy (setup.py)
# scikit-sparse
plotly==5.5.0
# via -r requirements.in
scipy==1.3.1
# via -r requirements.in
six==1.16.0
# via plotly
tenacity==8.0.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ def get_version(rel_path):
# For an analysis of "install_requires" vs pip's requirements files see:
# https://packaging.python.org/en/latest/requirements.html
# install_requires=['peppercorn'], # Optional
install_requires=['numpy', 'scipy', 'plotly', 'scikit-sparse'],
install_requires=['numpy', 'scipy', 'plotly'],
)

0 comments on commit c3fbd45

Please sign in to comment.