Skip to content

Commit

Permalink
Make pylint version compatible and remove morph-tool unnecessary depe…
Browse files Browse the repository at this point in the history
…ndency

Change-Id: Icb33469addd895a63f36995e5e70c21b9920bdd0
  • Loading branch information
lidakanari committed Aug 3, 2020
1 parent cd3da5d commit e1e3650
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
author_email='lida.kanari@epfl.ch',
install_requires=[
'matplotlib>=1.3.1',
'morph-tool>=0.1.12',
'tmd>=2.0.8',
'morphio>=2.3.10',
'neurom>=1.4.15',
'enum-compat>=0.0.1',
'scipy>=0.13.3',
Expand Down
2 changes: 1 addition & 1 deletion tns/extract_input/from_TMD.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def persistent_homology_angles(pop, threshold=2, neurite_type='basals', feature=

# Keep only the trees whose number of terminations is above the threshold
# Saves the list of persistence diagrams for the selected neurite_type
phs = list(np.array(ph_ang)[np.where(np.array([len(p) for p in ph_ang]) > threshold)[0]])
phs = list(np.array(ph_ang, dtype=object)[np.where(np.array([len(p) for p in ph_ang]) > threshold)[0]])

return {"persistence_diagram": phs}
2 changes: 1 addition & 1 deletion tns/extract_input/from_diameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def model(input_object):
key = NEUROM_TYPE_TO_STR[neurite_type]

values[key] = {"taper": taper_c,
"term": [c for c in chain(*term_diam)],
"term": list(chain(*term_diam)),
"trunk": trunk_diam,
"trunk_taper": trunk_taper}

Expand Down
2 changes: 1 addition & 1 deletion tns/generate/algorithms/abstractgrower.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import copy


class AbstractAlgo(object):
class AbstractAlgo():
"""TreeGrower abstract class"""
# meta class is used to define other classes
__metaclass__ = abc.ABCMeta
Expand Down
2 changes: 1 addition & 1 deletion tns/generate/algorithms/barcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from tns.utils import TNSError


class Barcode(object):
class Barcode():
"""Class to generate the barcode structure
which is essential for the TMD based growth
algorithms.
Expand Down
2 changes: 1 addition & 1 deletion tns/generate/algorithms/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def section_data(direction, first_point, stop_criteria, process_type):
'process': process_type}


class TMDStop(object):
class TMDStop():
'''Class to define the data for stop criteria
based on the TMD method.
'''
Expand Down
2 changes: 1 addition & 1 deletion tns/generate/algorithms/tmdgrower.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def initialize(self):
Initializes the tree grower and
computes the apical distance using the input barcode.
"""
from tmd.Topology.analysis import find_apical_point_distance_smoothed as ap_dist
from tmd.Topology.analysis import find_apical_point_distance_smoothed as ap_dist # pylint: disable=C0415
stop, num_sec = super(TMDApicalAlgo, self).initialize()
if self.params['has_apical_tuft']:
self.apical_point_distance_from_soma = ap_dist(self.ph_angles)
Expand Down
4 changes: 2 additions & 2 deletions tns/generate/grower.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
bifurcation_methods = ['symmetric', 'bio_oriented', 'directional', 'bio_smoothed']


class NeuronGrower(object):
class NeuronGrower():
"""
A Grower object is a container for a Neuron, encoded in the (groups, points) structure,
as a morphIO Morphology object. A set of input distributions that store the data
Expand Down Expand Up @@ -107,7 +107,7 @@ def grow(self):
"""
self._grow_soma()
while self.active_neurites:
self.next()
self.next() # pylint: disable=E1102
self._post_grow()
self._diametrize()
return self.neuron
Expand Down
2 changes: 1 addition & 1 deletion tns/generate/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
WEIGHTS = np.exp(np.arange(1, MEMORY + 1) - MEMORY)


class SectionGrower(object):
class SectionGrower():
'''Class for the section growth
'''
# pylint: disable-msg=too-many-arguments
Expand Down
2 changes: 1 addition & 1 deletion tns/generate/soma.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
L = logging.getLogger()


class SomaGrower(object):
class SomaGrower():
"""Soma class"""

def __init__(self, initial_point, radius=1.0, context=None):
Expand Down
2 changes: 1 addition & 1 deletion tns/generate/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _create_section_parameters(input_dict):
raise TNSError(msg)


class TreeGrower(object):
class TreeGrower():
"""Tree class"""

def __init__(self,
Expand Down
2 changes: 1 addition & 1 deletion tns/morphmath/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from scipy import stats


class Distr(object):
class Distr():
'''Class of custom distributions
'''

Expand Down
2 changes: 1 addition & 1 deletion tns/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
""" tns version """
VERSION = "2.2.1"
VERSION = "2.2.2.dev0"
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ indexserver =

[testenv]
basepython= python3.6
deps = {[base]testdeps}
deps =
{[base]testdeps}
morph-tool>=0.1.12
commands = nosetests tests tests/astrocyte

[testenv:check-version]
Expand All @@ -30,14 +32,15 @@ commands = do_release.py -p . check-version
[testenv:lint]
deps =
pycodestyle==2.4.0
pylint==1.9.3
pylint==2.5.3
commands =
pycodestyle {[base]name} --exclude tests
pylint {[base]name} --ignore tests

[testenv:coverage]
deps =
{[base]testdeps}
morph-tool>=0.1.12
coverage
commands =
coverage run --source {[base]name} {envbindir}/nosetests
Expand Down

0 comments on commit e1e3650

Please sign in to comment.