Similarity_measures rewritten in Rust from Python

I wanted to rewrite in Rust the python library similarity_measures, which can be used to calculate the Dynamic Time Warping and Frechet distance to obtain a similarity score between curves.

My library is at the following link:

The library accepts in input arrays from the ndarray library, and I tried my best to make it generic to accept both f32 and f64 as the underlying type of the input array.

I don't know if it would be worthy or convenient to make it accept also standard vectors and arrays.

It is my first rust crate, and I don't have professional experience with Rust (only Python, C++ and Go), so I don't know how many "not-so-idiomatic things I did". Any feedback would be of help.

Thanks in advance for the attention!

First thing i notice is that the comments you wrote before functions aren't doc comments. This means that they won't be rendered by rustdoc and also won't be shown by IDE tools when calling that function.

You can create a multiline doc comment by using:

/** Doc comment*/
fn test() {}

notice the extra star.

1 Like

I would start by fixing the warning of cargo build and the reading the result of cargo clippy

And to complement @luca3s's anwser about comments, you can see the generated documentation of your crate by running cargo doc --open

1 Like

Thank you very much, I took care of that

Thank you very much, I modified according to low hanging fruits from cargo clippy. Some other things (like the cargo build warning, which is about a deprecated function from ndarray) would take me some time to improve.

1 Like