Skip to content

Implement engine discovery using guess_can_open #380

Description

@syedhamidali

Add an engine discovery utility for xradar I/O that can determine the appropriate backend engine for a given radar file.

Motivation

For xradar v1.0, it would be useful to have a more xarray-aligned way to detect which backend can open a file. This could be based on implementing guess_can_open for xradar backend entrypoints and then using that logic in a small utility such as discover_engine.

Suggested tasks

  • Implement guess_can_open for xradar backends where possible.
  • Add a discover_engine(filename_or_obj) utility that returns the matching engine name.
  • Use backend entrypoints instead of directly trying all open functions.
  • Add tests with sample files from different supported radar formats.
  • Document the new engine discovery behavior.

Possible future use

python engine = xd.io.discover_engine(filename) dtree = xd.io.open_datatree(filename, engine=engine)

Later this could also support higher-level APIs such as:

python dtree = xd.open_datatree(filename)

where engine=None discovers the engine automatically.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions