rerun-io / rerun

Visualize streams of multimodal data. Free, fast, easy to use, and simple to integrate. Built in Rust.
https://rerun.io/
Apache License 2.0
6.66k stars 336 forks source link

`Asset3D`:s constructors are named differently in C++ and Rust #6881

Open emilk opened 4 months ago

emilk commented 4 months ago

In C++ we have from_file and from_bytes. In Rust we have from_file and from_file_contents.

Basically we have two sources we care about:

from_file_contents is very descriptive, so I think it winds out over from_byte.

from_file isn't great though - I could easily see someone be confused and pass a path to that (which I would not be surprised if it worked on some C++ compilers).

So I suggest we go with: from_file_path and from_file_contents. Or shorten it to: from_path and from_contents.

Whatever we chose, we should pick the same for the new ImageEncoded.

We should also keep the old functions with a deprecation marker.

Python

In Python we use named arguments instead, and those are named path and contents, which I think are good, and go well with the suggested names.

emilk commented 2 months ago

We now have VideoAsset too, so high time to make this consistent