From 221b068527afb63404e62d4451dc0e4f4edb0900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Mon, 16 Dec 2024 04:02:16 -0500 Subject: [PATCH] ENH: Remove Python 2.x legacy conditional import statement (#71) Remove Python 2.x legacy conditional import statement: import `OrderedDict` from `collections`. Support for Python 2.x was dropped following the discussion in https://github.com/demianw/tract_querier/pull/5. --- tract_querier/tract_math/operations.py | 6 +----- tract_querier/tract_math/tensor_operations.py | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/tract_querier/tract_math/operations.py b/tract_querier/tract_math/operations.py index 3fa2de3..9b91242 100644 --- a/tract_querier/tract_math/operations.py +++ b/tract_querier/tract_math/operations.py @@ -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') diff --git a/tract_querier/tract_math/tensor_operations.py b/tract_querier/tract_math/tensor_operations.py index 3b4350d..53543bc 100644 --- a/tract_querier/tract_math/tensor_operations.py +++ b/tract_querier/tract_math/tensor_operations.py @@ -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):