-
-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ca0bfb
commit 9af05e5
Showing
5 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[run] | ||
source=karatecluv | ||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
raise | ||
except | ||
register_parameter | ||
warn | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
language: shell | ||
|
||
os: | ||
- linux | ||
- osx | ||
- windows | ||
|
||
env: | ||
jobs: | ||
- PYTHON_VERSION=3.6 | ||
|
||
install: | ||
- source script/conda.sh | ||
- conda create --yes -n test python="${PYTHON_VERSION}" | ||
- source activate test | ||
- pip install codecov | ||
- python setup.py install | ||
|
||
script: | ||
- python setup.py test | ||
|
||
after_success: | ||
- codecov | ||
|
||
notifications: | ||
email: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then | ||
wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
chmod +x miniconda.sh | ||
./miniconda.sh -b | ||
PATH=/home/travis/miniconda3/bin:${PATH} | ||
fi | ||
|
||
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then | ||
wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh | ||
chmod +x miniconda.sh | ||
./miniconda.sh -b | ||
PATH=/Users/travis/miniconda3/bin:${PATH} | ||
fi | ||
|
||
|
||
if [ "${TRAVIS_OS_NAME}" = "windows" ]; then | ||
choco install openssl.light | ||
choco install miniconda3 | ||
PATH=/c/tools/miniconda3/Scripts:$PATH | ||
fi | ||
|
||
conda update --yes conda | ||
|
||
conda create --yes -n test python="${PYTHON_VERSION}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
[metadata] | ||
description-file = README.md | ||
|
||
[aliases] | ||
test=pytest | ||
|
||
[tool:pytest] | ||
addopts = --capture=no --cov | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import networkx as nx | ||
|
||
from karateclub import DeepWalk | ||
|
||
def test_sampler(): | ||
""" | ||
Testing the sampler base class. | ||
""" | ||
model = DeepWalk() | ||
|
||
graph = nx.watts_strogatz_graph(200, 10, 0) | ||
|
||
model.fit(graph) | ||
|
||
embedding = model.get_embedding() | ||
|
||
assert embedding.shape[1] = model.dimensions | ||
|
||
|