Remove unused imports across entire Python API

This commit is contained in:
Paul Romano 2020-03-31 18:11:31 -05:00
parent 5f6bf21aba
commit e34a71b448
46 changed files with 21 additions and 92 deletions

View file

@ -1,4 +1,3 @@
import sys
import copy
from collections.abc import Iterable

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,4 @@
from abc import ABCMeta, abstractmethod
from io import StringIO
import openmc.data
from openmc.mixin import EqualityMixin

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,4 @@
from numbers import Integral, Real
from numbers import Real
from math import exp, erf, pi, sqrt
import h5py

View file

@ -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

View file

@ -1,7 +1,5 @@
from collections.abc import Iterable
from io import StringIO
from numbers import Real
import sys
import numpy as np

View file

@ -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

View file

@ -1,4 +1,3 @@
from collections import defaultdict
from collections.abc import MutableSequence, Iterable
import io

View file

@ -2,8 +2,6 @@
An ndarray to store reaction rates with string, integer, or slice indexing.
"""
from collections import OrderedDict
import numpy as np

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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']

View file

@ -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

View file

@ -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',

View file

@ -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

View file

@ -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):

View file

@ -1,7 +1,6 @@
from collections.abc import Iterable
from numbers import Real
import copy
import sys
import numpy as np

View file

@ -1,4 +1,3 @@
import sys
import os
import copy
import pickle

View file

@ -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

View file

@ -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)

View file

@ -1,7 +1,5 @@
import warnings
import openmc.checkvalue as cv
class Nuclide(str):
"""A nuclide that can be used in a material.

View file

@ -1,6 +1,3 @@
import copy
import operator
import numpy as np
import openmoc

View file

@ -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

View file

@ -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)):

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,4 @@
from numbers import Real
import sys
from xml.etree import ElementTree as ET
from openmc._xml import get_text

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,4 @@
from collections.abc import Iterable
import re
import warnings
import numpy as np

View file

@ -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

View file

@ -1,4 +1,3 @@
import sys
from numbers import Integral
from xml.etree import ElementTree as ET

View file

@ -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

View file

@ -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