Skip to content

Generate Rust code representing GRIB2 tables from GDAL CSVs #63

@JackKelly

Description

@JackKelly

In this comment @mpiannucci said:

I... was going to codegen [a Rust implementation of the GRIB code tables] but never had the time

We could use this issue to capture some ideas & design requirements for the codegen. I'll get started below but please shout if I'm off track 🙂.

Input to the codegen

GDAL's CSV representation of the GRIB tables. The README for that directory is here: gdal/frmts/grib/degrib/README.TXT

Output from the codegen

Rust code!

  • Rust Enums which represent the GRIB code tables.
  • Make it super-easy and super-fast to look up the appropriate enum variant by generating the definitions for at least 2 phf::Maps (perfect hash functions generated at compile time):
    1. Map from abbreviation String to enum variant. This will be useful for parsing .idx files (Add idx metadata file handling #41).
    2. Map from numeric GRIB code to enum variant.

Questions

UPDATE: I've removed the questions for now because I'm working on a code sketch which I hope answers the main questions... I'll post a comment with the code sketch soon...

Development timeline

Hopefully I'll be able to help write the PR which implements this in a few months... But, of course, I'm more than happy for other people to do it!

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions