Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse default values during semantic pass #2641

Open
Tracked by #2646
teh-cmc opened this issue Jul 10, 2023 · 0 comments
Open
Tracked by #2646

Parse default values during semantic pass #2641

teh-cmc opened this issue Jul 10, 2023 · 0 comments

Comments

@teh-cmc
Copy link
Member

teh-cmc commented Jul 10, 2023

E.g. we have this thing:

table TranslationAndMat3x3 {
  // [...]
  from_parent: bool = false (order: 300);
}

Would be nice to actually get that information down to code generators; although right now it's just this one so we get away with hacks for now.

jleibs added a commit that referenced this issue Jul 13, 2023
### What

This PR adds support for `Transform3D` to the new-gen Python SDK,
including:
- adding the relevant fbs
- implementing codegen'd union types
- adding all required hand-coded overrides
- adding typed-checked test to demonstrate/assess API
- full typing compliance for both mypy and pyright (required
`disallow_untyped_calls = False` in `.mypy.ini`)

**Note**:
- The `from_parent` field is moved from `Transform3D` to both
`Translation*` objects, to comply with the 1-comp-1-datatype rule.
- The `from_parent` field has been made `nullable` though it has a
default value, which are not yet implemented (#2641).

TODO:
- [x] arrow serialisation (basic, to be tested)
- [x] `rr.arch.Transform3D()` serialisation tests
- [x] default types (`from_parent`) (including proper field sorting)
- [x] ~~`ruff --fix` seems to always fail~~ (config error on my side)
 

TODO @teh-cmc and/or @jleibs :
- [x] deal with commented-out hack in `rerun_py/src/arrow.rs`
- [x] fix Rust codegen
- [x] fix restriction on nullable union (see discussion in #2619)
- [x] teach me how to properly indent text (in `python.rs`)


### Checklist
* [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 [demo.rerun.io](https://demo.rerun.io/pr/2639) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2639)
- [Docs
preview](https://rerun.io/preview/pr%3Aantoine%2Fhope-python-transforms-new/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Aantoine%2Fhope-python-transforms-new/examples)

---------

Co-authored-by: Jeremy Leibs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant