Proposal for Generated Filter Code #2288
DennisHeimbigner
started this conversation in
Ideas
Replies: 3 comments 1 reply
-
I think this is very much in line with ncgen, so fits as a netcdf-c utility. I will certainly try this out next time I need to wire in a filter. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, @DennisHeimbigner! Thanks for putting together this proposal. I have a couple of questions:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal for Generated Filter Code
I am starting work on a new netcdf utility that takes a simplified filter specification and uses it to generate a complete HDF5 filter wrapper [2] plus an NCZarr filter wrapper.
The raison d'etre is that the process of building an HDF5 filter wrapper [2,3] from scratch is complex, time-consuming and error prone. Using a code generator is likely to simplify this process. At the very least, it will produce base code that a filter builder can modify to build the desired wrapper.
This program is analogous to, say, the yacc parser generator that converts an annotated BNF to a full blown parser.
What I need: I have a simple prototype working, but I need some community input on this idea. Would anyone use it? Is the proposed specification (Appendix A) reasonably simple to construct?
Specification Overview
The filter specification is written in JSON, although it is highly stylized. It was derived from the NumCodecs [4] format but with significant extensions to support the Netcdf-4/HDF5 wrapper format.
A couple of visible extensions with respect to JSON are:
The basic specification is a JSON dictionary with very specific keys that are used to control code generation.
A draft example for specifying the zstandard filter wrapper is shown in Appendix A. The various dictionary keys provide filter information.
identifier (32015); it also specifies an alternate preferred name.
as specified by NumCodecs, and the value is a keyword
indicating the type of the corresponding parameter.
The allowable types are "integer" or "float". or an enumeration
(not described here).
References
[1] HDF5 Filter Specification
[2] Registered HDF5 Filter Plugins
[3] User Contributed Filters
[4] NumCodecs
Appendix A. Zstandard Draft Example
Beta Was this translation helpful? Give feedback.
All reactions