diff --git a/setup.py b/setup.py index 8158bb6b..451b799e 100644 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/tns/extract_input/from_TMD.py b/tns/extract_input/from_TMD.py index 2688b511..25dca72f 100644 --- a/tns/extract_input/from_TMD.py +++ b/tns/extract_input/from_TMD.py @@ -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} diff --git a/tns/extract_input/from_diameter.py b/tns/extract_input/from_diameter.py index 0ef7e646..18d33d90 100644 --- a/tns/extract_input/from_diameter.py +++ b/tns/extract_input/from_diameter.py @@ -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} diff --git a/tns/generate/algorithms/abstractgrower.py b/tns/generate/algorithms/abstractgrower.py index 642af166..c5977ae6 100644 --- a/tns/generate/algorithms/abstractgrower.py +++ b/tns/generate/algorithms/abstractgrower.py @@ -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 diff --git a/tns/generate/algorithms/barcode.py b/tns/generate/algorithms/barcode.py index e462cb7f..e74bed3f 100644 --- a/tns/generate/algorithms/barcode.py +++ b/tns/generate/algorithms/barcode.py @@ -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. diff --git a/tns/generate/algorithms/common.py b/tns/generate/algorithms/common.py index 773a0519..47beb003 100644 --- a/tns/generate/algorithms/common.py +++ b/tns/generate/algorithms/common.py @@ -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. ''' diff --git a/tns/generate/algorithms/tmdgrower.py b/tns/generate/algorithms/tmdgrower.py index dadf6517..ea6de892 100644 --- a/tns/generate/algorithms/tmdgrower.py +++ b/tns/generate/algorithms/tmdgrower.py @@ -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) diff --git a/tns/generate/grower.py b/tns/generate/grower.py index 2b699f7a..8418b873 100644 --- a/tns/generate/grower.py +++ b/tns/generate/grower.py @@ -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 @@ -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 diff --git a/tns/generate/section.py b/tns/generate/section.py index 4d67dcaf..978023a6 100644 --- a/tns/generate/section.py +++ b/tns/generate/section.py @@ -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 diff --git a/tns/generate/soma.py b/tns/generate/soma.py index 2e03f097..1d3e3be5 100644 --- a/tns/generate/soma.py +++ b/tns/generate/soma.py @@ -14,7 +14,7 @@ L = logging.getLogger() -class SomaGrower(object): +class SomaGrower(): """Soma class""" def __init__(self, initial_point, radius=1.0, context=None): diff --git a/tns/generate/tree.py b/tns/generate/tree.py index 0d20ca36..cbedeb32 100644 --- a/tns/generate/tree.py +++ b/tns/generate/tree.py @@ -66,7 +66,7 @@ def _create_section_parameters(input_dict): raise TNSError(msg) -class TreeGrower(object): +class TreeGrower(): """Tree class""" def __init__(self, diff --git a/tns/morphmath/sample.py b/tns/morphmath/sample.py index fea33d44..f38dec39 100644 --- a/tns/morphmath/sample.py +++ b/tns/morphmath/sample.py @@ -5,7 +5,7 @@ from scipy import stats -class Distr(object): +class Distr(): '''Class of custom distributions ''' diff --git a/tns/version.py b/tns/version.py index fd05e24e..ee3749f4 100644 --- a/tns/version.py +++ b/tns/version.py @@ -1,2 +1,2 @@ """ tns version """ -VERSION = "2.2.1" +VERSION = "2.2.2.dev0" diff --git a/tox.ini b/tox.ini index 03916c84..ea81128b 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -30,7 +32,7 @@ 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 @@ -38,6 +40,7 @@ commands = [testenv:coverage] deps = {[base]testdeps} + morph-tool>=0.1.12 coverage commands = coverage run --source {[base]name} {envbindir}/nosetests