Description
Export Functionality
I've begun work on a prototype model and interface for exporting data from the DGP interface. Here I want to layout the basic structure of the export functionality, and solicit ideas as far as functionality that the user may need/desire from the exporter.
Structure
The current prototype export library is organized into Exporter's, ExportProfile's, and ColumnProfile's.
The Exporter class is responsible for transforming input data (DataFrame/Series) and exporting to some particular format. The intent is for the base Exporter class to be sub-classed and its abstract methods implemented to provide exporters for different data export formats.
ExportProfiles are instances of an ExportProfile class which is simply used to define common parameters for an export, most significantly the ExportProfile's are used to determine which columns (and in which order) of data are exported. Profiles are registered upon creation for later enumeration and use.
ColumnProfile's are used to define data columns that may be exported, all columns may not be available to export in any one context, but this allows the user to create ExportProfiles without regard for what is currently being exported. ColumnProfiles may also include some limited meta-data such as a description, unit-type, user-friendly name, and category/group. ColumnProfile instances are also registered for use in the Exporter framework.
ToDo
- Determine the best way for exporters to expose and accept parameters specific to their implementation, e.g. allowing a user to specify separator value for the CSV exporter but not for HDF5 where it makes no sense.
- Does the ColumnProfile framework make sense, is it extensible when new columns are introduced (e.g. new transformations)? My thinking is that any new transform graphs for example would define column profiles in their source/package for any new column types introduced (these would be automatically registered and thus available for export).
Questions/Unknowns
- Should exporters be filtered for user based on the export context (i.e. is the user exporting the DataSet, or from the transform interface, or from plotted data etc.)
- Likewise should ExportProfiles be tied to the export context and/or only available for specific Exporters?
- What options/parameters might a user need to adjust during export (both in general, and specific parameters tied to an export type e.g. HDF5 or CSV)
- How to handle user defined profiles, how/where to store user ExportProfiles (within project scope/directory, or use QSettings).
- To allow users to edit/overwrite builtin ExportProfiles, or mark builtin profiles as 'copy-only', allowing users to make a copy and then modify the profile.
User Interface
Here is a look at the working dialog implementation which simply exposes the available exporters and profiles, and allows the user to edit/modify the export profile. The exporter package remains entirely decoupled from the UI implementation, and has no dependencies on any Qt libraries.