annotations¶
ecoscope.platform.annotations ¶
Attributes¶
AdvancedField
module-attribute
¶
AdvancedField = create_custom_field('AdvancedField', always_set={'json_schema_extra': {'ecoscope:advanced': True}}, require_default=True)
AnyGeoDataFrameOrEmpty
module-attribute
¶
AnyGeoDataFrameOrEmpty = Union[AnyGeoDataFrame, EmptyDataFrame]
DataFrame
module-attribute
¶
DataFrame = Annotated[DataFrame[DataFrameSchema], WithJsonSchema({'type': 'ecoscope.platform.annotations.DataFrame'})]
DataFrameSchema
module-attribute
¶
DataFrameSchema = TypeVar('DataFrameSchema', bound=JsonSerializableDataFrameModel)
Classes¶
EmptyDataFrameModel ¶
GeoDataFrameBaseSchema ¶
JsonSerializableDataFrameModel ¶
Bases: DataFrameModel
StrictGeoDataFrameBaseSchema ¶
Functions:¶
create_custom_field ¶
create_custom_field(field_name: str, always_set: dict, require_default: bool, *, __f: Callable[FP, FieldInfo] = Field) -> Callable[FP, FieldInfo]
A factory function which creates a custom Field with always_set kwargs always set.
Note that the always_set kwargs will not be omitted from the signature of the returned
custom Field as understood by static type checkers, but they will raise ValueError at
runtime if overridden. If require_default is True, the user must provide a default when
calling the custom Field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
always_set
|
dict
|
The keyword arguments to always set on Field. |
required |
require_default
|
bool
|
If True, the user must provide a default when calling the custom Field. |
required |
__f
|
Callable[FP, FR]
|
Defaults to Field. This is included in the signature for editor support only; the default should not be overridden. |
Field
|