Skip to content

Commit

Permalink
Autoformat using black, update travis to check via autoformatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlaska committed Sep 8, 2018
1 parent 0f61388 commit f39852d
Show file tree
Hide file tree
Showing 34 changed files with 1,513 additions and 1,488 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- 2.7
- 3.6

sudo: false
Expand Down Expand Up @@ -28,5 +27,6 @@ install:

# command to run tests
script:
- flake8 inverse_covariance
- black --check inverse_covariance
- black --check examples
- python -m pytest --showlocals --pyargs
13 changes: 7 additions & 6 deletions examples/convergence_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"""

import sys
sys.path.append('..')
sys.path.append('../inverse_covariance')

sys.path.append("..")
sys.path.append("../inverse_covariance")

from sklearn.covariance import graph_lasso
from inverse_covariance import quic
Expand All @@ -21,22 +22,22 @@
#############################################################################
# Example 1
# graph_lasso fails to converge at lam = .009 * np.max(np.abs(Shat))
X = np.loadtxt('data/Mazumder_example1.txt', delimiter=',')
X = np.loadtxt("data/Mazumder_example1.txt", delimiter=",")
Shat = np.cov(X, rowvar=0)
try:
graph_lasso(Shat, alpha=.004)
except FloatingPointError as e:
print('{0}'.format(e))
print("{0}".format(e))
vals = quic(Shat, .004)


#############################################################################
# Example 2
# graph_lasso fails to converge at lam = .009 * np.max(np.abs(Shat))
X = np.loadtxt('data/Mazumder_example2.txt', delimiter=',')
X = np.loadtxt("data/Mazumder_example2.txt", delimiter=",")
Shat = np.cov(X, rowvar=0)
try:
graph_lasso(Shat, alpha=.02)
except FloatingPointError as e:
print('{0}'.format(e))
print("{0}".format(e))
vals = quic(Shat, .02)
Loading

0 comments on commit f39852d

Please sign in to comment.