Skip to content

Commit

Permalink
ENH: Remove Python 2.x legacy conditional import statement (#71)
Browse files Browse the repository at this point in the history
Remove Python 2.x legacy conditional import statement: import
`OrderedDict` from `collections`.

Support for Python 2.x was dropped following the discussion in
#5.
  • Loading branch information
jhlegarreta authored Dec 16, 2024
1 parent 11412db commit 221b068
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions tract_querier/tract_math/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
from . import tensor_operations
from . import tract_operations


try:
from collections import OrderedDict
except ImportError: # Python 2.6 fix
from ordereddict import OrderedDict
from collections import OrderedDict


@tract_math_operation(': print the names of scalar data associated with each tract')
Expand Down
6 changes: 1 addition & 5 deletions tract_querier/tract_math/tensor_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
from . import tract_operations
from ..tensor import scalar_measures

try:
from collections import OrderedDict
except ImportError: # Python 2.6 fix
from ordereddict import OrderedDict

from collections import OrderedDict


def compute_all_measures(tractography, desired_keys_list, scalars=None, resolution=None):
Expand Down

0 comments on commit 221b068

Please sign in to comment.