Skip to content

Commit ed8b4bb

Browse files
committed
DEP/MAINT: Remove downscale/skimage dependency
Intent is to add back as a well thought out implementation that does not re-introduce skimage Two options are presented in #862 and #863
1 parent f64a4eb commit ed8b4bb

File tree

4 files changed

+0
-86
lines changed

4 files changed

+0
-86
lines changed

WrightTools/data/_data.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import scipy
1717
from scipy.interpolate import griddata, interp1d
18-
from skimage.transform import downscale_local_mean
1918

2019
from .._group import Group
2120
from .. import collection as wt_collection
@@ -894,60 +893,6 @@ def create_variable(
894893
self.attrs["variable_names"] = np.append(self.attrs["variable_names"], name.encode())
895894
return variable
896895

897-
def downscale(self, tup, name=None, parent=None) -> "Data":
898-
"""Down sample the data array using local averaging.
899-
900-
See `skimage.transform.downscale_local_mean`__ for more info.
901-
902-
__ http://scikit-image.org/docs/0.12.x/api/
903-
skimage.transform.html#skimage.transform.downscale_local_mean
904-
905-
Parameters
906-
----------
907-
tup : tuple of ints
908-
The collection of step sizes by which each axis is binned.
909-
Each axis is sliced with step size determined by the tuple.
910-
To keep an axis sampling unchanged, use 1 or None
911-
name : string (optional)
912-
The name of the string. Default is None.
913-
parent : WrightTools Collection instance (optional)
914-
Collection to place the downscaled data object. Default is
915-
None (new parent).
916-
917-
Returns
918-
-------
919-
WrightTools Data instance
920-
New data object with the downscaled channels and axes
921-
922-
See Also
923-
--------
924-
zoom
925-
Zoom the data array using spline interpolation of the requested order.
926-
"""
927-
if name is None:
928-
name = self.natural_name + "_downscaled"
929-
if parent is None:
930-
newdata = Data(name=name)
931-
else:
932-
parent.create_data(name=name)
933-
934-
for channel in self.channels:
935-
name = channel.natural_name
936-
newdata.create_channel(
937-
name=name, values=downscale_local_mean(channel[:], tup), units=channel.units
938-
)
939-
args = []
940-
for i, axis in enumerate(self.axes):
941-
if len(axis.variables) > 1:
942-
raise NotImplementedError("downscale only works with simple axes currently")
943-
variable = axis.variables[0]
944-
name = variable.natural_name
945-
args.append(name)
946-
slices = [slice(None, None, step) for step in tup]
947-
newdata.create_variable(name=name, values=variable[slices], units=variable.units)
948-
newdata.transform(*args)
949-
return newdata
950-
951896
def get_nadir(self, channel=0) -> tuple:
952897
"""Get the coordinates, in units, of the minimum in a channel.
953898
@@ -1932,11 +1877,6 @@ def zoom(self, factor, order=1, verbose=True):
19321877
The order of the spline used to interpolate onto new points.
19331878
verbose : bool (optional)
19341879
Toggle talkback. Default is True.
1935-
1936-
See Also
1937-
--------
1938-
downscale
1939-
Down-sample the data array using local averaging.
19401880
"""
19411881
raise NotImplementedError
19421882
import scipy.ndimage

docs/api/WrightTools.data.Data.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ WrightTools.data.Data
2727
~Data.create_dataset
2828
~Data.create_group
2929
~Data.create_variable
30-
~Data.downscale
3130
~Data.flush
3231
~Data.get
3332
~Data.get_nadir

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def read(fname):
3535
setup_requires=["pytest-runner"],
3636
tests_require=["pytest", "pytest-cov", "sphinx", "sphinx-gallery==0.1.12", "sphinx-rtd-theme"],
3737
install_requires=[
38-
"scikit-image",
3938
"h5py",
4039
"imageio",
4140
"matplotlib>=3.0",

tests/data/downscale.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)