Skip to content

Commit

Permalink
Remove deprecations (#1026)
Browse files Browse the repository at this point in the history
Remove deprecated modules and deprecation warning. viewer module was not included to be treated separately
  • Loading branch information
eleftherioszisis authored Apr 27, 2022
1 parent 9a12f38 commit 82ceb48
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 64 deletions.
1 change: 0 additions & 1 deletion neurom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

from neurom.features import get
from neurom.io.utils import MorphLoader, load_morphology, load_morphologies
from neurom.io.utils import load_neuron, load_neurons
from neurom.exceptions import NeuroMDeprecationWarning

APICAL_DENDRITE = NeuriteType.apical_dendrite
Expand Down
8 changes: 0 additions & 8 deletions neurom/check/neuron_checks.py

This file was deleted.

11 changes: 5 additions & 6 deletions neurom/check/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@

from neurom import load_morphology
from neurom.check import check_wrapper
from neurom.exceptions import ConfigError
from neurom.exceptions import ConfigError, NeuroMError
from neurom.io import utils
from neurom.utils import warn_deprecated

L = logging.getLogger(__name__)

Expand Down Expand Up @@ -147,10 +146,10 @@ def _sanitize_config(config):
checks = config['checks']
if 'morphology_checks' not in checks:
checks['morphology_checks'] = []
if 'neuron_checks' in checks:
warn_deprecated('"neuron_checks" is deprecated, use "morphology_checks" instead '
'for the config of `neurom.check`') # pragma: no cover
checks['morphology_checks'] = config['neuron_checks'] # pragma: no cover
if 'neuron_checks' in checks: # pragma: no cover
raise NeuroMError(
"'neuron_checks' is not supported. Please rename it into 'morphology_checks'"
)
else:
raise ConfigError('Need to have "checks" in the config')

Expand Down
2 changes: 1 addition & 1 deletion neurom/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

# those imports here for backward compatibility
from neurom.core.soma import Soma
from neurom.core.morphology import Section, Neurite, Morphology, Neuron
from neurom.core.morphology import Section, Neurite, Morphology
from neurom.core.population import Population
18 changes: 1 addition & 17 deletions neurom/core/morphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from neurom.core.dataformat import COLS
from neurom.core.types import NeuriteIter, NeuriteType
from neurom.core.population import Population
from neurom.utils import flatten, warn_deprecated
from neurom.utils import flatten


class Section:
Expand Down Expand Up @@ -420,13 +420,6 @@ def graft_morphology(section):
return Morphology(m)


def graft_neuron(section):
"""Deprecated in favor of ``graft_morphology``."""
warn_deprecated('`neurom.core.neuron.graft_neuron` is deprecated in favor of '
'`neurom.core.morphology.graft_morphology`') # pragma: no cover
return graft_morphology(section) # pragma: no cover


class Neurite:
"""Class representing a neurite tree."""

Expand Down Expand Up @@ -588,12 +581,3 @@ def __repr__(self):
"""Return a string representation."""
return 'Morphology <soma: %s, n_neurites: %d>' % \
(self.soma, len(self.neurites))


class Neuron(Morphology):
"""Deprecated ``Neuron`` class. Use ``Morphology`` instead."""
def __init__(self, filename, name=None):
"""Dont use me."""
super().__init__(filename, name) # pragma: no cover
warn_deprecated('`neurom.core.neuron.Neuron` is deprecated in favor of '
'`neurom.core.morphology.Morphology`') # pragma: no cover
8 changes: 0 additions & 8 deletions neurom/core/neuron.py

This file was deleted.

8 changes: 0 additions & 8 deletions neurom/features/sectionfunc.py

This file was deleted.

15 changes: 0 additions & 15 deletions neurom/io/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
from neurom.core.morphology import Morphology
from neurom.core.population import Population
from neurom.exceptions import NeuroMError
from neurom.utils import warn_deprecated

L = logging.getLogger(__name__)

Expand Down Expand Up @@ -165,13 +164,6 @@ def load_morphology(morph, reader=None):
return Morphology(morph, Path(morph).name)


def load_neuron(morph, reader=None):
"""Deprecated in favor of ``load_morphology``."""
warn_deprecated('`neurom.io.utils.load_neuron` is deprecated in favor of '
'`neurom.io.utils.load_morphology`') # pragma: no cover
return load_morphology(morph, reader) # pragma: no cover


def load_morphologies(morphs,
name=None,
ignored_exceptions=(),
Expand Down Expand Up @@ -199,10 +191,3 @@ def load_morphologies(morphs,
files = morphs
name = name or 'Population'
return Population(files, name, ignored_exceptions, cache)


def load_neurons(morphs, name=None, ignored_exceptions=(), cache=False):
"""Deprecated in favor of ``load_morphologies``."""
warn_deprecated('`neurom.io.utils.load_neurons` is deprecated in favor of '
'`neurom.io.utils.load_morphologies`') # pragma: no cover
return load_morphologies(morphs, name, ignored_exceptions, cache) # pragma: no cover

0 comments on commit 82ceb48

Please sign in to comment.