Skip to content

Commit

Permalink
Remove deprecated code (#1621)
Browse files Browse the repository at this point in the history
1. MaxProject filter.  Deprecated since 0.1.2 (june 19)
2. remove `enable_inplace_mode`.  Deprecated since 0.1.4 (july 17)
3. remove `FieldOfView.show_aligned_image_groups` and `FieldOfView.iterate_image_type`.  Deprecated since 0.1.4 (july 17)
  • Loading branch information
Tony Tung authored Oct 24, 2019
1 parent c2e5644 commit 421ad08
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 112 deletions.
10 changes: 0 additions & 10 deletions starfish/core/experiment/builder/inplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


import abc
import warnings
from pathlib import Path
from typing import Mapping, Optional

Expand All @@ -32,15 +31,6 @@ def write_tile(
return tile.provider.sha256


def enable_inplace_mode():
"""
.. deprecated:: 0.1.4
This method is no longer necessary. Call `write_experiment_json` with
`writer_contract=InplaceWriterContract()`.
"""
warnings.warn("`enable_inplace_mode()` is no longer necessary.", DeprecationWarning)


class InplaceFetchedTile(FetchedTile):
"""Data formatters that operate in-place should return tiles that extend this class."""
@property
Expand Down
21 changes: 2 additions & 19 deletions starfish/core/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class FieldOfView:
The decoding of :py:class:`~slicedimage.TileSet` to
:py:class:`~starfish.imagestack.imagestack.ImageStack`
does not happen until the image is accessed. ImageStacks can only be initialized with
aligned tilesets, so if thereare multiple you may need to iterate through the groups
using :py:func:`~starfish.experiment.experiment.FieldOfView.iterate_image_type`
aligned tilesets, so if there are multiple you may need to iterate through the groups
using :py:func:`~starfish.experiment.experiment.FieldOfView.get_images`
and process each one individually.
Be prepared to handle errors when images are accessed.
Expand Down Expand Up @@ -100,23 +100,6 @@ def name(self) -> str:
def image_types(self) -> Set[str]:
return set(self._images.keys())

def show_aligned_image_groups(self) -> None:
"""
.. deprecated:: 0.1.4
Use `FieldOfView.get_images()` to retrieve all the aligned image groups.
"""
raise DeprecationWarning("This method has been deprecated. Aligned groups are now parsed "
"as a part of, FieldOfView.get_images() and are determined by the "
"selected axes provided to the method.")

def iterate_image_type(self, image_type: str) -> Iterator[ImageStack]:
"""
.. deprecated:: 0.1.4
Use `FieldOfView.get_images()` to retrieve all the aligned image groups.
"""
raise DeprecationWarning("This method has been deprecated. Instead use "
"FieldOfView.get_images(image_type)")

def get_image(self, item: str,
aligned_group: Any = _SINGLETON,
rounds: Optional[Collection[int]] = None,
Expand Down
1 change: 0 additions & 1 deletion starfish/core/image/Filter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from .linear_unmixing import LinearUnmixing
from .map import Map
from .match_histograms import MatchHistograms
from .max_proj import MaxProject
from .mean_high_pass import MeanHighPass
from .reduce import Reduce
from .richardson_lucy_deconvolution import DeconvolvePSF
Expand Down
78 changes: 0 additions & 78 deletions starfish/core/image/Filter/max_proj.py

This file was deleted.

4 changes: 1 addition & 3 deletions starfish/core/image/Filter/test/test_api_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from starfish import ImageStack
from starfish.core.image import Filter
from starfish.core.image.Filter.max_proj import MaxProject
from starfish.core.image.Filter.reduce import Reduce


Expand All @@ -35,7 +34,6 @@
'guassian_high_pass': Filter.GaussianHighPass,
'guassian_low_pass': Filter.GaussianLowPass,
'laplace': Filter.Laplace,
'max_proj': Filter.MaxProject,
'mean_high_pass': Filter.MeanHighPass,
'reduce': Filter.Reduce,
'deconvolve': Filter.DeconvolvePSF,
Expand Down Expand Up @@ -72,7 +70,7 @@ def test_all_methods_adhere_to_contract(filter_class):

# Max Proj and Reduce don't have an in_place, n_processes, verbose option,
# so we need to skip these tests
if filter_class not in [MaxProject, Reduce]:
if filter_class not in [Reduce]:
# return None if in_place = True
try:
filtered = instance.run(data, in_place=True)
Expand Down
3 changes: 2 additions & 1 deletion starfish/core/imagestack/imagestack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,8 @@ def max_proj(self, *dims: Axes) -> "ImageStack":
This method is deprecated. Please ``ImageStack.reduce(axes, func="max")`` to do max
projection operations.
"""
raise DeprecatedAPIError("Please Filter.MaxProject to do max projection operations.")
raise DeprecatedAPIError(
"""Please ImageStack.reduce(axes, func="max") to do max projection operations.""")

def _squeezed_numpy(self, *dims: Axes):
"""return this ImageStack's data as a squeezed numpy array"""
Expand Down

0 comments on commit 421ad08

Please sign in to comment.