From b9b6dc726ab24457e2c506b7f682bfdb903a0254 Mon Sep 17 00:00:00 2001 From: Kurt Schwehr Date: Tue, 6 Aug 2024 07:42:49 -0700 Subject: [PATCH] Remove quotes around return types of methods. PiperOrigin-RevId: 659951534 --- python/ee/dictionary.py | 2 +- python/ee/ee_array.py | 210 ++++++++++++++++++++-------------------- python/ee/ee_list.py | 48 ++++----- python/ee/ee_number.py | 172 ++++++++++++++++---------------- python/ee/ee_string.py | 14 +-- 5 files changed, 223 insertions(+), 223 deletions(-) diff --git a/python/ee/dictionary.py b/python/ee/dictionary.py index d5da56c36..3a4f82e1e 100644 --- a/python/ee/dictionary.py +++ b/python/ee/dictionary.py @@ -133,7 +133,7 @@ def contains(self, key: _StringType) -> computedobject.ComputedObject: # TODO: keys should be a _StringListType. @staticmethod - def fromLists(keys: _ListType, values: _ListType) -> 'Dictionary': + def fromLists(keys: _ListType, values: _ListType) -> Dictionary: """Returns a dictionary from two parallel lists of keys and values. Args: diff --git a/python/ee/ee_array.py b/python/ee/ee_array.py index dd15e5452..ae5c3185e 100644 --- a/python/ee/ee_array.py +++ b/python/ee/ee_array.py @@ -97,7 +97,7 @@ def reset(cls) -> None: def name() -> str: return 'Array' - def abs(self) -> 'Array': + def abs(self) -> Array: """On an element-wise basis, computes the absolute value of the input.""" return apifunction.ApiFunction.call_(self.name() + '.abs', self) @@ -105,7 +105,7 @@ def abs(self) -> 'Array': # TODO: Use _ReducerType for reducer. def accum( self, axis: _IntegerType, reducer: Optional[_EeAnyType] = None - ) -> 'Array': + ) -> Array: """Accumulates elements of an array along the given axis. Sets each element of the result to the reduction of elements along that axis @@ -127,12 +127,12 @@ def accum( self.name() + '.accum', self, axis, reducer ) - def acos(self) -> 'Array': + def acos(self) -> Array: """Computes the arccosine in radians of the input.""" return apifunction.ApiFunction.call_(self.name() + '.acos', self) - def add(self, right: _ArrayType) -> 'Array': + def add(self, right: _ArrayType) -> Array: """On an element-wise basis, adds the first value to the second. Args: @@ -144,7 +144,7 @@ def add(self, right: _ArrayType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.add', self, right) - def And(self, right: _ArrayType) -> 'Array': + def And(self, right: _ArrayType) -> Array: """Returns 1 if both values are non-zero. Args: @@ -168,17 +168,17 @@ def argmax(self) -> ee_list.List: return apifunction.ApiFunction.call_(self.name() + '.argmax', self) - def asin(self) -> 'Array': + def asin(self) -> Array: """Computes the arcsine in radians of the input.""" return apifunction.ApiFunction.call_(self.name() + '.asin', self) - def atan(self) -> 'Array': + def atan(self) -> Array: """Computes the arctangent in radians of the input.""" return apifunction.ApiFunction.call_(self.name() + '.atan', self) - def atan2(self, right: _ArrayType) -> 'Array': + def atan2(self, right: _ArrayType) -> Array: """Calculates the angle formed by the 2D vector [x, y]. Args: @@ -190,7 +190,7 @@ def atan2(self, right: _ArrayType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.atan2', self, right) - def bitCount(self) -> 'Array': + def bitCount(self) -> Array: """Calculates the number of one-bits. Uses a 64-bit two's complement binary representation of the input. @@ -201,7 +201,7 @@ def bitCount(self) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.bitCount', self) - def bitsToArray(input: _IntegerType) -> 'Array': + def bitsToArray(input: _IntegerType) -> Array: """Returns an Array from the bits of an integer. The array has as many elements as the position of the highest set bit, or a @@ -213,7 +213,7 @@ def bitsToArray(input: _IntegerType) -> 'Array': return apifunction.ApiFunction.call_('Array.bitsToArray', input) - def bitwiseAnd(self, right: _ArrayType) -> 'Array': + def bitwiseAnd(self, right: _ArrayType) -> Array: """On an element-wise basis, calculates the bitwise AND of the input values. Args: @@ -227,7 +227,7 @@ def bitwiseAnd(self, right: _ArrayType) -> 'Array': self.name() + '.bitwiseAnd', self, right ) - def bitwiseNot(self) -> 'Array': + def bitwiseNot(self) -> Array: """On an element-wise basis, calculates the bitwise NOT of the input. In the smallest signed integer type that can hold the input. @@ -238,7 +238,7 @@ def bitwiseNot(self) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.bitwiseNot', self) - def bitwiseOr(self, right: _ArrayType) -> 'Array': + def bitwiseOr(self, right: _ArrayType) -> Array: """On an element-wise basis, calculates the bitwise OR of the input values. Args: @@ -252,7 +252,7 @@ def bitwiseOr(self, right: _ArrayType) -> 'Array': self.name() + '.bitwiseOr', self, right ) - def bitwiseXor(self, right: _ArrayType) -> 'Array': + def bitwiseXor(self, right: _ArrayType) -> Array: """On an element-wise basis, calculates the bitwise XOR of the input values. Args: @@ -266,13 +266,13 @@ def bitwiseXor(self, right: _ArrayType) -> 'Array': self.name() + '.bitwiseXor', self, right ) - def byte(self) -> 'Array': + def byte(self) -> Array: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.byte', self) @staticmethod - def cat(arrays: _ListType, axis: Optional[_IntegerType] = None) -> 'Array': + def cat(arrays: _ListType, axis: Optional[_IntegerType] = None) -> Array: """Returns an Array that is the concatenation of the given arrays. Concatenates multiple arrays into a single array along the given axis. Each @@ -286,27 +286,27 @@ def cat(arrays: _ListType, axis: Optional[_IntegerType] = None) -> 'Array': return apifunction.ApiFunction.call_('Array.cat', arrays, axis) - def cbrt(self) -> 'Array': + def cbrt(self) -> Array: """On an element-wise basis, computes the cubic root of the input.""" return apifunction.ApiFunction.call_(self.name() + '.cbrt', self) - def ceil(self) -> 'Array': + def ceil(self) -> Array: """Computes the smallest integer greater than or equal to the input.""" return apifunction.ApiFunction.call_(self.name() + '.ceil', self) - def cos(self) -> 'Array': + def cos(self) -> Array: """On an element-wise basis, computes the cosine of the input in radians.""" return apifunction.ApiFunction.call_(self.name() + '.cos', self) - def cosh(self) -> 'Array': + def cosh(self) -> Array: """On an element-wise basis, computes the hyperbolic cosine of the input.""" return apifunction.ApiFunction.call_(self.name() + '.cosh', self) - def cut(self, position: _ListType) -> 'Array': + def cut(self, position: _ListType) -> Array: """Cut an array along one or more axes. Args: @@ -322,12 +322,12 @@ def cut(self, position: _ListType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.cut', self, position) - def digamma(self) -> 'Array': + def digamma(self) -> Array: """On an element-wise basis, computes the digamma function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.digamma', self) - def divide(self, right: _ArrayType) -> 'Array': + def divide(self, right: _ArrayType) -> Array: """Divides the first value by the second, returning 0 for division by 0. Args: @@ -353,12 +353,12 @@ def dotProduct(self, array2: _ArrayType) -> ee_number.Number: self.name() + '.dotProduct', self, array2 ) - def double(self) -> 'Array': + def double(self) -> Array: """On an element-wise basis, casts the input value to a 64-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.double', self) - def eigen(self) -> 'Array': + def eigen(self) -> Array: """Computes the real eigenvectors and eigenvalues of a square 2D array. Returns: @@ -371,7 +371,7 @@ def eigen(self) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.eigen', self) - def eq(self, right: _ArrayType) -> 'Array': + def eq(self, right: _ArrayType) -> Array: """Returns 1 if the first value is equal to the second. Args: @@ -383,32 +383,32 @@ def eq(self, right: _ArrayType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.eq', self, right) - def erf(self) -> 'Array': + def erf(self) -> Array: """On an element-wise basis, computes the error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erf', self) - def erfInv(self) -> 'Array': + def erfInv(self) -> Array: """Computes the inverse error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erfInv', self) - def erfc(self) -> 'Array': + def erfc(self) -> Array: """Computes the complementary error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erfc', self) - def erfcInv(self) -> 'Array': + def erfcInv(self) -> Array: """Computes the inverse complementary error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erfcInv', self) - def exp(self) -> 'Array': + def exp(self) -> Array: """Computes Euler's number e raised to the power of the input.""" return apifunction.ApiFunction.call_(self.name() + '.exp', self) - def first(self, right: _ArrayType) -> 'Array': + def first(self, right: _ArrayType) -> Array: """On an element-wise basis, selects the value of the first value. Args: @@ -420,7 +420,7 @@ def first(self, right: _ArrayType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.first', self, right) - def firstNonZero(self, right: _ArrayType) -> 'Array': + def firstNonZero(self, right: _ArrayType) -> Array: """Selects the first value if it is non-zero, otherwise the second value. Args: @@ -435,22 +435,22 @@ def firstNonZero(self, right: _ArrayType) -> 'Array': self.name() + '.firstNonZero', self, right ) - def float(self) -> 'Array': + def float(self) -> Array: """On an element-wise basis, casts the input value to a 32-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.float', self) - def floor(self) -> 'Array': + def floor(self) -> Array: """Computes the largest integer less than or equal to the input.""" return apifunction.ApiFunction.call_(self.name() + '.floor', self) - def gamma(self) -> 'Array': + def gamma(self) -> Array: """On an element-wise basis, computes the gamma function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.gamma', self) - def gammainc(self, right: _EeAnyType) -> 'Array': + def gammainc(self, right: _EeAnyType) -> Array: """Calculates the regularized lower incomplete Gamma function γ(x,a). Args: @@ -474,7 +474,7 @@ def get(self, position: _EeAnyType) -> ee_number.Number: return apifunction.ApiFunction.call_(self.name() + '.get', self, position) - def gt(self, right: _EeAnyType) -> 'Array': + def gt(self, right: _EeAnyType) -> Array: """Returns 1 if the first value is greater than the second. Args: @@ -486,7 +486,7 @@ def gt(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.gt', self, right) - def gte(self, right: _EeAnyType) -> 'Array': + def gte(self, right: _EeAnyType) -> Array: """Returns 1 if the first value is greater than or equal to the second. Args: @@ -498,7 +498,7 @@ def gte(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.gte', self, right) - def hypot(self, right: _EeAnyType) -> 'Array': + def hypot(self, right: _EeAnyType) -> Array: """Calculates the magnitude of the 2D vector [x, y]. Args: @@ -511,7 +511,7 @@ def hypot(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.hypot', self, right) @staticmethod - def identity(size: _IntegerType) -> 'Array': + def identity(size: _IntegerType) -> Array: """Returns a 2D identity matrix of the given size. Args: @@ -520,37 +520,37 @@ def identity(size: _IntegerType) -> 'Array': return apifunction.ApiFunction.call_('Array.identity', size) - def int(self) -> 'Array': + def int(self) -> Array: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int', self) - def int16(self) -> 'Array': + def int16(self) -> Array: """Casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int16', self) - def int32(self) -> 'Array': + def int32(self) -> Array: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int32', self) - def int64(self) -> 'Array': + def int64(self) -> Array: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int64', self) - def int8(self) -> 'Array': + def int8(self) -> Array: """Casts the input value to a signed 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int8', self) - def lanczos(self) -> 'Array': + def lanczos(self) -> Array: """Computes the Lanczos approximation of the input.""" return apifunction.ApiFunction.call_(self.name() + '.lanczos', self) - def leftShift(self, right: _EeAnyType) -> 'Array': + def leftShift(self, right: _EeAnyType) -> Array: """On an element-wise basis, calculates the left shift of v1 by v2 bits. Args: @@ -564,27 +564,27 @@ def leftShift(self, right: _EeAnyType) -> 'Array': self.name() + '.leftShift', self, right ) - def length(self) -> 'Array': + def length(self) -> Array: """Returns a 1-D ee.Array containing the length of each dimension.""" return apifunction.ApiFunction.call_(self.name() + '.length', self) - def log(self) -> 'Array': + def log(self) -> Array: """On an element-wise basis, computes the natural logarithm of the input.""" return apifunction.ApiFunction.call_(self.name() + '.log', self) - def log10(self) -> 'Array': + def log10(self) -> Array: """On an element-wise basis, computes the base-10 logarithm of the input.""" return apifunction.ApiFunction.call_(self.name() + '.log10', self) - def long(self) -> 'Array': + def long(self) -> Array: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.long', self) - def lt(self, right: _EeAnyType) -> 'Array': + def lt(self, right: _EeAnyType) -> Array: """Returns 1 if the first value is less than the second. Args: @@ -596,7 +596,7 @@ def lt(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.lt', self, right) - def lte(self, right: _EeAnyType) -> 'Array': + def lte(self, right: _EeAnyType) -> Array: """Returns 1 if the first value is less than or equal to the second. Args: @@ -608,7 +608,7 @@ def lte(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.lte', self, right) - def mask(self, mask: _EeAnyType) -> 'Array': + def mask(self, mask: _EeAnyType) -> Array: """Creates an array of just the elements that have non-zero mask matches. Creates a subarray by slicing out each position in an input array that is @@ -645,7 +645,7 @@ def matrixDeterminant(self) -> ee_number.Number: self.name() + '.matrixDeterminant', self ) - def matrixDiagonal(self) -> 'Array': + def matrixDiagonal(self) -> Array: """Computes the diagonal of the matrix in a single column.""" return apifunction.ApiFunction.call_(self.name() + '.matrixDiagonal', self) @@ -655,7 +655,7 @@ def matrixFnorm(self) -> ee_number.Number: return apifunction.ApiFunction.call_(self.name() + '.matrixFnorm', self) - def matrixInverse(self) -> 'Array': + def matrixInverse(self) -> Array: """Computes the inverse of the matrix.""" return apifunction.ApiFunction.call_(self.name() + '.matrixInverse', self) @@ -678,7 +678,7 @@ def matrixLUDecomposition(self) -> dictionary.Dictionary: self.name() + '.matrixLUDecomposition', self ) - def matrixMultiply(self, right: _EeAnyType) -> 'Array': + def matrixMultiply(self, right: _EeAnyType) -> Array: """Returns the matrix multiplication A * B. Args: @@ -692,7 +692,7 @@ def matrixMultiply(self, right: _EeAnyType) -> 'Array': self.name() + '.matrixMultiply', self, right ) - def matrixPseudoInverse(self) -> 'Array': + def matrixPseudoInverse(self) -> Array: """Computes the Moore-Penrose pseudoinverse of the matrix.""" return apifunction.ApiFunction.call_( @@ -729,7 +729,7 @@ def matrixSingularValueDecomposition(self) -> dictionary.Dictionary: self.name() + '.matrixSingularValueDecomposition', self ) - def matrixSolve(self, right: _EeAnyType) -> 'Array': + def matrixSolve(self, right: _EeAnyType) -> Array: """Returns the least-squares solution of the input matrix. Solves for x in the matrix equation A * x = B, finding a least-squares @@ -746,7 +746,7 @@ def matrixSolve(self, right: _EeAnyType) -> 'Array': self.name() + '.matrixSolve', self, right ) - def matrixToDiag(self) -> 'Array': + def matrixToDiag(self) -> Array: """Computes a square diagonal matrix from a single column matrix.""" return apifunction.ApiFunction.call_(self.name() + '.matrixToDiag', self) @@ -760,7 +760,7 @@ def matrixTranspose( self, axis1: Optional[_IntegerType] = None, axis2: Optional[_IntegerType] = None, - ) -> 'Array': + ) -> Array: """Transposes two dimensions of an array. Args: @@ -775,7 +775,7 @@ def matrixTranspose( self.name() + '.matrixTranspose', self, axis1, axis2 ) - def max(self, right: _EeAnyType) -> 'Array': + def max(self, right: _EeAnyType) -> Array: """Selects the maximum of the first and second values. Args: @@ -787,7 +787,7 @@ def max(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.max', self, right) - def min(self, right: _EeAnyType) -> 'Array': + def min(self, right: _EeAnyType) -> Array: """Selects the minimum of the first and second values. Args: @@ -799,7 +799,7 @@ def min(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.min', self, right) - def mod(self, right: _EeAnyType) -> 'Array': + def mod(self, right: _EeAnyType) -> Array: """Calculates the remainder of the first value divided by the second. Args: @@ -811,7 +811,7 @@ def mod(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.mod', self, right) - def multiply(self, right: _EeAnyType) -> 'Array': + def multiply(self, right: _EeAnyType) -> Array: """On an element-wise basis, multiplies the first value by the second. Args: @@ -823,7 +823,7 @@ def multiply(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.multiply', self, right) - def neq(self, right: _EeAnyType) -> 'Array': + def neq(self, right: _EeAnyType) -> Array: """Returns 1 if the first value is not equal to the second. Args: @@ -835,12 +835,12 @@ def neq(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.neq', self, right) - def Not(self) -> 'Array': + def Not(self) -> Array: """Returns 0 if the input is non-zero, and 1 otherwise.""" return apifunction.ApiFunction.call_(self.name() + '.not', self) - def Or(self, right: _EeAnyType) -> 'Array': + def Or(self, right: _EeAnyType) -> Array: """On an element-wise basis, returns 1 if either input value is non-zero. Args: @@ -854,7 +854,7 @@ def Or(self, right: _EeAnyType) -> 'Array': def pad( self, lengths: _EeAnyType, pad: Optional[_NumberType] = None - ) -> 'Array': + ) -> Array: """Pad an array to a given length. The pad value will be repeatedly appended to the array to extend it to given @@ -873,7 +873,7 @@ def pad( self.name() + '.pad', self, lengths, pad ) - def pow(self, right: _EeAnyType) -> 'Array': + def pow(self, right: _EeAnyType) -> Array: """On an element-wise basis, raises the first value to the power of the second. Args: @@ -885,7 +885,7 @@ def pow(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.pow', self, right) - def project(self, axes: _EeAnyType) -> 'Array': + def project(self, axes: _EeAnyType) -> Array: """Returns the projected array. Projects an array to a lower dimensional space by specifying the axes to @@ -907,7 +907,7 @@ def reduce( axes: _EeAnyType, # pylint: disable-next=invalid-name fieldAxis: Optional[_IntegerType] = None, - ) -> 'Array': + ) -> Array: """Returns the result of applying the reducer on the array. Apply a reducer to an array by collapsing all the input values along each @@ -946,7 +946,7 @@ def repeat( self, axis: Optional[_IntegerType] = None, copies: Optional[_IntegerType] = None, - ) -> 'Array': + ) -> Array: """Repeats the array along the given axis. The result will have the shape of the input, except length along the @@ -965,7 +965,7 @@ def repeat( self.name() + '.repeat', self, axis, copies ) - def reshape(self, shape: _EeAnyType) -> 'Array': + def reshape(self, shape: _EeAnyType) -> Array: """Reshapes an array to a new list of dimension lengths. Args: @@ -980,7 +980,7 @@ def reshape(self, shape: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.reshape', self, shape) - def rightShift(self, right: _EeAnyType) -> 'Array': + def rightShift(self, right: _EeAnyType) -> Array: """Calculates the signed right shift of v1 by v2 bits. Args: @@ -994,17 +994,17 @@ def rightShift(self, right: _EeAnyType) -> 'Array': self.name() + '.rightShift', self, right ) - def round(self) -> 'Array': + def round(self) -> Array: """On an element-wise basis, computes the integer nearest to the input.""" return apifunction.ApiFunction.call_(self.name() + '.round', self) - def short(self) -> 'Array': + def short(self) -> Array: """On an element-wise basis, casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.short', self) - def signum(self) -> 'Array': + def signum(self) -> Array: """Returns -1 or 1 base on the sign of the input or 0 if the input is zero. On an element-wise basis, computes the signum function (sign) of the input; @@ -1017,12 +1017,12 @@ def signum(self) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.signum', self) - def sin(self) -> 'Array': + def sin(self) -> Array: """On an element-wise basis, computes the sine of the input in radians.""" return apifunction.ApiFunction.call_(self.name() + '.sin', self) - def sinh(self) -> 'Array': + def sinh(self) -> Array: """On an element-wise basis, computes the hyperbolic sine of the input.""" return apifunction.ApiFunction.call_(self.name() + '.sinh', self) @@ -1033,7 +1033,7 @@ def slice( start: Optional[_IntegerType] = None, end: Optional[_IntegerType] = None, step: Optional[_IntegerType] = None, - ) -> 'Array': + ) -> Array: """Returns the result of slicing the array along the given axis. Creates a subarray by slicing out each position along the given axis from @@ -1069,7 +1069,7 @@ def slice( self.name() + '.slice', self, axis, start, end, step ) - def sort(self, keys: Optional[_EeAnyType] = None) -> 'Array': + def sort(self, keys: Optional[_EeAnyType] = None) -> Array: """Sorts elements of the array along one axis. Args: @@ -1083,12 +1083,12 @@ def sort(self, keys: Optional[_EeAnyType] = None) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.sort', self, keys) - def sqrt(self) -> 'Array': + def sqrt(self) -> Array: """On an element-wise basis, computes the square root of the input.""" return apifunction.ApiFunction.call_(self.name() + '.sqrt', self) - def subtract(self, right: _EeAnyType) -> 'Array': + def subtract(self, right: _EeAnyType) -> Array: """On an element-wise basis, subtracts the second value from the first. Args: @@ -1100,52 +1100,52 @@ def subtract(self, right: _EeAnyType) -> 'Array': return apifunction.ApiFunction.call_(self.name() + '.subtract', self, right) - def tan(self) -> 'Array': + def tan(self) -> Array: """Computes the tangent of the input in radians.""" return apifunction.ApiFunction.call_(self.name() + '.tan', self) - def tanh(self) -> 'Array': + def tanh(self) -> Array: """Computes the hyperbolic tangent of the input.""" return apifunction.ApiFunction.call_(self.name() + '.tanh', self) - def toByte(self) -> 'Array': + def toByte(self) -> Array: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toByte', self) - def toDouble(self) -> 'Array': + def toDouble(self) -> Array: """On an element-wise basis, casts the input value to a 64-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.toDouble', self) - def toFloat(self) -> 'Array': + def toFloat(self) -> Array: """On an element-wise basis, casts the input value to a 32-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.toFloat', self) - def toInt(self) -> 'Array': + def toInt(self) -> Array: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt', self) - def toInt16(self) -> 'Array': + def toInt16(self) -> Array: """Casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt16', self) - def toInt32(self) -> 'Array': + def toInt32(self) -> Array: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt32', self) - def toInt64(self) -> 'Array': + def toInt64(self) -> Array: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt64', self) - def toInt8(self) -> 'Array': + def toInt8(self) -> Array: """Casts the input value to a signed 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt8', self) @@ -1155,27 +1155,27 @@ def toList(self) -> ee_list.List: return apifunction.ApiFunction.call_(self.name() + '.toList', self) - def toLong(self) -> 'Array': + def toLong(self) -> Array: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toLong', self) - def toShort(self) -> 'Array': + def toShort(self) -> Array: """Casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toShort', self) - def toUint16(self) -> 'Array': + def toUint16(self) -> Array: """Casts the input value to an unsigned 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toUint16', self) - def toUint32(self) -> 'Array': + def toUint32(self) -> Array: """Casts the input value to an unsigned 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toUint32', self) - def toUint8(self) -> 'Array': + def toUint8(self) -> Array: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toUint8', self) @@ -1184,7 +1184,7 @@ def transpose( self, axis1: Optional[_IntegerType] = None, axis2: Optional[_IntegerType] = None, - ) -> 'Array': + ) -> Array: """Transposes two dimensions of an array. Args: @@ -1199,22 +1199,22 @@ def transpose( self.name() + '.transpose', self, axis1, axis2 ) - def trigamma(self) -> 'Array': + def trigamma(self) -> Array: """Computes the trigamma function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.trigamma', self) - def uint16(self) -> 'Array': + def uint16(self) -> Array: """Casts the input value to an unsigned 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.uint16', self) - def uint32(self) -> 'Array': + def uint32(self) -> Array: """Casts the input value to an unsigned 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.uint32', self) - def uint8(self) -> 'Array': + def uint8(self) -> Array: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.uint8', self) diff --git a/python/ee/ee_list.py b/python/ee/ee_list.py index c44af4792..b49e8915c 100644 --- a/python/ee/ee_list.py +++ b/python/ee/ee_list.py @@ -63,7 +63,7 @@ def __init__(self, arg: Optional[_EeListType]): 'Invalid argument specified for ee.List(): %s' % arg) @staticmethod - def repeat(value: _EeAnyType, count: _IntegerType) -> 'List': + def repeat(value: _EeAnyType, count: _IntegerType) -> List: """Returns a new list containing value repeated count times. Args: @@ -78,7 +78,7 @@ def sequence( end: Optional[_NumberType] = None, step: Optional[_NumberType] = None, count: Optional[_IntegerType] = None, - ) -> 'List': + ) -> List: """Returns a List of numbers from start to end (inclusive). Generate a sequence of numbers from start to end (inclusive) in increments @@ -129,7 +129,7 @@ def encode_cloud_value(self, encoder: Optional[Any] = None) -> Any: else: return super().encode_cloud_value(encoder) - def add(self, element: Any) -> 'List': + def add(self, element: Any) -> List: """Appends the element to the end of list. Args: @@ -141,7 +141,7 @@ def add(self, element: Any) -> 'List': return apifunction.ApiFunction.call_(self.name() + '.add', self, element) - def cat(self, other: _EeListType) -> 'List': + def cat(self, other: _EeListType) -> List: """Concatenates the contents of other onto list. Args: @@ -185,7 +185,7 @@ def containsAll(self, other: _EeListType) -> computedobject.ComputedObject: self.name() + '.containsAll', self, other ) - def distinct(self) -> 'List': + def distinct(self) -> List: """Returns a copy of list without duplicate elements.""" return apifunction.ApiFunction.call_(self.name() + '.distinct', self) @@ -203,7 +203,7 @@ def equals(self, other: _EeListType) -> computedobject.ComputedObject: return apifunction.ApiFunction.call_(self.name() + '.equals', self, other) # pylint: disable-next=redefined-builtin - def filter(self, filter: ee_filter.Filter) -> 'List': + def filter(self, filter: ee_filter.Filter) -> List: """Filters a list to only the elements that match the given filter. To filter list items that aren't images or features, test a property @@ -218,7 +218,7 @@ def filter(self, filter: ee_filter.Filter) -> 'List': return apifunction.ApiFunction.call_(self.name() + '.filter', self, filter) - def flatten(self) -> 'List': + def flatten(self) -> List: """Flattens any sublists into a single list.""" return apifunction.ApiFunction.call_(self.name() + '.flatten', self) @@ -350,7 +350,7 @@ def indexOfSublist(self, target: _EeListType) -> ee_number.Number: self.name() + '.indexOfSublist', self, target ) - def insert(self, index: _IntegerType, element: _EeAnyType) -> 'List': + def insert(self, index: _IntegerType, element: _EeAnyType) -> List: """Inserts element at the specified position in list. A negative index counts backwards from the end of the list. @@ -369,7 +369,7 @@ def insert(self, index: _IntegerType, element: _EeAnyType) -> 'List': ) # TODO: Improve the type of `function` - def iterate(self, function: Any, first: _EeAnyType) -> 'List': + def iterate(self, function: Any, first: _EeAnyType) -> List: """Iterate an algorithm over a list. The algorithm is expected to take two objects, the current list item, and @@ -432,7 +432,7 @@ def length(self) -> ee_number.Number: # pylint: disable=invalid-name def map( self, baseAlgorithm: _EeAnyType, dropNulls: _EeBoolType = False - ) -> 'List': + ) -> List: # pylint: enable=invalid-name """Map an algorithm over a list. @@ -469,7 +469,7 @@ def reduce(self, reducer: reducer.Reducer) -> computedobject.ComputedObject: return apifunction.ApiFunction.call_(self.name() + '.reduce', self, reducer) - def remove(self, element: _EeAnyType) -> 'List': + def remove(self, element: _EeAnyType) -> List: """Removes the first occurrence of the specified element from list. Args: @@ -481,7 +481,7 @@ def remove(self, element: _EeAnyType) -> 'List': return apifunction.ApiFunction.call_(self.name() + '.remove', self, element) - def removeAll(self, other: _EeListType) -> 'List': + def removeAll(self, other: _EeListType) -> List: """Removes from list all of the elements that are contained in other list. Args: @@ -495,7 +495,7 @@ def removeAll(self, other: _EeListType) -> 'List': self.name() + '.removeAll', self, other ) - def replace(self, oldval: _EeAnyType, newval: _EeAnyType) -> 'List': + def replace(self, oldval: _EeAnyType, newval: _EeAnyType) -> List: """Replaces the first occurrence of oldval in list with newval. Args: @@ -510,7 +510,7 @@ def replace(self, oldval: _EeAnyType, newval: _EeAnyType) -> 'List': self.name() + '.replace', self, oldval, newval ) - def replaceAll(self, oldval: _EeAnyType, newval: _EeAnyType) -> 'List': + def replaceAll(self, oldval: _EeAnyType, newval: _EeAnyType) -> List: """Replaces all occurrences of oldval in list with newval. Args: @@ -525,12 +525,12 @@ def replaceAll(self, oldval: _EeAnyType, newval: _EeAnyType) -> 'List': self.name() + '.replaceAll', self, oldval, newval ) - def reverse(self) -> 'List': + def reverse(self) -> List: """Reverses the order of the elements in list.""" return apifunction.ApiFunction.call_(self.name() + '.reverse', self) - def rotate(self, distance: _IntegerType) -> 'List': + def rotate(self, distance: _IntegerType) -> List: """Rotates the elements of the list by the specified distance. Elements rotated off the end are pushed onto the other end of the list. @@ -546,7 +546,7 @@ def rotate(self, distance: _IntegerType) -> 'List': self.name() + '.rotate', self, distance ) - def set(self, index: _IntegerType, element: _EeAnyType) -> 'List': + def set(self, index: _IntegerType, element: _EeAnyType) -> List: """Sets the value at the specified position in list. Replaces the value at the specified position in list with element. A @@ -565,7 +565,7 @@ def set(self, index: _IntegerType, element: _EeAnyType) -> 'List': self.name() + '.set', self, index, element ) - def shuffle(self, seed: Optional[_IntegerType] = None) -> 'List': + def shuffle(self, seed: Optional[_IntegerType] = None) -> List: """Randomly permute the specified list. Note that the permutation order will always be the same for any given seed, @@ -592,7 +592,7 @@ def slice( start: _IntegerType, end: Optional[_IntegerType] = None, step: Optional[_IntegerType] = None, - ) -> 'List': + ) -> List: """Returns a range of elements from a list. Negative values for start or end count backwards from the end of the list. @@ -615,7 +615,7 @@ def slice( self.name() + '.slice', self, start, end, step ) - def sort(self, keys: Optional[_EeListType] = None) -> 'List': + def sort(self, keys: Optional[_EeListType] = None) -> List: """Sorts the list into ascending order. If the keys argument is provided, then it is sorted first, and the @@ -636,7 +636,7 @@ def splice( start: _IntegerType, count: _IntegerType, other: Optional[_EeListType] = None, - ) -> 'List': + ) -> List: """Removes elements from list and replaces with elements from other. Args: @@ -653,7 +653,7 @@ def splice( self.name() + '.splice', self, start, count, other ) - def swap(self, pos1: _IntegerType, pos2: _IntegerType) -> 'List': + def swap(self, pos1: _IntegerType, pos2: _IntegerType) -> List: """Swaps the elements at the specified positions. A negative position counts backwards from the end of the list. @@ -670,7 +670,7 @@ def swap(self, pos1: _IntegerType, pos2: _IntegerType) -> 'List': self.name() + '.swap', self, pos1, pos2 ) - def unzip(self) -> 'List': + def unzip(self) -> List: """Rearranges a list of lists. Transposes a list of lists, extracting the first element of each inner list @@ -684,7 +684,7 @@ def unzip(self) -> 'List': return apifunction.ApiFunction.call_(self.name() + '.unzip', self) - def zip(self, other: _EeListType) -> 'List': + def zip(self, other: _EeListType) -> List: """Pairs the elements of two lists to create a list of two-element lists. When the input lists are of different sizes, the final list has the same diff --git a/python/ee/ee_number.py b/python/ee/ee_number.py index 6deb37007..3a6361145 100644 --- a/python/ee/ee_number.py +++ b/python/ee/ee_number.py @@ -85,17 +85,17 @@ def encode_cloud_value(self, encoder: Any = None) -> Any: else: return super().encode_cloud_value(encoder) - def abs(self) -> 'Number': + def abs(self) -> Number: """Computes the absolute value of the input.""" return apifunction.ApiFunction.call_(self.name() + '.abs', self) - def acos(self) -> 'Number': + def acos(self) -> Number: """Computes the arccosine in radians of the input.""" return apifunction.ApiFunction.call_(self.name() + '.acos', self) - def add(self, right: _NumberType) -> 'Number': + def add(self, right: _NumberType) -> Number: """Adds the right value. Args: @@ -108,7 +108,7 @@ def add(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.add', self, right) # `and` is not allowed by the Python parser. - def And(self, right: _NumberType) -> 'Number': + def And(self, right: _NumberType) -> Number: """Returns 1 if and only if both values are non-zero. Args: @@ -120,17 +120,17 @@ def And(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.and', self, right) - def asin(self) -> 'Number': + def asin(self) -> Number: """Computes the arcsine in radians of the input.""" return apifunction.ApiFunction.call_(self.name() + '.asin', self) - def atan(self) -> 'Number': + def atan(self) -> Number: """Computes the arctangent in radians of the input.""" return apifunction.ApiFunction.call_(self.name() + '.atan', self) - def atan2(self, right: _NumberType) -> 'Number': + def atan2(self, right: _NumberType) -> Number: """Calculates the angle in radians formed by the 2D vector [x, y]. Args: @@ -142,7 +142,7 @@ def atan2(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.atan2', self, right) - def bitCount(self) -> 'Number': + def bitCount(self) -> Number: """Returns the number of one-bits in the Number. Calculates the number of one-bits in the 64-bit two's complement binary @@ -154,7 +154,7 @@ def bitCount(self) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.bitCount', self) - def bitwiseAnd(self, right: _NumberType) -> 'Number': + def bitwiseAnd(self, right: _NumberType) -> Number: """Calculates the bitwise AND of the input values. Args: @@ -168,7 +168,7 @@ def bitwiseAnd(self, right: _NumberType) -> 'Number': self.name() + '.bitwiseAnd', self, right ) - def bitwiseNot(self) -> 'Number': + def bitwiseNot(self) -> Number: """Returns the bitwise NOT of the input. Uses the smallest signed integer type that can hold the input. @@ -176,7 +176,7 @@ def bitwiseNot(self) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.bitwiseNot', self) - def bitwiseOr(self, right: _NumberType) -> 'Number': + def bitwiseOr(self, right: _NumberType) -> Number: """Calculates the bitwise OR of the input values. Args: @@ -190,7 +190,7 @@ def bitwiseOr(self, right: _NumberType) -> 'Number': self.name() + '.bitwiseOr', self, right ) - def bitwiseXor(self, right: _NumberType) -> 'Number': + def bitwiseXor(self, right: _NumberType) -> Number: """Calculates the bitwise XOR of the input values. Args: @@ -204,17 +204,17 @@ def bitwiseXor(self, right: _NumberType) -> 'Number': self.name() + '.bitwiseXor', self, right ) - def byte(self) -> 'Number': + def byte(self) -> Number: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.byte', self) - def cbrt(self) -> 'Number': + def cbrt(self) -> Number: """Computes the cubic root of the input.""" return apifunction.ApiFunction.call_(self.name() + '.cbrt', self) - def ceil(self) -> 'Number': + def ceil(self) -> Number: """Computes the smallest integer greater than or equal to the input.""" return apifunction.ApiFunction.call_(self.name() + '.ceil', self) @@ -223,7 +223,7 @@ def clamp( self, min: _NumberType, # pylint: disable=redefined-builtin max: _NumberType, # pylint: disable=redefined-builtin - ) -> 'Number': + ) -> Number: """Returns a number that is clamped to lie within the range of min to max. Args: @@ -236,22 +236,22 @@ def clamp( return apifunction.ApiFunction.call_(self.name() + '.clamp', self, min, max) - def cos(self) -> 'Number': + def cos(self) -> Number: """Computes the cosine of the input in radians.""" return apifunction.ApiFunction.call_(self.name() + '.cos', self) - def cosh(self) -> 'Number': + def cosh(self) -> Number: """Computes the hyperbolic cosine of the input.""" return apifunction.ApiFunction.call_(self.name() + '.cosh', self) - def digamma(self) -> 'Number': + def digamma(self) -> Number: """Computes the digamma function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.digamma', self) - def divide(self, right: _NumberType) -> 'Number': + def divide(self, right: _NumberType) -> Number: """Divides the first value by the second, returning 0 for division by 0. Args: @@ -263,12 +263,12 @@ def divide(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.divide', self, right) - def double(self) -> 'Number': + def double(self) -> Number: """Casts the input value to a 64-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.double', self) - def eq(self, right: _NumberType) -> 'Number': + def eq(self, right: _NumberType) -> Number: """Returns 1 if and only if the first value is equal to the second. Args: @@ -280,27 +280,27 @@ def eq(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.eq', self, right) - def erf(self) -> 'Number': + def erf(self) -> Number: """Computes the error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erf', self) - def erfInv(self) -> 'Number': + def erfInv(self) -> Number: """Computes the inverse error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erfInv', self) - def erfc(self) -> 'Number': + def erfc(self) -> Number: """Computes the complementary error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erfc', self) - def erfcInv(self) -> 'Number': + def erfcInv(self) -> Number: """Computes the inverse complementary error function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.erfcInv', self) - def exp(self) -> 'Number': + def exp(self) -> Number: """Computes the Euler's number e raised to the power of the input.""" return apifunction.ApiFunction.call_(self.name() + '.exp', self) @@ -308,7 +308,7 @@ def exp(self) -> 'Number': @staticmethod def expression( expression: _StringType, vars: Optional[_DictionaryType] = None - ) -> 'Number': + ) -> Number: """Returns a number from computing a numeric expression. Args: @@ -322,7 +322,7 @@ def expression( return apifunction.ApiFunction.call_('Number.expression', expression, vars) - def first(self, right: _NumberType) -> 'Number': + def first(self, right: _NumberType) -> Number: """Selects the value of the first value. Args: @@ -334,7 +334,7 @@ def first(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.first', self, right) - def firstNonZero(self, right: _NumberType) -> 'Number': + def firstNonZero(self, right: _NumberType) -> Number: """Returns the first value if it is non-zero, otherwise the second value. Args: @@ -348,12 +348,12 @@ def firstNonZero(self, right: _NumberType) -> 'Number': self.name() + '.firstNonZero', self, right ) - def float(self) -> 'Number': + def float(self) -> Number: """Casts the input value to a 32-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.float', self) - def floor(self) -> 'Number': + def floor(self) -> Number: """Computes the largest integer less than or equal to the input.""" return apifunction.ApiFunction.call_(self.name() + '.floor', self) @@ -379,12 +379,12 @@ def format(self, pattern: Optional[_StringType] = None) -> ee_string.String: return apifunction.ApiFunction.call_(self.name() + '.format', self, pattern) - def gamma(self) -> 'Number': + def gamma(self) -> Number: """Computes the gamma function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.gamma', self) - def gammainc(self, right: _NumberType) -> 'Number': + def gammainc(self, right: _NumberType) -> Number: """Calculates the regularized lower incomplete Gamma function γ(x,a). Args: @@ -396,7 +396,7 @@ def gammainc(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.gammainc', self, right) - def gt(self, right: _NumberType) -> 'Number': + def gt(self, right: _NumberType) -> Number: """Returns 1 if and only if the first value is greater than the second. Args: @@ -408,7 +408,7 @@ def gt(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.gt', self, right) - def gte(self, right: _NumberType) -> 'Number': + def gte(self, right: _NumberType) -> Number: """Returns 1 if the first value is greater than or equal to the second. Args: @@ -420,7 +420,7 @@ def gte(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.gte', self, right) - def hypot(self, right: _NumberType) -> 'Number': + def hypot(self, right: _NumberType) -> Number: """Calculates the magnitude of the 2D vector [x, y]. Args: @@ -432,37 +432,37 @@ def hypot(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.hypot', self, right) - def int(self) -> 'Number': + def int(self) -> Number: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int', self) - def int16(self) -> 'Number': + def int16(self) -> Number: """Casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int16', self) - def int32(self) -> 'Number': + def int32(self) -> Number: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int32', self) - def int64(self) -> 'Number': + def int64(self) -> Number: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int64', self) - def int8(self) -> 'Number': + def int8(self) -> Number: """Casts the input value to a signed 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.int8', self) - def lanczos(self) -> 'Number': + def lanczos(self) -> Number: """Computes the Lanczos approximation of the input.""" return apifunction.ApiFunction.call_(self.name() + '.lanczos', self) - def leftShift(self, right: _NumberType) -> 'Number': + def leftShift(self, right: _NumberType) -> Number: """Calculates the left shift of v1 by v2 bits. Args: @@ -476,22 +476,22 @@ def leftShift(self, right: _NumberType) -> 'Number': self.name() + '.leftShift', self, right ) - def log(self) -> 'Number': + def log(self) -> Number: """Computes the natural logarithm of the input.""" return apifunction.ApiFunction.call_(self.name() + '.log', self) - def log10(self) -> 'Number': + def log10(self) -> Number: """Computes the base-10 logarithm of the input.""" return apifunction.ApiFunction.call_(self.name() + '.log10', self) - def long(self) -> 'Number': + def long(self) -> Number: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.long', self) - def lt(self, right: _NumberType) -> 'Number': + def lt(self, right: _NumberType) -> Number: """Returns 1 if and only if the first value is less than the second. Args: @@ -503,7 +503,7 @@ def lt(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.lt', self, right) - def lte(self, right: _NumberType) -> 'Number': + def lte(self, right: _NumberType) -> Number: """Returns 1 if the first value is less than or equal to the second. Args: @@ -515,7 +515,7 @@ def lte(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.lte', self, right) - def max(self, right: _NumberType) -> 'Number': + def max(self, right: _NumberType) -> Number: """Selects the maximum of the first and second values. Args: @@ -527,7 +527,7 @@ def max(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.max', self, right) - def min(self, right: _NumberType) -> 'Number': + def min(self, right: _NumberType) -> Number: """Selects the minimum of the first and second values. Args: @@ -539,7 +539,7 @@ def min(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.min', self, right) - def mod(self, right: _NumberType) -> 'Number': + def mod(self, right: _NumberType) -> Number: """Calculates the remainder of the first value divided by the second. Args: @@ -551,7 +551,7 @@ def mod(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.mod', self, right) - def multiply(self, right: _NumberType) -> 'Number': + def multiply(self, right: _NumberType) -> Number: """Multiplies the first value by the second. Args: @@ -563,7 +563,7 @@ def multiply(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.multiply', self, right) - def neq(self, right: _NumberType) -> 'Number': + def neq(self, right: _NumberType) -> Number: """Returns 1 if and only if the first value is not equal to the second. Args: @@ -575,12 +575,12 @@ def neq(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.neq', self, right) - def Not(self) -> 'Number': + def Not(self) -> Number: """Returns 0 if the input is non-zero, and 1 otherwise.""" return apifunction.ApiFunction.call_(self.name() + '.not', self) - def Or(self, right: _NumberType) -> 'Number': + def Or(self, right: _NumberType) -> Number: """Returns 1 if and only if either input value is non-zero. Args: @@ -592,7 +592,7 @@ def Or(self, right: _NumberType) -> 'Number': def parse( # pylint: disable=redefined-builtin input: _StringType, radix: Optional[_IntegerType] = None - ) -> 'Number': + ) -> Number: """Returns a number from a string. Args: @@ -604,7 +604,7 @@ def parse( return apifunction.ApiFunction.call_('Number.parse', input, radix) - def pow(self, right: _NumberType) -> 'Number': + def pow(self, right: _NumberType) -> Number: """Raises the first value to the power of the second. Args: @@ -616,7 +616,7 @@ def pow(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.pow', self, right) - def rightShift(self, right: _NumberType) -> 'Number': + def rightShift(self, right: _NumberType) -> Number: """Calculates the signed right shift of v1 by v2 bits. Args: @@ -630,17 +630,17 @@ def rightShift(self, right: _NumberType) -> 'Number': self.name() + '.rightShift', self, right ) - def round(self) -> 'Number': + def round(self) -> Number: """Computes the integer nearest to the input.""" return apifunction.ApiFunction.call_(self.name() + '.round', self) - def short(self) -> 'Number': + def short(self) -> Number: """Casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.short', self) - def signum(self) -> 'Number': + def signum(self) -> Number: """Computes the signum function (sign) of the input. The return value is 0 if the input is 0, 1 if the input is greater than 0, @@ -652,22 +652,22 @@ def signum(self) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.signum', self) - def sin(self) -> 'Number': + def sin(self) -> Number: """Computes the sine of the input in radians.""" return apifunction.ApiFunction.call_(self.name() + '.sin', self) - def sinh(self) -> 'Number': + def sinh(self) -> Number: """Computes the hyperbolic sine of the input.""" return apifunction.ApiFunction.call_(self.name() + '.sinh', self) - def sqrt(self) -> 'Number': + def sqrt(self) -> Number: """Computes the square root of the input.""" return apifunction.ApiFunction.call_(self.name() + '.sqrt', self) - def subtract(self, right: _NumberType) -> 'Number': + def subtract(self, right: _NumberType) -> Number: """Subtracts the second value from the first. Args: @@ -679,97 +679,97 @@ def subtract(self, right: _NumberType) -> 'Number': return apifunction.ApiFunction.call_(self.name() + '.subtract', self, right) - def tan(self) -> 'Number': + def tan(self) -> Number: """Computes the tangent of the input in radians.""" return apifunction.ApiFunction.call_(self.name() + '.tan', self) - def tanh(self) -> 'Number': + def tanh(self) -> Number: """Computes the hyperbolic tangent of the input.""" return apifunction.ApiFunction.call_(self.name() + '.tanh', self) - def toByte(self) -> 'Number': + def toByte(self) -> Number: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toByte', self) - def toDouble(self) -> 'Number': + def toDouble(self) -> Number: """Casts the input value to a 64-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.toDouble', self) - def toFloat(self) -> 'Number': + def toFloat(self) -> Number: """Casts the input value to a 32-bit float.""" return apifunction.ApiFunction.call_(self.name() + '.toFloat', self) - def toInt(self) -> 'Number': + def toInt(self) -> Number: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt', self) - def toInt16(self) -> 'Number': + def toInt16(self) -> Number: """Casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt16', self) - def toInt32(self) -> 'Number': + def toInt32(self) -> Number: """Casts the input value to a signed 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt32', self) - def toInt64(self) -> 'Number': + def toInt64(self) -> Number: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt64', self) - def toInt8(self) -> 'Number': + def toInt8(self) -> Number: """Casts the input value to a signed 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toInt8', self) - def toLong(self) -> 'Number': + def toLong(self) -> Number: """Casts the input value to a signed 64-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toLong', self) - def toShort(self) -> 'Number': + def toShort(self) -> Number: """Casts the input value to a signed 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toShort', self) - def toUint16(self) -> 'Number': + def toUint16(self) -> Number: """Casts the input value to an unsigned 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toUint16', self) - def toUint32(self) -> 'Number': + def toUint32(self) -> Number: """Casts the input value to an unsigned 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toUint32', self) - def toUint8(self) -> 'Number': + def toUint8(self) -> Number: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.toUint8', self) - def trigamma(self) -> 'Number': + def trigamma(self) -> Number: """Computes the trigamma function of the input.""" return apifunction.ApiFunction.call_(self.name() + '.trigamma', self) - def uint16(self) -> 'Number': + def uint16(self) -> Number: """Casts the input value to an unsigned 16-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.uint16', self) - def uint32(self) -> 'Number': + def uint32(self) -> Number: """Casts the input value to an unsigned 32-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.uint32', self) - def uint8(self) -> 'Number': + def uint8(self) -> Number: """Casts the input value to an unsigned 8-bit integer.""" return apifunction.ApiFunction.call_(self.name() + '.uint8', self) @@ -780,7 +780,7 @@ def unitScale( self, min: Union[int, float, computedobject.ComputedObject], max: Union[int, float, computedobject.ComputedObject], - ) -> 'Number': + ) -> Number: """Scales the input so that [min, max] becomes [0, 1]. Values outside the range are NOT clamped. If min == max, 0 is returned. diff --git a/python/ee/ee_string.py b/python/ee/ee_string.py index 749eca83e..635416767 100644 --- a/python/ee/ee_string.py +++ b/python/ee/ee_string.py @@ -85,7 +85,7 @@ def encode_cloud_value(self, encoder: Any = None) -> Any: else: return super().encode_cloud_value(encoder) - def cat(self, string2: _StringType) -> 'String': + def cat(self, string2: _StringType) -> String: """Concatenates two strings. Args: @@ -119,7 +119,7 @@ def decodeJSON(self) -> computedobject.ComputedObject: return apifunction.ApiFunction.call_(self.name() + '.decodeJSON', self) @staticmethod - def encodeJSON(object: _EeAnyType) -> 'String': + def encodeJSON(object: _EeAnyType) -> String: """Returns an ee.String with an object encoded as JSON. Supports primitives, lists, and dictionaries. @@ -185,7 +185,7 @@ def replace( regex: _StringType, replacement: _StringType, flags: Optional[_StringType] = None, - ) -> 'String': + ) -> String: """Returns a string with some or all matches of a pattern replaced. Args: @@ -216,7 +216,7 @@ def rindex(self, pattern: _StringType) -> ee_number.Number: def slice( self, start: _IntegerType, end: Optional[_IntegerType] = None - ) -> 'String': + ) -> String: """Returns a substring of the given string. If the specified range exceeds the length of the string, returns a shorter @@ -254,17 +254,17 @@ def split( self.name() + '.split', self, regex, flags ) - def toLowerCase(self) -> 'String': + def toLowerCase(self) -> String: """Converts all of the characters in a string to lower case.""" return apifunction.ApiFunction.call_(self.name() + '.toLowerCase', self) - def toUpperCase(self) -> 'String': + def toUpperCase(self) -> String: """Converts all of the characters in a string to upper case.""" return apifunction.ApiFunction.call_(self.name() + '.toUpperCase', self) - def trim(self) -> 'String': + def trim(self) -> String: """Returns a string with any leading and trailing whitespace removed.""" return apifunction.ApiFunction.call_(self.name() + '.trim', self)