Skip to content

Plugin development docs seemingly copy-paste-edit includes type aliases that must be defined (or imported?) #365

@vreuter

Description

@vreuter

📚 Documentation

The plugin contribution guide's reader example includes a code snippet that's made available for copy-and-paste and makes a nice template that could be edited for quick plugin development, but it includes the LayerData type alias that's note explained on the same page, and isn't provided in code.

Following the link on the same page (reader contribution guide) to the page for layer data tuples, we see the type alias explained in the formal type definition. That definition, in turn, contains other type aliases which, while detailed in the code below it on that same page, includes a reference to a Protocol subtype (ArrayLike) that's noted as an approximation rather than a real intended definition.

How is a developer of a reader plugin, then, to type the return value of a get_reader function? It should be Optional[ReaderFunction], but following the path of contained types (ReaderFunction --> LayerData --> DataType --> ArrayLike) leads somewhere to a type (ArrayLike) which isn't clear to what this name concretely refers.

Are these type aliases available somewhere for import? If not, how to proceed with the type signature for a reader plugin?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpluginsrelated to plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions