Skip to content

Commit

Permalink
BLD: Remove pims dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nkeim committed Apr 14, 2018
1 parent 72a46b8 commit 0c18d26
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 45 deletions.
2 changes: 0 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ requirements:
- numpy
- pandas
- scipy
- pims
- matplotlib
- mock # patching https://github.com/matplotlib/matplotlib/pull/4188
- nose # patching https://github.com/matplotlib/matplotlib/pull/4188
Expand All @@ -32,7 +31,6 @@ requirements:
- numexpr # required for pandas DataFrame.query, used in examples
- scipy >=0.12.0
- matplotlib
- pims >=0.2.2
- numba >=0.13.4
- pytables

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
author_email = "[email protected]",
url = "https://github.com/soft-matter/trackpy",
install_requires = ['numpy>=1.8', 'scipy>=0.12', 'six>=1.8',
'pandas>=0.13', 'pims>=0.4.1',
'pandas>=0.13',
'pyyaml', 'matplotlib'],
packages = ['trackpy', 'trackpy.refine', 'trackpy.linking'],
long_description = descr,
Expand Down
23 changes: 0 additions & 23 deletions trackpy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,3 @@
from . import artificial
from .utils import handle_logging, ignore_logging, quiet
from .try_numba import try_numba_autojit, enable_numba, disable_numba


# pims import is deprecated. We include it here for backwards
# compatibility, but there will be warnings.
import pims as _pims


def _deprecate_pims(call):
"""Wrap a pims callable with a warning that it is deprecated."""
def deprecated_pims_import(*args, **kw):
"""Class imported from pims package. Its presence in trackpy is deprecated."""
warnings.warn(('trackpy.{0} is being called, but "{0}" is really part of the '
'pims package. It will not be in future versions of trackpy. '
'Consider importing pims and calling pims.{0} instead.'
).format(call.__name__), UserWarning)
return call(*args, **kw)
return deprecated_pims_import


ImageSequence = _deprecate_pims(_pims.ImageSequence)
Video = _deprecate_pims(_pims.Video)
TiffStack = _deprecate_pims(_pims.TiffStack)

19 changes: 0 additions & 19 deletions trackpy/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,6 @@ def test_dependencies(self):
trackpy.diag.dependencies()


class APITests(StrictTestCase):
def test_pims_deprecation(self):
"""Using a pims class should work, but generate a warning.
The inclusion of these classes (and therefore this test) in
trackpy is deprecated as of v0.3 and will be removed in a future
version."""
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('ignore')
warnings.simplefilter('always', UserWarning)
imseq = trackpy.ImageSequence(os.path.join(path, 'video/image_sequence/*.png'))
assert isinstance(imseq, pims.ImageSequence)
if len(w) != 1:
print('Caught warnings:')
for wrn in w:
print(wrn, wrn.message)
assert len(w) == 1


class LoggerTests(StrictTestCase):
def test_heirarchy(self):
self.assertTrue(trackpy.linking.logger.parent is trackpy.logger)
Expand Down

0 comments on commit 0c18d26

Please sign in to comment.