Source code for geetools.tools._deprecated_ee_list
"""Legacy tools for the ee.List class."""
import ee
from deprecated.sphinx import deprecated
@deprecated(version="1.0.0", reason="Use ee.List.geetools.complement instead")
[docs]
def difference(list1, list2):
"""Return the difference between two lists."""
return ee.List(list1).geetools.complement(list2)
@deprecated(version="1.0.0", reason="Use ee.List.geetools.product instead")
[docs]
def intersection(list1, list2):
"""Return the intersection between two lists."""
return ee.List(list1).geetools.intersection(list2)
@deprecated(version="1.0.0", reason="Use ee.List.distinct instead")
[docs]
def removeDuplicates(list):
"""Remove duplicates from a list."""
return ee.List(list).distinct()
@deprecated(version="1.0.0", reason="Use ee.List.geetools.delete instead")
[docs]
def removeIndex(list, index):
"""Remove an element from a list by index."""
return ee.List(list).geetools.delete(index)
@deprecated(version="1.0.0", reason="Use ee.List.geetools.sequence instead")
[docs]
def sequence(start, stop, step=1):
"""Create a sequence of numbers."""
return ee.List.geetools.sequence(start, stop, step)
@deprecated(version="1.0.0", reason="Use ee.List.geetools.replaceMany instead")
[docs]
def replaceDict(eelist, to_replace):
"""Replace many elements of a Earth Engine List object using a dictionary."""
return ee.List(eelist).geetools.replaceMany(to_replace)
@deprecated(version="1.0.0", reason="Use ee.List.geetools.toStrings instead")
[docs]
def toString(eelist):
"""Convert elements of a list into Strings."""
return ee.List(eelist).geetools.toStrings()
@deprecated(version="1.0.0", reason="Use ee.List.geetools.format instead")
@deprecated(version="1.0.0", reason="Use ee.Dictionary.geetools.getMany instead")
[docs]
def getFromDict(eelist, values):
"""Get a list of Dict's values from a list object."""
return ee.Dictionary(values).geetools.getMany(eelist)
@deprecated(version="1.0.0", reason="Cast the list to ee.Array instead")
[docs]
def transpose(eelist):
"""Transpose a list of lists."""
return ee.Array(eelist).transpose()
@deprecated(version="1.0.0", reason="Use ee.List.geetools.zip instead")
[docs]
def zip(eelist):
"""Zip a list of lists."""
return ee.List(eelist).geetools.zip()