Skip to content

Commit 832a57a

Browse files
MNT remove seaborn as a dependency (#21)
Co-authored-by: mathurinm <[email protected]>
1 parent 645f4d0 commit 832a57a

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
/skglm.egg-info/*
1+
*.egg-info
22
*.pyc
33

44
/doc/_build/
55
/doc/gen_modules/
66
/doc/generated/
77
/doc/auto_examples/
8+
9+
__pycache__
10+
__cache__
11+
*_cache

doc/doc-requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
benchopt
2+
libsvmdata>=0.2
3+
matplotlib>=2.0.0
24
numpydoc
35
pillow
46
sphinx-bootstrap-theme
5-
sphinx-gallery
7+
sphinx-gallery
8+
pytest

examples/plot_sparse_recovery.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Quentin Klopfenstein
1111

1212
import numpy as np
13-
import seaborn as sns
1413
from numpy.linalg import norm
1514
import matplotlib.pyplot as plt
1615
from sklearn.model_selection import train_test_split
@@ -21,7 +20,7 @@
2120
from skglm.datafits import Quadratic
2221
from skglm.penalties import L1, MCPenalty, L0_5, L2_3
2322

24-
current_palette = sns.color_palette("colorblind")
23+
cmap = plt.get_cmap('tab10')
2524

2625
# Simulate sparse data
2726
n_features = 1000
@@ -56,10 +55,10 @@
5655
penalties['l23'] = L2_3(alpha=1)
5756

5857
colors = {}
59-
colors['lasso'] = current_palette[0]
60-
colors['mcp'] = current_palette[1]
61-
colors['l05'] = current_palette[2]
62-
colors['l23'] = current_palette[3]
58+
colors['lasso'] = cmap(0)
59+
colors['mcp'] = cmap(1)
60+
colors['l05'] = cmap(2)
61+
colors['l23'] = cmap(3)
6362

6463
f1 = {}
6564
estimation_error = {}

setup.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
raise RuntimeError('Could not determine version')
1313

1414
DISTNAME = 'skglm'
15-
DESCRIPTION = 'Fast and modular scikit-learn replacement for generalized linear models'
15+
DESCRIPTION = 'A fast and modular scikit-learn replacement for generalized linear models'
16+
with open('README.rst', 'r') as f:
17+
LONG_DESCRIPTION = f.read()
1618
MAINTAINER = 'Mathurin Massias'
1719
MAINTAINER_EMAIL = '[email protected]'
1820
LICENSE = 'BSD (3-clause)'
@@ -23,13 +25,12 @@
2325
setup(name=DISTNAME,
2426
version=version,
2527
description=DESCRIPTION,
26-
long_description=open('README.rst').read(),
28+
long_description=LONG_DESCRIPTION,
2729
maintainer=MAINTAINER,
2830
maintainer_email=MAINTAINER_EMAIL,
2931
url=URL,
3032
download_url=DOWNLOAD_URL,
3133
packages=find_packages(),
32-
install_requires=['libsvmdata>=0.2', 'numpy>=1.12', 'numba',
33-
'seaborn>=0.7',
34-
'joblib', 'scipy>=0.18.0', 'matplotlib>=2.0.0',
35-
'scikit-learn>=1.0', 'pandas', 'ipython'],)
34+
install_requires=['numpy>=1.12', 'numba',
35+
'scipy>=0.18.0', 'scikit-learn>=1.0']
36+
)

skglm/utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import numpy as np
2-
import seaborn as sns
32
from numba import njit
43

54
from numpy.linalg import norm
65
from sklearn.utils import check_random_state
76

87

9-
C_LIST = sns.color_palette()
10-
11-
128
@njit
139
def ST(x, u):
1410
"""Soft-thresholding of scalar x at level u."""

0 commit comments

Comments
 (0)