diff --git a/autotest/autotest_scripts.py b/autotest/autotest_scripts.py index 32d2534182..dfa652560d 100644 --- a/autotest/autotest_scripts.py +++ b/autotest/autotest_scripts.py @@ -1,5 +1,4 @@ # Remove the temp directory and then create a fresh one -from __future__ import print_function import os import sys import shutil diff --git a/examples/Testing/flopy3_plotdata.py b/examples/Testing/flopy3_plotdata.py index d9f306cc03..013c18ac89 100644 --- a/examples/Testing/flopy3_plotdata.py +++ b/examples/Testing/flopy3_plotdata.py @@ -1,4 +1,3 @@ -from __future__ import print_function import os import numpy as np diff --git a/examples/scripts/flopy_swi2_ex1.py b/examples/scripts/flopy_swi2_ex1.py index 38f8368a82..2d838ae338 100755 --- a/examples/scripts/flopy_swi2_ex1.py +++ b/examples/scripts/flopy_swi2_ex1.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import os import sys import math diff --git a/examples/scripts/flopy_swi2_ex2.py b/examples/scripts/flopy_swi2_ex2.py index b43e3bb8b3..57a9d76619 100755 --- a/examples/scripts/flopy_swi2_ex2.py +++ b/examples/scripts/flopy_swi2_ex2.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import os import sys import collections diff --git a/examples/scripts/flopy_swi2_ex3.py b/examples/scripts/flopy_swi2_ex3.py index ef061d0f70..92feff4a00 100755 --- a/examples/scripts/flopy_swi2_ex3.py +++ b/examples/scripts/flopy_swi2_ex3.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import os import sys diff --git a/examples/scripts/flopy_swi2_ex4.py b/examples/scripts/flopy_swi2_ex4.py index d8125508cf..4ee4182639 100644 --- a/examples/scripts/flopy_swi2_ex4.py +++ b/examples/scripts/flopy_swi2_ex4.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import os import platform import sys diff --git a/examples/scripts/flopy_swi2_ex5.py b/examples/scripts/flopy_swi2_ex5.py index 937a0ab738..87465f8f61 100755 --- a/examples/scripts/flopy_swi2_ex5.py +++ b/examples/scripts/flopy_swi2_ex5.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import os import sys import math diff --git a/flopy/export/utils.py b/flopy/export/utils.py index 9d17da9d37..bd4895cffb 100644 --- a/flopy/export/utils.py +++ b/flopy/export/utils.py @@ -1,4 +1,3 @@ -from __future__ import print_function import json import os import numpy as np diff --git a/flopy/export/vtk.py b/flopy/export/vtk.py index 3a763e267f..37862cf3e0 100644 --- a/flopy/export/vtk.py +++ b/flopy/export/vtk.py @@ -1,4 +1,3 @@ -from __future__ import print_function, division import os import numpy as np from ..discretization import StructuredGrid diff --git a/flopy/mbase.py b/flopy/mbase.py index c1e42186b0..f346de15f1 100644 --- a/flopy/mbase.py +++ b/flopy/mbase.py @@ -4,8 +4,6 @@ all of the other models inherit from. """ - -from __future__ import print_function import abc import sys import os diff --git a/flopy/mf6/data/mfdatastorage.py b/flopy/mf6/data/mfdatastorage.py index d73bf2b475..801c2a9d5e 100644 --- a/flopy/mf6/data/mfdatastorage.py +++ b/flopy/mf6/data/mfdatastorage.py @@ -2423,10 +2423,10 @@ def _fill_dimensions(self, data_iter, dimensions): data_array = np.ndarray(shape=dimensions, dtype=np_dtype) # fill array for index in ArrayIndexIter(dimensions): - data_array.itemset(index, data_iter.__next__()) + data_array.itemset(index, next(data_iter)) return data_array elif self.data_structure_type == DataStructureType.scalar: - return data_iter.__next__() + return next(data_iter) else: data_array = None data_line = () @@ -2471,7 +2471,7 @@ def _fill_dimensions(self, data_iter, dimensions): ) current_col = 0 data_line = () - data_array[index] = data_iter.next() + data_array[index] = next(data_iter) return data_array def set_tas(self, tas_name, tas_label, current_key, check_name=True): diff --git a/flopy/pakbase.py b/flopy/pakbase.py index 1673bf649b..67ae0d318e 100644 --- a/flopy/pakbase.py +++ b/flopy/pakbase.py @@ -4,9 +4,6 @@ all of the other packages inherit from. """ - -from __future__ import print_function - import abc import os import webbrowser as wb diff --git a/flopy/pest/params.py b/flopy/pest/params.py index 94d2121848..35e9524706 100644 --- a/flopy/pest/params.py +++ b/flopy/pest/params.py @@ -1,4 +1,3 @@ -from __future__ import print_function import numpy as np diff --git a/flopy/pest/templatewriter.py b/flopy/pest/templatewriter.py index 6ee67558f8..62f306d20f 100644 --- a/flopy/pest/templatewriter.py +++ b/flopy/pest/templatewriter.py @@ -1,4 +1,3 @@ -from __future__ import print_function from ..pest import tplarray as tplarray diff --git a/flopy/pest/tplarray.py b/flopy/pest/tplarray.py index f1c21829d6..6ff34932e3 100644 --- a/flopy/pest/tplarray.py +++ b/flopy/pest/tplarray.py @@ -1,4 +1,3 @@ -from __future__ import print_function import numpy as np from ..utils.util_array import Util3d as Util3d from ..utils.util_array import Transient2d as Transient2d diff --git a/flopy/plot/plotutil.py b/flopy/plot/plotutil.py index 9d329e8283..4e5e4806a1 100644 --- a/flopy/plot/plotutil.py +++ b/flopy/plot/plotutil.py @@ -4,7 +4,6 @@ shapefiles are also included. """ -from __future__ import print_function import os import sys import math diff --git a/flopy/utils/binaryfile.py b/flopy/utils/binaryfile.py index 8f5fa72e54..ba1ce30520 100755 --- a/flopy/utils/binaryfile.py +++ b/flopy/utils/binaryfile.py @@ -8,7 +8,6 @@ * CellBudgetFile (Binary cell-by-cell flow file) """ -from __future__ import print_function import numpy as np import warnings from collections import OrderedDict diff --git a/flopy/utils/datafile.py b/flopy/utils/datafile.py index 1f2159d745..e5966ef394 100755 --- a/flopy/utils/datafile.py +++ b/flopy/utils/datafile.py @@ -3,7 +3,6 @@ abstract classes that should not be directly accessed. """ -from __future__ import print_function import numpy as np import flopy.utils from ..discretization.structuredgrid import StructuredGrid diff --git a/flopy/utils/datautil.py b/flopy/utils/datautil.py index 08c2fdf75c..c0c80abbcf 100644 --- a/flopy/utils/datautil.py +++ b/flopy/utils/datautil.py @@ -594,7 +594,7 @@ def nth_index(self, n): aii = ArrayIndexIter(self.list_shape, True) index_num = 0 while index_num <= n: - index = aii.next() + index = next(aii) index_num += 1 return index @@ -651,8 +651,6 @@ def __next__(self): self.current_index -= 1 raise StopIteration() - next = __next__ # Python 2 support - class MultiListIter: def __init__(self, multi_list, detailed_info=False, iter_leaf_lists=False): @@ -673,8 +671,6 @@ def __next__(self): else: return next_val[0] - next = __next__ # Python 2 support - class ConstIter: def __init__(self, value): @@ -686,8 +682,6 @@ def __iter__(self): def __next__(self): return self.value - next = __next__ # Python 2 support - class FileIter: def __init__(self, file_path): @@ -729,8 +723,6 @@ def _next_line(self): return self._current_data = PyListUtil.split_data_line(data_line) - next = __next__ # Python 2 support - class NameIter: def __init__(self, name, first_not_numbered=True): @@ -748,8 +740,6 @@ def __next__(self): else: return "{}_{}".format(self.name, self.iter_num) - next = __next__ # Python 2 support - class PathIter: def __init__(self, path, first_not_numbered=True): @@ -760,6 +750,4 @@ def __iter__(self): return self def __next__(self): - return self.path[0:-1] + (self.name_iter.__next__(),) - - next = __next__ # Python 2 support + return self.path[0:-1] + (next(self.name_iter),) diff --git a/flopy/utils/gridgen.py b/flopy/utils/gridgen.py index 4b027ae088..a04e9b5268 100644 --- a/flopy/utils/gridgen.py +++ b/flopy/utils/gridgen.py @@ -1,4 +1,3 @@ -from __future__ import print_function import os import numpy as np import subprocess diff --git a/flopy/utils/util_array.py b/flopy/utils/util_array.py index f1e8129bfd..c21c62accf 100644 --- a/flopy/utils/util_array.py +++ b/flopy/utils/util_array.py @@ -5,8 +5,6 @@ instantiate these classes directly. """ -from __future__ import division, print_function - # from future.utils import with_metaclass import os diff --git a/flopy/utils/util_list.py b/flopy/utils/util_list.py index 3aaee15df8..cc2d24abf7 100644 --- a/flopy/utils/util_list.py +++ b/flopy/utils/util_list.py @@ -7,8 +7,6 @@ some more info """ -from __future__ import division, print_function - import os import warnings import numpy as np