Plugin Development
Extend DEFAIR with a reader for another product, a writer for an output format, or a transformation for a processing operation. These guides describe the plugin interfaces, registration, and tests.
Prerequisites
No. 1 DEFAIR and the test tools
Complete Install DEFAIR locally and install pytest in that environment. The reader and writer interfaces and the Dataset wrapper come from defair-data; transformation interfaces come from defair-ops. The tests also use defair for discovery and workflow validation, and writer examples use it for logging and CF history. The examples use xarray and Dask, and the reader skeleton uses h5netcdf; these packages come with DEFAIR.
No. 2 A standalone Python package for the plugin
The plugin lives in its own package, with DEFAIR as a dependency. Each guide supplies a minimal pyproject.toml, the entry-point group and a plugin skeleton. Replace the my_defair_plugin example names with your package’s import paths.
No. 3 Test inputs and expected results
Prepare the sample data and expected results specified by the reader, writer or transformation guide you follow. Keep them available to the tests in your plugin package.
Articles
What to do next
Start with Write a reader plugin if you need to support another input product. For a new output format, follow Write a writer plugin; for a new processing operation, follow Write a transformation plugin.