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)
| 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( |