diff --git a/openmc/arithmetic.py b/openmc/arithmetic.py index 70c74066d6..6a9700d795 100644 --- a/openmc/arithmetic.py +++ b/openmc/arithmetic.py @@ -1,4 +1,3 @@ -import sys import copy from collections.abc import Iterable diff --git a/openmc/cell.py b/openmc/cell.py index 426a502e07..ec0e415cd2 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -5,15 +5,13 @@ from math import cos, sin, pi from numbers import Real from xml.etree import ElementTree as ET from uncertainties import UFloat -import sys -import warnings import numpy as np import openmc import openmc.checkvalue as cv from openmc.surface import Halfspace -from openmc.region import Region, Intersection, Complement +from openmc.region import Region, Complement from openmc._xml import get_text from .mixin import IDManagerMixin diff --git a/openmc/cmfd.py b/openmc/cmfd.py index 476ff0b30e..a02a763878 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -15,7 +15,6 @@ from collections.abc import Iterable, Mapping from numbers import Real, Integral import sys import time -from ctypes import c_int import warnings import numpy as np diff --git a/openmc/data/ace.py b/openmc/data/ace.py index 3de3853ed7..7d60d082e8 100644 --- a/openmc/data/ace.py +++ b/openmc/data/ace.py @@ -17,9 +17,8 @@ generates ACE-format cross sections. from collections import OrderedDict import enum -from pathlib import PurePath, Path +from pathlib import Path import struct -import sys import numpy as np diff --git a/openmc/data/angle_energy.py b/openmc/data/angle_energy.py index 8cf9bcf5e8..e460575d2e 100644 --- a/openmc/data/angle_energy.py +++ b/openmc/data/angle_energy.py @@ -1,5 +1,4 @@ from abc import ABCMeta, abstractmethod -from io import StringIO import openmc.data from openmc.mixin import EqualityMixin diff --git a/openmc/data/decay.py b/openmc/data/decay.py index 9134b48291..505d72cf06 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -1,13 +1,11 @@ -from collections import namedtuple from collections.abc import Iterable from io import StringIO from math import log -from numbers import Real import re from warnings import warn import numpy as np -from uncertainties import ufloat, unumpy, UFloat +from uncertainties import ufloat, UFloat import openmc.checkvalue as cv from openmc.mixin import EqualityMixin diff --git a/openmc/data/endf.py b/openmc/data/endf.py index 8fe5c3bfa8..51349c0bef 100644 --- a/openmc/data/endf.py +++ b/openmc/data/endf.py @@ -8,18 +8,12 @@ http://www-nds.iaea.org/ndspub/documents/endf/endf102/endf102.pdf """ import io import re -import os -from math import pi from pathlib import PurePath -from collections import OrderedDict -from collections.abc import Iterable import numpy as np -from numpy.polynomial.polynomial import Polynomial -from .data import ATOMIC_SYMBOL, gnd_name -from .function import Tabulated1D, INTERPOLATION_SCHEME -from openmc.stats.univariate import Uniform, Tabular, Legendre +from .data import gnd_name +from .function import Tabulated1D try: from ._endf import float_endf _CYTHON = True diff --git a/openmc/data/fission_energy.py b/openmc/data/fission_energy.py index 95915650b8..17cb6d9ce1 100644 --- a/openmc/data/fission_energy.py +++ b/openmc/data/fission_energy.py @@ -1,10 +1,6 @@ from collections.abc import Callable from copy import deepcopy from io import StringIO -import sys - -import h5py -import numpy as np from .data import EV_PER_MEV from .endf import get_cont_record, get_list_record, get_tab1_record, Evaluation diff --git a/openmc/data/laboratory.py b/openmc/data/laboratory.py index 10403655d3..87d9d29618 100644 --- a/openmc/data/laboratory.py +++ b/openmc/data/laboratory.py @@ -4,7 +4,7 @@ from numbers import Real, Integral import numpy as np import openmc.checkvalue as cv -from openmc.stats import Tabular, Univariate, Discrete +from openmc.stats import Tabular, Univariate from .angle_energy import AngleEnergy from .endf import get_tab2_record, get_tab1_record diff --git a/openmc/data/multipole.py b/openmc/data/multipole.py index 6178161ef3..91f49e15fc 100644 --- a/openmc/data/multipole.py +++ b/openmc/data/multipole.py @@ -1,4 +1,4 @@ -from numbers import Integral, Real +from numbers import Real from math import exp, erf, pi, sqrt import h5py diff --git a/openmc/data/photon.py b/openmc/data/photon.py index 9cc697b782..555fd783e9 100644 --- a/openmc/data/photon.py +++ b/openmc/data/photon.py @@ -3,14 +3,13 @@ from collections.abc import Mapping, Callable from copy import deepcopy from io import StringIO from numbers import Integral, Real -from math import pi, sqrt +from math import pi import os import h5py import numpy as np import pandas as pd from scipy.interpolate import CubicSpline -from scipy.integrate import quad from openmc.mixin import EqualityMixin import openmc.checkvalue as cv diff --git a/openmc/data/product.py b/openmc/data/product.py index a6ea17bf90..f7778cfa96 100644 --- a/openmc/data/product.py +++ b/openmc/data/product.py @@ -1,7 +1,5 @@ from collections.abc import Iterable -from io import StringIO from numbers import Real -import sys import numpy as np diff --git a/openmc/data/reaction.py b/openmc/data/reaction.py index de2e5e924d..73e6669413 100644 --- a/openmc/data/reaction.py +++ b/openmc/data/reaction.py @@ -1,6 +1,6 @@ from collections.abc import Iterable, Callable, MutableMapping from copy import deepcopy -from numbers import Real, Integral +from numbers import Real from warnings import warn from io import StringIO diff --git a/openmc/data/resonance.py b/openmc/data/resonance.py index aa79aafa1f..d7f35e3ea8 100644 --- a/openmc/data/resonance.py +++ b/openmc/data/resonance.py @@ -1,4 +1,3 @@ -from collections import defaultdict from collections.abc import MutableSequence, Iterable import io diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index b1dc5b13f3..299f1133f6 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -2,8 +2,6 @@ An ndarray to store reaction rates with string, integer, or slice indexing. """ -from collections import OrderedDict - import numpy as np diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 28b489d1f1..37d0df7c05 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -5,7 +5,6 @@ Contains results generation and saving capabilities. from collections import OrderedDict import copy -from warnings import warn import numpy as np import h5py diff --git a/openmc/element.py b/openmc/element.py index a8e344ddfa..69bd03ae65 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -4,7 +4,6 @@ import os from xml.etree import ElementTree as ET import openmc.checkvalue as cv -from numbers import Real from openmc.data import NATURAL_ABUNDANCE, atomic_mass diff --git a/openmc/filter.py b/openmc/filter.py index 7af029150f..80827c6a45 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1,7 +1,6 @@ from abc import ABCMeta from collections import OrderedDict from collections.abc import Iterable -import copy import hashlib from itertools import product from numbers import Real, Integral diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index cc085df8a4..c26d5437b3 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -1,9 +1,6 @@ from numbers import Integral, Real from xml.etree import ElementTree as ET -import numpy as np -import pandas as pd - import openmc.checkvalue as cv from . import Filter diff --git a/openmc/geometry.py b/openmc/geometry.py index c3d2cd76b8..845ad8dc32 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -4,8 +4,6 @@ from copy import deepcopy from pathlib import Path from xml.etree import ElementTree as ET -import numpy as np - import openmc import openmc._xml as xml from openmc.checkvalue import check_type diff --git a/openmc/lattice.py b/openmc/lattice.py index 782664a29e..97b6a6bf53 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -7,7 +7,6 @@ from numbers import Real from xml.etree import ElementTree as ET import numpy as np -import warnings import types import openmc.checkvalue as cv diff --git a/openmc/lib/cell.py b/openmc/lib/cell.py index 57946818db..e50c885d8a 100644 --- a/openmc/lib/cell.py +++ b/openmc/lib/cell.py @@ -5,7 +5,6 @@ from ctypes import c_int, c_int32, c_double, c_char_p, POINTER from weakref import WeakValueDictionary import numpy as np -from numpy.ctypeslib import as_array from openmc.exceptions import AllocationError, InvalidIDError from . import _dll diff --git a/openmc/lib/core.py b/openmc/lib/core.py index d0fd41e6fa..e83d6f106f 100644 --- a/openmc/lib/core.py +++ b/openmc/lib/core.py @@ -1,14 +1,12 @@ import sys from contextlib import contextmanager -from ctypes import (CDLL, c_bool, c_int, c_int32, c_int64, c_double, c_char_p, +from ctypes import (c_bool, c_int, c_int32, c_int64, c_double, c_char_p, c_char, POINTER, Structure, c_void_p, create_string_buffer) -from warnings import warn import numpy as np from numpy.ctypeslib import as_array -from openmc.exceptions import AllocationError from . import _dll from .error import _error_handler import openmc.lib diff --git a/openmc/lib/mesh.py b/openmc/lib/mesh.py index bf51bdfe98..db138f3a2d 100644 --- a/openmc/lib/mesh.py +++ b/openmc/lib/mesh.py @@ -1,15 +1,13 @@ -from collections.abc import Mapping, Iterable +from collections.abc import Mapping from ctypes import c_int, c_int32, c_double, POINTER from weakref import WeakValueDictionary -import numpy as np from numpy.ctypeslib import as_array from openmc.exceptions import AllocationError, InvalidIDError from . import _dll from .core import _FortranObjectWithID from .error import _error_handler -from .material import Material __all__ = ['RegularMesh', 'meshes'] diff --git a/openmc/lib/nuclide.py b/openmc/lib/nuclide.py index 81ef7e648e..8714608d26 100644 --- a/openmc/lib/nuclide.py +++ b/openmc/lib/nuclide.py @@ -2,9 +2,6 @@ from collections.abc import Mapping from ctypes import c_int, c_char_p, POINTER, c_size_t from weakref import WeakValueDictionary -import numpy as np -from numpy.ctypeslib import as_array - from openmc.exceptions import DataError, AllocationError from . import _dll from .core import _FortranObject diff --git a/openmc/lib/settings.py b/openmc/lib/settings.py index 104bfdd937..b63b355e44 100644 --- a/openmc/lib/settings.py +++ b/openmc/lib/settings.py @@ -1,9 +1,7 @@ -from ctypes import (c_int, c_int32, c_int64, c_double, c_char_p, c_bool, - POINTER) +from ctypes import c_int, c_int32, c_int64, c_double, c_char_p, c_bool from . import _dll from .core import _DLLGlobal -from .error import _error_handler _RUN_MODES = {1: 'fixed source', 2: 'eigenvalue', diff --git a/openmc/material.py b/openmc/material.py index ee50287c7d..a950569bfd 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -1,7 +1,7 @@ from collections import OrderedDict, defaultdict, namedtuple, Counter from collections.abc import Iterable from copy import deepcopy -from numbers import Real, Integral +from numbers import Real from pathlib import Path import warnings import re diff --git a/openmc/mesh.py b/openmc/mesh.py index fcc1f2ee2d..c490f604a1 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -2,7 +2,6 @@ from abc import ABCMeta from collections.abc import Iterable from numbers import Real, Integral from xml.etree import ElementTree as ET -import sys import warnings import numpy as np @@ -10,7 +9,7 @@ import numpy as np import openmc.checkvalue as cv import openmc from openmc._xml import get_text -from openmc.mixin import EqualityMixin, IDManagerMixin +from openmc.mixin import IDManagerMixin class MeshBase(IDManagerMixin, metaclass=ABCMeta): diff --git a/openmc/mgxs/groups.py b/openmc/mgxs/groups.py index 5d7876644a..06e2e80ebd 100644 --- a/openmc/mgxs/groups.py +++ b/openmc/mgxs/groups.py @@ -1,7 +1,6 @@ from collections.abc import Iterable from numbers import Real import copy -import sys import numpy as np diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 00b30f8ed0..6ddd8e158d 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -1,4 +1,3 @@ -import sys import os import copy import pickle diff --git a/openmc/mgxs/mdgxs.py b/openmc/mgxs/mdgxs.py index 75a2e6791b..e23f927f40 100644 --- a/openmc/mgxs/mdgxs.py +++ b/openmc/mgxs/mdgxs.py @@ -1,12 +1,8 @@ from collections import OrderedDict -from collections.abc import Iterable import itertools from numbers import Integral -import warnings import os -import sys import copy -from abc import ABCMeta import numpy as np diff --git a/openmc/model/funcs.py b/openmc/model/funcs.py index 188f1a273a..4b605d13bb 100644 --- a/openmc/model/funcs.py +++ b/openmc/model/funcs.py @@ -6,8 +6,8 @@ from warnings import warn from operator import attrgetter from openmc import ( - XPlane, YPlane, Plane, ZCylinder, Quadric, Cylinder, XCylinder, - YCylinder, Material, Universe, Cell) + XPlane, YPlane, Plane, ZCylinder, Cylinder, XCylinder, + YCylinder, Universe, Cell) from openmc.checkvalue import ( check_type, check_value, check_length, check_less_than, check_iterable_type) diff --git a/openmc/nuclide.py b/openmc/nuclide.py index f7c725040f..fcbfc2d606 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -1,7 +1,5 @@ import warnings -import openmc.checkvalue as cv - class Nuclide(str): """A nuclide that can be used in a material. diff --git a/openmc/openmoc_compatible.py b/openmc/openmoc_compatible.py index d18070740c..4bd09e7711 100644 --- a/openmc/openmoc_compatible.py +++ b/openmc/openmoc_compatible.py @@ -1,6 +1,3 @@ -import copy -import operator - import numpy as np import openmoc diff --git a/openmc/plots.py b/openmc/plots.py index 51054549f5..41a50a5f2a 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -2,8 +2,6 @@ from collections.abc import Iterable, Mapping from numbers import Real, Integral from pathlib import Path import subprocess -import sys -import warnings from xml.etree import ElementTree as ET import numpy as np diff --git a/openmc/polynomial.py b/openmc/polynomial.py index 6c0e82461f..c57b5fbdce 100644 --- a/openmc/polynomial.py +++ b/openmc/polynomial.py @@ -1,7 +1,7 @@ -import math -import numpy as np -import openmc from collections.abc import Iterable +import math + +import numpy as np def legendre_from_expcoef(coef, domain=(-1, 1)): diff --git a/openmc/region.py b/openmc/region.py index 0d86d99bb9..bcff3d9633 100644 --- a/openmc/region.py +++ b/openmc/region.py @@ -1,6 +1,6 @@ from abc import ABCMeta, abstractmethod from collections import OrderedDict -from collections.abc import Iterable, MutableSequence +from collections.abc import MutableSequence from copy import deepcopy import numpy as np diff --git a/openmc/settings.py b/openmc/settings.py index 8ea110be13..1379bc157f 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -2,11 +2,7 @@ from collections.abc import Iterable, MutableSequence, Mapping from enum import Enum from pathlib import Path from numbers import Real, Integral -import warnings from xml.etree import ElementTree as ET -import sys - -import numpy as np from openmc._xml import clean_indentation, get_text import openmc.checkvalue as cv diff --git a/openmc/source.py b/openmc/source.py index 7b709321f1..eecaf2c659 100644 --- a/openmc/source.py +++ b/openmc/source.py @@ -1,5 +1,4 @@ from numbers import Real -import sys from xml.etree import ElementTree as ET from openmc._xml import get_text diff --git a/openmc/stats/multivariate.py b/openmc/stats/multivariate.py index 3d258ee350..281e445707 100644 --- a/openmc/stats/multivariate.py +++ b/openmc/stats/multivariate.py @@ -2,7 +2,6 @@ from abc import ABCMeta, abstractmethod from collections.abc import Iterable from math import pi from numbers import Real -import sys from xml.etree import ElementTree as ET import numpy as np diff --git a/openmc/stats/univariate.py b/openmc/stats/univariate.py index 69386f6780..64487f34f5 100644 --- a/openmc/stats/univariate.py +++ b/openmc/stats/univariate.py @@ -1,7 +1,6 @@ from abc import ABCMeta, abstractmethod from collections.abc import Iterable from numbers import Real -import sys from xml.etree import ElementTree as ET import numpy as np diff --git a/openmc/summary.py b/openmc/summary.py index b5486ecb58..fa8781335b 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -1,5 +1,4 @@ from collections.abc import Iterable -import re import warnings import numpy as np diff --git a/openmc/tallies.py b/openmc/tallies.py index a8687bb373..ac9b1e14cb 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1,12 +1,10 @@ from collections.abc import Iterable, MutableSequence import copy -import re from functools import partial, reduce from itertools import product from numbers import Integral, Real import operator from pathlib import Path -import warnings from xml.etree import ElementTree as ET import numpy as np diff --git a/openmc/tally_derivative.py b/openmc/tally_derivative.py index 9be748b2cb..dea5fcd871 100644 --- a/openmc/tally_derivative.py +++ b/openmc/tally_derivative.py @@ -1,4 +1,3 @@ -import sys from numbers import Integral from xml.etree import ElementTree as ET diff --git a/openmc/trigger.py b/openmc/trigger.py index 1dcaf8a7db..1543d1ada7 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -1,7 +1,5 @@ from numbers import Real from xml.etree import ElementTree as ET -import sys -import warnings from collections.abc import Iterable import openmc.checkvalue as cv diff --git a/openmc/universe.py b/openmc/universe.py index 1d65397f86..b5bcd866e2 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -1,9 +1,8 @@ from collections import OrderedDict from collections.abc import Iterable from copy import copy, deepcopy -from numbers import Integral, Real +from numbers import Real import random -import sys import numpy as np