MCPcopy
hub / github.com/google/earthengine-api / variable

Method variable

python/ee/customfunction.py:79–96  ·  view source on GitHub ↗

Returns a placeholder variable with a given name and EE type. Args: type_name: A class to mimic. name: The name of the variable as it will appear in the arguments of the custom functions that use this variable. If null, a name will be auto-generated in _resolveNa

(type_name: str | None, name: str)

Source from the content-addressed store, hash-verified

77
78 @staticmethod
79 def variable(type_name: str | None, name: str) -> Any:
80 """Returns a placeholder variable with a given name and EE type.
81
82 Args:
83 type_name: A class to mimic.
84 name: The name of the variable as it will appear in the
85 arguments of the custom functions that use this variable. If null,
86 a name will be auto-generated in _resolveNamelessArgs().
87
88 Returns:
89 A variable with the given name implementing the given type.
90 """
91 var_type = ee_types.nameToClass(type_name) or computedobject.ComputedObject
92 result = var_type.__new__(var_type)
93 result.func = None
94 result.args = None
95 result.varName = name
96 return result
97
98 @staticmethod
99 def create(

Callers 10

_decodeValueFunction · 0.80
decode_nodeFunction · 0.80
__init__Method · 0.80
test_serializationMethod · 0.80
test_dateMethod · 0.80
test_constructorsMethod · 0.80
test_constructorsMethod · 0.80
deserializer.jsFile · 0.80
decodeFunction · 0.80
customfunction.jsFile · 0.80

Calls 1

__new__Method · 0.45

Tested by 4

test_serializationMethod · 0.64
test_dateMethod · 0.64
test_constructorsMethod · 0.64
test_constructorsMethod · 0.64