Skip to content

Commit

Permalink
MAINT: re-organize top-level __init__.py a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Kohr committed Aug 17, 2017
1 parent 55201e9 commit 8607432
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions odl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,47 @@
from __future__ import absolute_import

__version__ = '0.6.1.dev0'
__all__ = ('diagnostics', 'discr', 'operator', 'set', 'space', 'solvers',
'tomo', 'trafos', 'util', 'phantom', 'deform', 'ufunc_ops',
'datasets', 'contrib')

# Propagate names defined in __all__ of all submodules into the top-level
# module
__all__ = ('set',
'space',
'operator',
'discr',
'contrib',
'deform',
'diagnostics',
'phantom',
'solvers',
'tomo',
'trafos',
'ufunc_ops',
'util',
)

# Propagate names defined in` __all__` of all "core" subpackages into
# the top-level namespace
from .set import *
__all__ += set.__all__

# operator must come before space because fspace imports Operator
from .operator import *
__all__ += operator.__all__

from .space import *
__all__ += space.__all__

from .operator import *
__all__ += operator.__all__

from .discr import *
__all__ += discr.__all__

from . import datasets
# More "advanced" subpackages keep their namespaces separate from top-level,
# we only import the modules themselves
from . import contrib
from . import deform
from . import diagnostics
from . import phantom
from . import solvers
from . import tomo
from . import trafos
from . import ufunc_ops
from . import contrib

from . import util

# Add `test` function to global namespace so users can run `odl.test()`
from .util import test
__all__ += ('test',)

0 comments on commit 8607432

Please sign in to comment.