Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into issue-57__operator
Browse files Browse the repository at this point in the history
  • Loading branch information
kohr-h committed Dec 18, 2015
2 parents 2530344 + 62c7353 commit ae380bd
Show file tree
Hide file tree
Showing 34 changed files with 2,596 additions and 684 deletions.
5 changes: 4 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ omit =
odl/diagnostics/*
odl/util/*

# Omit untill coveralls supports cuda.
# Omit until coveralls supports cuda.
odl/space/cu_ntuples.py

# Omit until coveralls supports pywt.
odl/trafos/wavelet.py

[report]
# Regexes for lines to exclude from consideration
Expand Down
8 changes: 6 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@
from future import standard_library
standard_library.install_aliases()

from odl import CUDA_AVAILABLE
from odl.space.cu_ntuples import CUDA_AVAILABLE
from odl.trafos.wavelet import PYWAVELETS_AVAILABLE

collect_ignore = ['setup.py', 'run_tests.py']

if not CUDA_AVAILABLE:
collect_ignore.append('odl/space/cu_ntuples.py')
#collect_ignore.append('test/space/cu_ntuples_test.py')
if not PYWAVELETS_AVAILABLE:
collect_ignore.append('odl/trafos/wavelet.py')
44 changes: 33 additions & 11 deletions doc/source/generate_doc.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import pkgutil
import odl
import inspect
import importlib
import sys


__all__ = ('make_interface',)

module_string = """
.. rubric:: Modules
.. toctree::
:maxdepth: 2
{}
"""

fun_string = """
Functions
---------
.. rubric:: Functions
.. autosummary::
:toctree: generated/
Expand All @@ -24,8 +24,7 @@
"""

class_string = """
Classes
-------
.. rubric:: Classes
.. autosummary::
:toctree: generated/
Expand All @@ -46,18 +45,41 @@
"""


def make_interface():
def import_submodules(package, name=None, recursive=True):
""" Import all submodules of a module, recursively, including subpackages
"""
if isinstance(package, str):
package = importlib.import_module(package)

if name is None:
name = package.__name__

sys.path.append(odl.__path__)
submodules = [m[0] for m in inspect.getmembers(
package, inspect.ismodule) if m[1].__name__.startswith('odl')]

modnames = [modname for _, modname, _ in pkgutil.walk_packages(
path=odl.__path__, prefix=odl.__name__ + '.', onerror=lambda x: None)]
results = {}
for pkgname in submodules:
full_name = name + '.' + pkgname
try:
results[full_name] = importlib.import_module(full_name)
if recursive:
results.update(import_submodules(full_name, full_name))
except ImportError:
pass
return results


def make_interface():
modnames = [modname for modname in import_submodules(odl)]

modnames += ['odl']

for modname in modnames:
if not modname.startswith('odl'):
modname = 'odl.' + modname

shortmodname = modname.split('.')[-1]
print('generated: ' + modname + '.rst')
print('{: <16} : generated {}.rst'.format(shortmodname, modname))

line = '=' * len(shortmodname)

Expand Down
11 changes: 4 additions & 7 deletions doc/source/guide/introduction/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ If you have done any step before, you can ofc skip it.

Install Python
==============
To begin with, you need a python distribution. If you are an experienced user, you can use any distribution you'd like. If you are a python novice, we recommend that you install a full package such as Anaconda.
To begin with, you need a python distribution. If you are an experienced user, you can use any distribution you'd like.

Anaconda
--------
To install Anaconda
If you are a python novice using Windows, we recommend that you install a full package such as Anaconda. To install Anaconda

1. Download Anaconda from `anaconda's webpage <https://www.continuum.io/downloads>`_
2. Once installed run in a console
Expand All @@ -28,7 +28,6 @@ To install Anaconda

Install Git
===========

You also need to install Git to be able to download odl.

Overview
Expand All @@ -46,7 +45,6 @@ OS X Use the git-osx-installer_

In detail
---------

See the git page for the most recent information.

Have a look at the github install help pages available from `github help`_
Expand All @@ -57,7 +55,6 @@ There are good instructions here: http://book.git-scm.com/2_installing_git.html

Install ODL
===========

You are now ready to install ODL! To do that, run the following where you want to install it

``git clone https://github.com/odlgroup/odl``
Expand All @@ -67,11 +64,11 @@ You are now ready to install ODL! To do that, run the following where you want t

For installation in a local user folder run

``user$ pip install --user .``
``user$ pip install --user -e .``

For system-wide installation, run (as root, e.g. using ``sudo`` or equivalent)

``root# pip install .``
``root# pip install -e .``

(Optional) Install ODLpp
========================
Expand Down
38 changes: 0 additions & 38 deletions examples/visualize_phantoms.py

This file was deleted.

3 changes: 0 additions & 3 deletions odl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,5 @@
__all__ += space.__all__

from . import trafos
from .trafos import *
__all__ += trafos.__all__

from . import solvers
from . import tomo
2 changes: 2 additions & 0 deletions odl/diagnostics/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with ODL. If not, see <http://www.gnu.org/licenses/>.

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

# Imports for common Python 2/3 codebase
from __future__ import print_function, division, absolute_import
from future import standard_library
Expand Down
2 changes: 2 additions & 0 deletions odl/diagnostics/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with ODL. If not, see <http://www.gnu.org/licenses/>.

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

# Imports for common Python 2/3 codebase
from __future__ import print_function, division, absolute_import
from future import standard_library
Expand Down
2 changes: 2 additions & 0 deletions odl/diagnostics/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with ODL. If not, see <http://www.gnu.org/licenses/>.

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

# Imports for common Python 2/3 codebase
from __future__ import print_function, division, absolute_import
from future import standard_library
Expand Down
Loading

0 comments on commit ae380bd

Please sign in to comment.