Rust bindings (mir-sys crate) - #49
Choochmeque wants to merge 52 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #49 +/- ##
========================================
Coverage 57.50% 57.50%
========================================
Files 620 620
Lines 26548 26548
Branches 2326 2326
========================================
Hits 15267 15267
Misses 11281 11281 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @Choochmeque, can you book a meeting to discuss this? Thanks! |
pmaciel
left a comment
There was a problem hiding this comment.
Remarks:
- can you add headers to every added source file (.h, .cc, .rs, .toml), similar to the C++ sources (like MIRJob.h and others); we have adopted SPDX headers but haven't transitioned yet
- style:
- can you remove lines like //-------------------------...
- two empty lines between: license, headers/pre-processor directives, namespace opening/closing, code propper (class declarations, methods implementation, etc.)
- remove functionality related to mir_tool_call, representation_from (we're transitioning out of this)
- rename the create... methods with make... (this is for consistency with the python bindings)
I don't see that this bindings makes optional use of metkit (but, it's also fine like this.)
It also is disabling tests, which might be part of an implicit contract that these are to be built separately from a main build that actually tests, and stops if tests fail? It is missing tests and/or examples, which are extremely valuable as a high-level documentation or starting points for a newcomer -- specifically the processing of GRIB messages to/from memory are extremely valuable. A unit test and a (small) Jupyter notebook at least?
Note that when I mean "I don't like" or "I prefer" it really is just personal preference and no criticism, just a point of discussion that might sway to a compromise we'd both be happy with!
| @@ -0,0 +1,70 @@ | |||
| // mir job bridge — wraps `mir::api::MIRJob`. | |||
There was a problem hiding this comment.
These comments aren't necessary (I'm being pedantic)
|
|
||
| //---------------------------------------------------------------------------------------------------------------------- | ||
|
|
||
| /// A description of the transformation to apply, not the transformation itself: |
There was a problem hiding this comment.
I prefer long comments using the block version (/* /, or in this case /* */). Since you're refering to reusing MIRJob, also document that the input (MIRInput argument) is consumed with next()
|
|
||
| //---------------------------------------------------------------------------------------------------------------------- | ||
|
|
||
| /// Static accessors for the mir library itself. Holds no state; it exists as a |
There was a problem hiding this comment.
This comment says 3 times the same thing
| @@ -0,0 +1,53 @@ | |||
| [package] | |||
| name = "mir-sys" | |||
| version = "1.28.2" | |||
There was a problem hiding this comment.
Can this be made dynamic? We are already ahead of this, and with a planned 2.0 release this year, or early next year
| "eckit-sys/eckit-spec", | ||
| "eckit-sys/eckit-geo", | ||
| "eckit-sys/geo-codec-grids", | ||
| "metkit-sys/vendored", |
There was a problem hiding this comment.
In our stacks we build metkit after atlas/before mir, maybe this order should generally be reflected here
| @@ -0,0 +1,18 @@ | |||
| # mir-sys | |||
|
|
|||
| Low-level Rust bindings to ECMWF's [mir](https://github.com/ecmwf/mir) (Meteorological Interpolation and Regridding) C++ library. | |||
b08baad to
0f1e9bb
Compare
0f1e9bb to
ece64ae
Compare
…per, and Parametrisation classes
…rsion consistency
…Output, and Parametrisation files for cleaner code.
develop completed the SPDX transition; the bindings still carried the old long-form ECMWF block.
GribMemoryInput does not override next(), so execute_all throws.
Mirrors the Python example: file to file, memory to file, file to memory.
mir requires eccodes >= 2.48; metkit-sys must resolve the same eccodes-sys rev or cargo links two copies of eccodes_sys.
The reuse check requires every file to carry licensing information.
eb3db01 to
d3587a0
Compare
|
I apologize for such a long letter - I didn't have time to write a short one. Most of the comments below are about making the API consistent while it's cheap, so later additions follow a pattern. A few points are raised across the other Discussion 1. "Bridge" and namespace
Discussion 2. Job/Parametrisation/MIROutput set* namingRust has no overloading, so a one-to-one mapping forces typed names somewhere. But the available set of rust=facing methods ins't consistent between the classes that are supporting it, with Job/Parametrisation having a different set -- this "set of setters" doesn't need to completely implement the c++ side, but ideally be consistent together. Going further, a shared trait for "settings" (
Discussion 3: constructors/generators vs factories,
|
Thanks for the detailed review. Commits are pushed to this branch; per discussion: D1. Namespace. Keeping D2. Setters.
D3. "Factories" sections are now "Constructors" (165b16b); D4. Versions.
D5. D6. Added D7.
D8. Tests.
|
Description
Full implementation of the -sys crate for mir
Contributor Declaration
By opening this pull request, I affirm the following: