Skip to content

Commit

Permalink
Updated tox.ini
Browse files Browse the repository at this point in the history
 * minor pycodestyle fixes
 * temporarily disabled pylint run

Change-Id: Icb77f4e4c8bf77c22cb806cf46059638e8387437
  • Loading branch information
arsenius7 committed Feb 1, 2019
1 parent 93290b3 commit 82b282b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 39 deletions.
6 changes: 6 additions & 0 deletions .gitreview
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gerrit]
host=bbpcode.epfl.ch
port=22
project=molecularsystems/TNS
defaultbranch=master
defaultremote=origin
3 changes: 0 additions & 3 deletions pep8rc

This file was deleted.

11 changes: 6 additions & 5 deletions tns/generate/diametrizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def merger(sect, model_all, status, rall_ratio):
def taper_section_diam(section, initial_diam, taper, min_diam=0.07):
'''Corrects the diameters of a section'''
taps = taper / len(section.diameters)
section.diameters = np.array([initial_diam * ( 1 - i * taps)
if initial_diam * ( 1 - i * taps) > min_diam
section.diameters = np.array([initial_diam * (1 - i * taps)
if initial_diam * (1 - i * taps) > min_diam
else min_diam for i in range(len(section.diameters))],
dtype=np.float32)

Expand All @@ -50,11 +50,12 @@ def smooth_section_diam(section, min_diam=0.07):
'''Corrects the diameters of a section by smoothing between initial and final diameters'''
initial_diam = section.diameters[0]
taps = (np.max(section.diameters) - np.min(section.diameters)) / len(section.diameters)
section.diameters = np.array([initial_diam * ( 1 - i * taps)
if initial_diam * ( 1 - i * taps) > min_diam
section.diameters = np.array([initial_diam * (1 - i * taps)
if initial_diam * (1 - i * taps) > min_diam
else min_diam for i in range(len(section.diameters))],
dtype=np.float32)


def diametrize_from_root(neuron, model_all):
'''Corrects the diameters of a morphio-neuron according to the model.
Starts from the root and moves towards the tips.
Expand All @@ -77,7 +78,7 @@ def diametrize_from_root(neuron, model_all):
new_diam = d1 * siblings_ratio
else:
new_diam = d1
except:
except: # noqa
# This applies only to first tree section
new_diam = sample(model['trunk'])

Expand Down
2 changes: 1 addition & 1 deletion tns/morphmath/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Distr(object):
def __init__(self, params):
"""Object of statistical distribution
"""
self.type = params.keys()[0]
self.type = next(iter(params.keys()))
self.params = params[self.type]

@staticmethod
Expand Down
52 changes: 22 additions & 30 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,47 @@ testdeps =
[tox]
envlist =
check-version
pycodestyle
coverage
pylint
py27
py35
lint
py{27,36}

indexserver =
PYPI = https://pypi.org/simple
default = https://bbpteam.epfl.ch/repository/devpi/simple

[testenv]
deps = {[base]testdeps}
commands = nosetests tests

[testenv:check-version]
skip_install = true
# commands = /gpfs/bbp.cscs.ch/apps/viz/platform/binfiles/bbp-nse-ci/0.0.1/bin/do_release.py -p . check-version


[testenv:pycodestyle]
deps = pycodestyle==2.4.0
commands = pycodestyle {[base]name} --exclude tests
deps = bbp-nse-ci
commands = do_release.py -p . check-version

[testenv:pylint]
[testenv:lint]
deps =
pylint==1.9.3
:PYPI:tmd==2.0.3 # To be removed once tmd cascades to BBP devpi
commands = pylint {[base]name}

[testenv:py27]
deps = {[base]testdeps}
commands = nosetests

[testenv:py35]
deps = {[base]testdeps}
commands = nosetests
pycodestyle==2.4.0
pylint==1.9.3
commands =
pycodestyle {[base]name}
# TODO: pylint {[base]name}

[testenv:coverage]
deps =
{[base]testdeps}
coverage
commands =
true | coverage run --source {[base]name} {envbindir}/nosetests
true | coverage report --show-missing
true | coverage xml
coverage run --source {[base]name} {envbindir}/nosetests
coverage report --show-missing
coverage xml

[testenv:docs]
changedir = doc
deps = sphinx
commands = true | make html
commands = make html
whitelist_externals = make

# E127: continuation line over-indented for visual indent
# E128: continuation line under-indented for visual indent
# E731: do not assign a lambda expression, use a def
[pycodestyle]
ignore = E731
max-line-length = 100
ignore = E127,E128,E731
max-line-length = 120

0 comments on commit 82b282b

Please sign in to comment.