Skip to content

Commit

Permalink
moved data_dir to within data/__init__.py (scikit-image#3161)
Browse files Browse the repository at this point in the history
* moved data_dir to within `data/__init__.py`
* "Fix" the circular dependency.
  • Loading branch information
hmaarrfk authored and jni committed Jun 9, 2018
1 parent fede57a commit 637db10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions skimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,11 @@
"""

import os.path as osp
import imp
import functools
import warnings
import sys

pkg_dir = osp.abspath(osp.dirname(__file__))
data_dir = osp.join(pkg_dir, 'data')

__version__ = '0.15.dev0'

Expand Down Expand Up @@ -133,6 +130,7 @@ def _raise_build_error(e):
except ImportError as e:
_raise_build_error(e)
from .util.dtype import *
from .data import data_dir


def lookfor(what):
Expand All @@ -149,4 +147,4 @@ def lookfor(what):
return np.lookfor(what, sys.modules[__name__])


del warnings, functools, osp, imp, sys
del warnings, functools, imp, sys
9 changes: 6 additions & 3 deletions skimage/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@

import numpy as _np

from .. import data_dir
from ..io import imread, use_plugin
from .._shared._warnings import expected_warnings, warn
from .. import img_as_bool
from ..util.dtype import img_as_bool
from ._binary_blobs import binary_blobs

__all__ = ['load',
import os.path as osp
data_dir = osp.abspath(osp.dirname(__file__))

__all__ = ['data_dir',
'load',
'astronaut',
'binary_blobs',
'camera',
Expand Down

0 comments on commit 637db10

Please sign in to comment.