diff --git a/openmc/capi/cell.py b/openmc/capi/cell.py index 0cadfd6af4..3c14aae528 100644 --- a/openmc/capi/cell.py +++ b/openmc/capi/cell.py @@ -1,4 +1,4 @@ -from collections import Mapping, Iterable +from collections.abc import Mapping, Iterable from ctypes import c_int, c_int32, c_double, c_char_p, POINTER from weakref import WeakValueDictionary diff --git a/openmc/capi/filter.py b/openmc/capi/filter.py index 74c6828d60..ac78c0a341 100644 --- a/openmc/capi/filter.py +++ b/openmc/capi/filter.py @@ -1,4 +1,4 @@ -from collections import Mapping +from collections.abc import Mapping from ctypes import c_int, c_int32, c_double, c_char_p, POINTER, \ create_string_buffer from weakref import WeakValueDictionary diff --git a/openmc/capi/material.py b/openmc/capi/material.py index af0e9893e4..8a55c27173 100644 --- a/openmc/capi/material.py +++ b/openmc/capi/material.py @@ -1,4 +1,4 @@ -from collections import Mapping +from collections.abc import Mapping from ctypes import c_int, c_int32, c_double, c_char_p, POINTER from weakref import WeakValueDictionary diff --git a/openmc/capi/nuclide.py b/openmc/capi/nuclide.py index 54d131498f..f66212c971 100644 --- a/openmc/capi/nuclide.py +++ b/openmc/capi/nuclide.py @@ -1,4 +1,4 @@ -from collections import Mapping +from collections.abc import Mapping from ctypes import c_int, c_char_p, POINTER from weakref import WeakValueDictionary diff --git a/openmc/capi/tally.py b/openmc/capi/tally.py index aaf709e612..f50a19001d 100644 --- a/openmc/capi/tally.py +++ b/openmc/capi/tally.py @@ -1,4 +1,4 @@ -from collections import Mapping +from collections.abc import Mapping from ctypes import c_int, c_int32, c_double, c_char_p, POINTER from weakref import WeakValueDictionary diff --git a/openmc/cell.py b/openmc/cell.py index 838d419b62..c7587e136a 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -1,4 +1,5 @@ -from collections import OrderedDict, Iterable +from collections import OrderedDict +from collections.abc import Iterable from copy import deepcopy from math import cos, sin, pi from numbers import Real, Integral diff --git a/openmc/checkvalue.py b/openmc/checkvalue.py index 643ea4820f..dd32aa566c 100644 --- a/openmc/checkvalue.py +++ b/openmc/checkvalue.py @@ -1,5 +1,5 @@ import copy -from collections import Iterable +from collections.abc import Iterable import numpy as np diff --git a/openmc/cmfd.py b/openmc/cmfd.py index 236491923d..5444334b20 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -10,7 +10,7 @@ References """ -from collections import Iterable +from collections.abc import Iterable from numbers import Real, Integral from xml.etree import ElementTree as ET import sys diff --git a/openmc/data/angle_distribution.py b/openmc/data/angle_distribution.py index 71e3d2f309..a1f498ba61 100644 --- a/openmc/data/angle_distribution.py +++ b/openmc/data/angle_distribution.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from io import StringIO from numbers import Real from warnings import warn diff --git a/openmc/data/correlated.py b/openmc/data/correlated.py index ba69e6aa6c..8cc4509cea 100644 --- a/openmc/data/correlated.py +++ b/openmc/data/correlated.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from numbers import Real, Integral from warnings import warn diff --git a/openmc/data/decay.py b/openmc/data/decay.py index 3d365b6c70..d83338d028 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -1,4 +1,5 @@ -from collections import Iterable, namedtuple +from collections import namedtuple +from collections.abc import Iterable from io import StringIO from math import log from numbers import Real diff --git a/openmc/data/endf.py b/openmc/data/endf.py index 882874b590..160ab61513 100644 --- a/openmc/data/endf.py +++ b/openmc/data/endf.py @@ -10,7 +10,8 @@ import io import re import os from math import pi -from collections import OrderedDict, Iterable +from collections import OrderedDict +from collections.abc import Iterable import numpy as np from numpy.polynomial.polynomial import Polynomial diff --git a/openmc/data/energy_distribution.py b/openmc/data/energy_distribution.py index 55588bd648..9e01a4b302 100644 --- a/openmc/data/energy_distribution.py +++ b/openmc/data/energy_distribution.py @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from collections import Iterable +from collections.abc import Iterable from numbers import Integral, Real from warnings import warn diff --git a/openmc/data/fission_energy.py b/openmc/data/fission_energy.py index a7cf3dfed3..c602ba2c6f 100644 --- a/openmc/data/fission_energy.py +++ b/openmc/data/fission_energy.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from copy import deepcopy from io import StringIO import sys diff --git a/openmc/data/function.py b/openmc/data/function.py index 2d3a8ce9c1..3d09e44fc8 100644 --- a/openmc/data/function.py +++ b/openmc/data/function.py @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from collections import Iterable, Callable +from collections.abc import Iterable, Callable from numbers import Real, Integral import numpy as np diff --git a/openmc/data/kalbach_mann.py b/openmc/data/kalbach_mann.py index 30a1c01cdc..4be0c15d52 100644 --- a/openmc/data/kalbach_mann.py +++ b/openmc/data/kalbach_mann.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from numbers import Real, Integral from warnings import warn diff --git a/openmc/data/laboratory.py b/openmc/data/laboratory.py index 18516d9b87..cfedb292b1 100644 --- a/openmc/data/laboratory.py +++ b/openmc/data/laboratory.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from numbers import Real, Integral import numpy as np diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index 4f02af1a48..0aa1fe7d83 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -1,5 +1,6 @@ import sys -from collections import OrderedDict, Iterable, Mapping, MutableMapping +from collections import OrderedDict +from collections.abc import Iterable, Mapping, MutableMapping from io import StringIO from itertools import chain from math import log10 diff --git a/openmc/data/product.py b/openmc/data/product.py index b7d89ba0ea..5b8652d771 100644 --- a/openmc/data/product.py +++ b/openmc/data/product.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from io import StringIO from numbers import Real import sys diff --git a/openmc/data/reaction.py b/openmc/data/reaction.py index 737885f357..d3df038f55 100644 --- a/openmc/data/reaction.py +++ b/openmc/data/reaction.py @@ -1,4 +1,4 @@ -from collections import Iterable, Callable, MutableMapping +from collections.abc import Iterable, Callable, MutableMapping from copy import deepcopy from numbers import Real, Integral from warnings import warn diff --git a/openmc/data/resonance.py b/openmc/data/resonance.py index 5e7e0c44d7..d58f706eb9 100644 --- a/openmc/data/resonance.py +++ b/openmc/data/resonance.py @@ -1,4 +1,5 @@ -from collections import defaultdict, MutableSequence, Iterable +from collections import defaultdict +from collections.abc import MutableSequence, Iterable import io import numpy as np diff --git a/openmc/data/thermal.py b/openmc/data/thermal.py index 4f89d8e834..a036a2680c 100644 --- a/openmc/data/thermal.py +++ b/openmc/data/thermal.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from difflib import get_close_matches from numbers import Real import itertools diff --git a/openmc/data/urr.py b/openmc/data/urr.py index 1f915974b1..0edccf6f06 100644 --- a/openmc/data/urr.py +++ b/openmc/data/urr.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from numbers import Integral, Real import numpy as np diff --git a/openmc/executor.py b/openmc/executor.py index e3768f4c61..8ad2bd8960 100644 --- a/openmc/executor.py +++ b/openmc/executor.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable import subprocess from numbers import Integral diff --git a/openmc/geometry.py b/openmc/geometry.py index 7e14272698..1ee93dfd6d 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -1,4 +1,5 @@ -from collections import OrderedDict, Iterable +from collections import OrderedDict +from collections.abc import Iterable from copy import deepcopy from xml.etree import ElementTree as ET diff --git a/openmc/lattice.py b/openmc/lattice.py index 0819a85917..2f7fcf56df 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -1,5 +1,6 @@ from abc import ABCMeta -from collections import OrderedDict, Iterable +from collections import OrderedDict +from collections.abc import Iterable from copy import deepcopy from math import sqrt, floor from numbers import Real, Integral diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index c8b151e024..9add7004bb 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -3,7 +3,8 @@ import os import copy import pickle from numbers import Integral -from collections import OrderedDict, Iterable +from collections import OrderedDict +from collections.abc import Iterable from warnings import warn import numpy as np diff --git a/openmc/mgxs/mdgxs.py b/openmc/mgxs/mdgxs.py index dfd0d192d9..2d278d62d7 100644 --- a/openmc/mgxs/mdgxs.py +++ b/openmc/mgxs/mdgxs.py @@ -1,4 +1,5 @@ -from collections import Iterable, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable import itertools from numbers import Integral import warnings diff --git a/openmc/model/funcs.py b/openmc/model/funcs.py index b5afdf08d1..6013f6caee 100644 --- a/openmc/model/funcs.py +++ b/openmc/model/funcs.py @@ -1,4 +1,5 @@ -from collections import Iterable, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable from math import sqrt from numbers import Real diff --git a/openmc/model/model.py b/openmc/model/model.py index 17de6fc2e6..89fa84e604 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable import openmc from openmc.checkvalue import check_type diff --git a/openmc/model/triso.py b/openmc/model/triso.py index fab2f54cc1..2786216f77 100644 --- a/openmc/model/triso.py +++ b/openmc/model/triso.py @@ -2,7 +2,8 @@ import copy import warnings import itertools import random -from collections import Iterable, defaultdict +from collections import defaultdict +from collections.abc import Iterable from numbers import Real from random import uniform, gauss from heapq import heappush, heappop diff --git a/openmc/plots.py b/openmc/plots.py index 159e920780..4414a39e13 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -1,4 +1,4 @@ -from collections import Iterable, Mapping +from collections.abc import Iterable, Mapping from numbers import Real, Integral from xml.etree import ElementTree as ET import sys diff --git a/openmc/region.py b/openmc/region.py index c9bd3b5fc0..f82db8553b 100644 --- a/openmc/region.py +++ b/openmc/region.py @@ -1,5 +1,6 @@ from abc import ABCMeta, abstractmethod -from collections import Iterable, OrderedDict, MutableSequence +from collections import OrderedDict +from collections.abc import Iterable, MutableSequence from copy import deepcopy import numpy as np diff --git a/openmc/search.py b/openmc/search.py index 7f91438fd7..75935097e4 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from numbers import Real import scipy.optimize as sopt diff --git a/openmc/settings.py b/openmc/settings.py index b9562b7ddc..62cfc27aaa 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -1,4 +1,4 @@ -from collections import Iterable, MutableSequence, Mapping +from collections.abc import Iterable, MutableSequence, Mapping from numbers import Real, Integral import warnings from xml.etree import ElementTree as ET diff --git a/openmc/stats/multivariate.py b/openmc/stats/multivariate.py index 1fe883866f..ac788c3443 100644 --- a/openmc/stats/multivariate.py +++ b/openmc/stats/multivariate.py @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from collections import Iterable +from collections.abc import Iterable from math import pi from numbers import Real import sys diff --git a/openmc/stats/univariate.py b/openmc/stats/univariate.py index 6996970af1..16a9dbb9e7 100644 --- a/openmc/stats/univariate.py +++ b/openmc/stats/univariate.py @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from collections import Iterable +from collections.abc import Iterable from numbers import Real import sys from xml.etree import ElementTree as ET diff --git a/openmc/summary.py b/openmc/summary.py index 34743757b4..aa98025c08 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable import re import warnings diff --git a/openmc/tallies.py b/openmc/tallies.py index 61be38fb2a..d22cfdcb46 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1,4 +1,4 @@ -from collections import Iterable, MutableSequence +from collections.abc import Iterable, MutableSequence import copy import re from functools import partial, reduce diff --git a/openmc/trigger.py b/openmc/trigger.py index c6a0c0b25d..71f9c0b92b 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -2,7 +2,7 @@ from numbers import Real from xml.etree import ElementTree as ET import sys import warnings -from collections import Iterable +from collections.abc import Iterable import openmc.checkvalue as cv diff --git a/openmc/volume.py b/openmc/volume.py index cccb3c6a27..d61093a178 100644 --- a/openmc/volume.py +++ b/openmc/volume.py @@ -1,4 +1,5 @@ -from collections import Iterable, Mapping, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable, Mapping from numbers import Real, Integral from xml.etree import ElementTree as ET import warnings diff --git a/tests/check_source.py b/tests/check_source.py index 3a79d44c28..78cef2a0cd 100755 --- a/tests/check_source.py +++ b/tests/check_source.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python - -from __future__ import print_function +#!/usr/bin/env python3 import glob from string import whitespace diff --git a/tests/regression_tests/tally_slice_merge/test.py b/tests/regression_tests/tally_slice_merge/test.py index c198411f7d..ff35c177f5 100644 --- a/tests/regression_tests/tally_slice_merge/test.py +++ b/tests/regression_tests/tally_slice_merge/test.py @@ -1,5 +1,3 @@ -from __future__ import division - import hashlib import itertools diff --git a/tests/testing_harness.py b/tests/testing_harness.py index 55a5660f1c..6c9e25b457 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -1,5 +1,3 @@ -from __future__ import print_function - from difflib import unified_diff import filecmp import glob