Skip to content

Commit

Permalink
MAINT: sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kohr-h committed Mar 13, 2018
1 parent 72f4106 commit a9fc714
Show file tree
Hide file tree
Showing 114 changed files with 459 additions and 395 deletions.
3 changes: 2 additions & 1 deletion odl/diagnostics/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

"""Functions for generating standardized examples in spaces."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from itertools import product

__all__ = ('samples',)
Expand Down
5 changes: 3 additions & 2 deletions odl/diagnostics/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

"""Standardized tests for `Operator`'s."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from builtins import object

import numpy as np

from odl.diagnostics.examples import samples
from odl.operator import power_method_opnorm
from odl.util.testutils import FailCounter


__all__ = ('OperatorTest',)


Expand Down
6 changes: 3 additions & 3 deletions odl/diagnostics/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

"""Standardized tests for `LinearSpace`'s."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from builtins import object
from copy import copy, deepcopy

from odl.set import Field
from odl.diagnostics.examples import samples
from odl.set import Field
from odl.util.testutils import FailCounter


__all__ = ('SpaceTest',)


Expand Down
2 changes: 1 addition & 1 deletion odl/operator/oputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"""Convenience functions for operators."""

from __future__ import absolute_import, division, print_function
from future.utils import native

import numpy as np
from future.utils import native

from odl.space.base_tensors import TensorSpace
from odl.space.pspace import ProductSpace
Expand Down
3 changes: 1 addition & 2 deletions odl/phantom/emission.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

"""Phantoms used in emission tomography."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from odl.phantom.geometric import ellipsoid_phantom
from odl.phantom.phantom_utils import cylinders_from_ellipses


__all__ = ('derenzo_sources',)


Expand Down
3 changes: 2 additions & 1 deletion odl/phantom/geometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

"""Phantoms given by simple geometric objects such as cubes or spheres."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.discr.lp_discr import uniform_discr_fromdiscr
Expand Down
5 changes: 3 additions & 2 deletions odl/phantom/misc_phantoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

"""Miscellaneous phantoms that do not fit in other categories."""

from __future__ import print_function, division, absolute_import
import numpy as np
from __future__ import absolute_import, division, print_function

import sys

import numpy as np

__all__ = ('submarine', 'text')

Expand Down
4 changes: 2 additions & 2 deletions odl/phantom/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

"""Functions to create noise samples of different distributions."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.util import NumpyRandomSeed


__all__ = ('white_noise', 'poisson_noise', 'salt_pepper_noise',
'uniform_noise')

Expand Down
4 changes: 2 additions & 2 deletions odl/phantom/phantom_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

"""Utilities for creating phantoms."""

from __future__ import print_function, division, absolute_import
import numpy as np
from __future__ import absolute_import, division, print_function

import numpy as np

__all__ = ('cylinders_from_ellipses',)

Expand Down
4 changes: 2 additions & 2 deletions odl/phantom/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

"""Phantoms typically used in transmission tomography."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.discr import DiscreteLp
from odl.phantom.geometric import ellipsoid_phantom


__all__ = ('shepp_logan_ellipsoids', 'shepp_logan', 'forbild')


Expand Down
8 changes: 4 additions & 4 deletions odl/set/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

"""Domains for continuous functions. """

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.set.sets import Set
from odl.util import (
array_str, is_valid_input_array, is_valid_input_meshgrid, safe_int_conv,
signature_string_parts, repr_string, npy_printoptions, REPR_PRECISION)

REPR_PRECISION, array_str, is_valid_input_array, is_valid_input_meshgrid,
npy_printoptions, repr_string, safe_int_conv, signature_string_parts)

__all__ = ('IntervalProd',)

Expand Down
13 changes: 7 additions & 6 deletions odl/set/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@

"""Basic abstract and concrete sets."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from builtins import int, object
from numbers import Integral, Real, Complex
from past.types.basestring import basestring
from numbers import Complex, Integral, Real

import numpy as np
from past.types.basestring import basestring

from odl.util import (
is_int_dtype, is_real_dtype, is_numeric_dtype, unique,
signature_string_parts, repr_string)

is_int_dtype, is_numeric_dtype, is_real_dtype, repr_string,
signature_string_parts, unique)

__all__ = ('Set', 'EmptySet', 'UniversalSet', 'Field', 'Integers',
'RealNumbers', 'ComplexNumbers', 'Strings', 'CartesianProduct',
Expand Down
5 changes: 3 additions & 2 deletions odl/set/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

"""Abstract linear vector spaces."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from builtins import object

import numpy as np

from odl.set.sets import Field, Set, UniversalSet


__all__ = ('LinearSpace', 'UniversalSpace')


Expand Down
32 changes: 16 additions & 16 deletions odl/solvers/functional/default_functionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@

"""Default functionals defined on any space similar to R^n or L^2."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from numbers import Integral

import numpy as np

from odl.solvers.functional.functional import (Functional,
FunctionalQuadraticPerturb)
from odl.space import ProductSpace
from odl.operator import (Operator, ConstantOperator, ZeroOperator,
ScalingOperator, DiagonalOperator, PointwiseNorm)
from odl.operator import (
ConstantOperator, DiagonalOperator, Operator, PointwiseNorm,
ScalingOperator, ZeroOperator)
from odl.solvers.functional.functional import (
Functional, FunctionalQuadraticPerturb)
from odl.solvers.nonsmooth.proximal_operators import (
proximal_l1, proximal_convex_conj_l1,
proximal_l1_l2, proximal_convex_conj_l1_l2,
proximal_l2, proximal_convex_conj_l2, proximal_l2_squared,
proximal_huber,
proximal_const_func, proximal_box_constraint,
proximal_convex_conj_kl, proximal_convex_conj_kl_cross_entropy,
combine_proximals, proximal_convex_conj)
combine_proximals, proximal_box_constraint, proximal_const_func,
proximal_convex_conj, proximal_convex_conj_kl,
proximal_convex_conj_kl_cross_entropy, proximal_convex_conj_l1,
proximal_convex_conj_l1_l2, proximal_convex_conj_l2, proximal_huber,
proximal_l1, proximal_l1_l2, proximal_l2, proximal_l2_squared)
from odl.space import ProductSpace
from odl.ufunc_ops import exp
from odl.util import (
REPR_PRECISION, npy_printoptions, repr_string, signature_string_parts,
conj_exponent, moveaxis)

REPR_PRECISION, conj_exponent, moveaxis, npy_printoptions, repr_string,
signature_string_parts)

__all__ = ('ZeroFunctional', 'ConstantFunctional', 'ScalingFunctional',
'IdentityFunctional',
Expand Down
6 changes: 3 additions & 3 deletions odl/solvers/functional/derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

"""Utilities for computing the gradient and Hessian of functionals."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.solvers.functional.functional import Functional
from odl.operator import Operator
from odl.solvers.functional.functional import Functional
from odl.space.base_tensors import TensorSpace


__all__ = ('NumericalDerivative', 'NumericalGradient',)


Expand Down
6 changes: 3 additions & 3 deletions odl/solvers/functional/example_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

"""Example functionals used in optimization."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.operator import MatrixOperator, Operator
from odl.solvers.functional.functional import Functional
from odl.operator import Operator, MatrixOperator
from odl.space.base_tensors import TensorSpace


__all__ = ('RosenbrockFunctional',)


Expand Down
18 changes: 9 additions & 9 deletions odl/solvers/functional/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.operator.default_ops import ConstantOperator, IdentityOperator
from odl.operator.operator import (
Operator, OperatorComp, OperatorLeftScalarMult, OperatorRightScalarMult,
OperatorRightVectorMult, OperatorSum, OperatorPointwiseProduct)
from odl.operator.default_ops import (IdentityOperator, ConstantOperator)
from odl.solvers.nonsmooth import (proximal_arg_scaling, proximal_translation,
proximal_quadratic_perturbation,
proximal_const_func, proximal_convex_conj)
from odl.util import signature_string, indent

Operator, OperatorComp, OperatorLeftScalarMult, OperatorPointwiseProduct,
OperatorRightScalarMult, OperatorRightVectorMult, OperatorSum)
from odl.solvers.nonsmooth import (
proximal_arg_scaling, proximal_const_func, proximal_convex_conj,
proximal_quadratic_perturbation, proximal_translation)
from odl.util import indent, signature_string

__all__ = ('Functional', 'FunctionalLeftScalarMult',
'FunctionalRightScalarMult', 'FunctionalComp',
Expand Down
5 changes: 3 additions & 2 deletions odl/solvers/iterative/iterative.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

"""Simple iterative type optimization schemes."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from builtins import next

import numpy as np

from odl.operator import IdentityOperator, OperatorComp, OperatorSum
from odl.util import normalized_scalar_param_list


__all__ = ('landweber', 'conjugate_gradient', 'conjugate_gradient_normal',
'gauss_newton', 'kaczmarz')

Expand Down
3 changes: 2 additions & 1 deletion odl/solvers/iterative/statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

"""Maximum Likelihood Expectation Maximization algorithm."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

__all__ = ('mlem', 'osmlem', 'loglikelihood')
Expand Down
4 changes: 2 additions & 2 deletions odl/solvers/nonsmooth/admm.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Alternating Direction method of Multipliers (ADMM) method variants."""

from __future__ import division
from builtins import range

from odl.operator import Operator, OpDomainError
from builtins import range

from odl.operator import OpDomainError, Operator

__all__ = ('admm_linearized',)

Expand Down
2 changes: 1 addition & 1 deletion odl/solvers/nonsmooth/alternating_dual_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
each of the components.
"""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

Expand Down
3 changes: 1 addition & 2 deletions odl/solvers/nonsmooth/douglas_rachford.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

"""Douglas-Rachford splitting algorithm for convex optimization."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from odl.operator import Operator


__all__ = ('douglas_rachford_pd',)


Expand Down
3 changes: 1 addition & 2 deletions odl/solvers/nonsmooth/forward_backward.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

"""Optimization methods based on a forward-backward splitting scheme."""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

from odl.operator import Operator


__all__ = ('forward_backward_pd',)


Expand Down
4 changes: 2 additions & 2 deletions odl/solvers/nonsmooth/primal_dual_hybrid_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
non-smooth convex optimization problems in imaging.
"""

from __future__ import print_function, division, absolute_import
from __future__ import absolute_import, division, print_function

import numpy as np

from odl.operator import Operator


__all__ = ('pdhg',)


Expand Down
Loading

0 comments on commit a9fc714

Please sign in to comment.