Skip to content

Commit

Permalink
Enabling flake and mypy checks on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaljovec committed Nov 22, 2019
1 parent fbb0c3c commit 70410e6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 12 deletions.
25 changes: 24 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
[metadata]
description-file = README.md
description-file = README.md

[flake8]
max-line-length = 120
exclude = topology.py
max-complexity = 15

[mypy-topopy.topology]
ignore_errors = True

[mypy-networkx.*]
ignore_missing_imports = True

[mypy-nglpy.*]
ignore_missing_imports = True

[mypy-numpy.*]
ignore_missing_imports = True

[mypy-scipy.*]
ignore_missing_imports = True

[mypy-sklearn.*]
ignore_missing_imports = True
4 changes: 2 additions & 2 deletions topopy/ContourTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import networkx as nx

from . import MergeTree
from . import TopologicalObject
from .MergeTree import MergeTree
from .TopologicalObject import TopologicalObject


class ContourTree(TopologicalObject):
Expand Down
4 changes: 2 additions & 2 deletions topopy/MergeTree.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
import time

from .topology import MergeTreeFloat, vectorFloat, vectorString
from .topology import MergeTreeFloat, vectorFloat

from . import TopologicalObject
from .TopologicalObject import TopologicalObject


class MergeTree(TopologicalObject):
Expand Down
3 changes: 1 addition & 2 deletions topopy/MorseComplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np

from .topology import MorseComplexFloat, vectorFloat, mapIntSetInt
from . import TopologicalObject
from .TopologicalObject import TopologicalObject


class MorseComplex(TopologicalObject):
Expand Down Expand Up @@ -375,7 +375,6 @@ def get_label(self, indices=None):
partitions = self.get_partitions(self.persistence)
labels = self.X.shape[0] * [None]
for label, partition_indices in partitions.items():
partIndices = partitions[label]
for idx in np.intersect1d(partition_indices, indices):
labels[idx] = label

Expand Down
4 changes: 2 additions & 2 deletions topopy/MorseSmaleComplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import numpy as np

from . import TopologicalObject
from . import MorseComplex
from .TopologicalObject import TopologicalObject
from .MorseComplex import MorseComplex


class MorseSmaleComplex(TopologicalObject):
Expand Down
3 changes: 2 additions & 1 deletion topopy/tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,12 @@ def gerber2(_x):
+ (1. / 1.) * np.exp(-((y - .75) ** 2) / 0.01)
)


def gerber_different_heights(_x):
x, y = unpack2D(_x)
return (
(1. / 1.) * np.exp(-((x - .25) ** 2) / 0.09)
+ (1. / 4.) * np.exp(-((y - .25) ** 2) / 0.09)
+ (1. / 3.) * np.exp(-((x - .75) ** 2) / 0.01)
+ (1. / 2.) * np.exp(-((y - .75) ** 2) / 0.01)
)
)
4 changes: 2 additions & 2 deletions travis.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set -e
set -x

# mypy topopy
# flake8
mypy topopy
flake8
coverage run --source topopy setup.py test
deploy/test.sh

Expand Down

0 comments on commit 70410e6

Please sign in to comment.