Repository navigation
Rust docs examples - #55
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #55 +/- ##
===========================================
+ Coverage 87.00% 87.03% +0.02%
===========================================
Files 189 189
Lines 15125 15219 +94
Branches 1370 1370
===========================================
+ Hits 13160 13246 +86
- Misses 1965 1973 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9f5f71c to
b17a9f2
Compare
bbde5a8 to
ad32025
Compare
simondsmart
left a comment
There was a problem hiding this comment.
Generally good. You need to include the stride behaviour in the custom encoders/decoders.
I also think that the Span functionality is the perfect place for a rust enum. Consider that the span is essentially a map<column-name, enum<integers, strings, floats>>
| uint64_t offset() const; | ||
| uint64_t length() const; | ||
| bool equals(const SpanWrapper& other) const; | ||
| rust::Vec<int64_t> integer_values(rust::Str column) const; |
There was a problem hiding this comment.
This misses something of the underlying functionality of Span - and that can be seen in the documentation example.
This is important in a context where you may not know what the types you are going to have - or indeed, which columns are going to be there in the first place.
|
|
||
| .. code-block:: rust | ||
|
|
||
| // Decode all columns into a Polars DataFrame |
There was a problem hiding this comment.
This Polars stuff needs a bit more upfront commentary. Because this is different to the model for the C and Fortran data (and is more similar to the python one).
|
|
||
| .. note:: | ||
|
|
||
| Rust interface does not support data encoding from a column-major layout. In this case, encode from a Polars ``DataFrame`` or from a :ref:`custom memory layout <encoder-custom-layout>` instead. |
There was a problem hiding this comment.
Is there a particualr reason why not?
| // set up the data here... | ||
|
|
||
| let columns = [ | ||
| RawColumn { |
There was a problem hiding this comment.
Do we support controlling the data stride?
|
|
||
| let options = WriteOptions::default(); | ||
|
|
||
| // Or encode into an open eckit DataHandle |
There was a problem hiding this comment.
I want to imagine writing to a more general writable rust object (imagine a network socket, or something else). Can we show the eckit behaviour of capturing a more general rust writable object?
There was a problem hiding this comment.
Fixed in d76e00e, requires ecmwf/eckit#375 (DataHandle::from_writer)
Description
Rust documentation and examples
Contributor Declaration
By opening this pull request, I affirm the following:
📖 Documentation 📖
https://sites.ecmwf.int/docs/dev-section/odc/pull-requests/PR-55