-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Angle datatype stores now only radians (#6916)
### What * Part of #6831 Previously, `Angle` was an arrow union between radian & degree. As part of the effort of simplifying our data representations, this is now always just radians. Ran into a nameclash for C++'s `Angle` class and had to resort to a new attribute that allows renaming the field for C++ only. Simplifies the `Angle` datatype to only store radians. As far as I can tell I managed to do this in a way that should break almost no existing usage (ignoring deprecation warnings) ### Checklist * [x] "passes" main test * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6916?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6916?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/6916) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
- Loading branch information
Showing
39 changed files
with
317 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 10 additions & 9 deletions
19
crates/store/re_types/definitions/rerun/datatypes/angle.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
include "arrow/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
include "fbs/attributes.fbs"; | ||
include "cpp/attributes.fbs"; | ||
|
||
include "./float32.fbs"; | ||
|
||
namespace rerun.datatypes; | ||
|
||
// --- | ||
|
||
/// Angle in either radians or degrees. | ||
union Angle ( | ||
"attr.rust.derive": "Copy, PartialEq" | ||
/// Angle in radians. | ||
struct Angle ( | ||
"attr.arrow.transparent", | ||
"attr.python.aliases": "float, int", | ||
"attr.python.array_aliases": "npt.ArrayLike, Sequence[float], Sequence[int]", | ||
"attr.rust.derive": "Copy, Default, PartialEq, PartialOrd, bytemuck::Pod, bytemuck::Zeroable", | ||
"attr.rust.repr": "transparent", | ||
"attr.cpp.no_field_ctors" | ||
) { | ||
/// Angle in radians. One turn is equal to 2π (or τ) radians. | ||
/// \py Only one of `degrees` or `radians` should be set. | ||
Radians: rerun.datatypes.Float32 (transparent), | ||
|
||
/// Angle in degrees. One turn is equal to 360 degrees. | ||
/// \py Only one of `degrees` or `radians` should be set. | ||
Degrees: rerun.datatypes.Float32 (transparent), | ||
radians: float (order: 100, "attr.cpp.rename_field": "angle_radians"); // Rename field to avoid nameclash with `radians` function. | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.