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

Split examples by language #1181

Merged
merged 29 commits into from
Feb 11, 2023
Merged

Split examples by language #1181

merged 29 commits into from
Feb 11, 2023

Conversation

emilk
Copy link
Member

@emilk emilk commented Feb 10, 2023

I also re-arranged the objectron python structure so that:

  • dataset contains the downloaded data (because that's what we use everywhere else, and it is what is in the global .gitignore)
  • proto contains the protobuff stuff
  • download_dataset.py is in the same path as main.py

TODO

  • compare how other examples do dataset downloading
  • figure out how rust objectron gets the dataset
  • test all python examples
  • test all rust examples

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I've added a line to CHANGELOG.md (if this is a big enough change to warrant it)

@emilk emilk force-pushed the emilk/split-examples-by-language branch from 249385f to 6e829e4 Compare February 10, 2023 13:25
@emilk
Copy link
Member Author

emilk commented Feb 10, 2023

This was a lot more work than anticipated 😓

@emilk emilk marked this pull request as ready for review February 10, 2023 15:55
@teh-cmc teh-cmc self-requested a review February 10, 2023 17:10
@teh-cmc
Copy link
Member

teh-cmc commented Feb 10, 2023

I'll review carefully over the WE, I have a lot of examples-related work I want to do anyhow!

emilk and others added 14 commits February 11, 2023 11:13
* Split out the `run` parts of the rerun library to its own file

* Document that the web feature flag requires running scripts/setup_web.sh

* Improve the docs of rerun and re_sdk

* Describe more things

* Fix warning

* More docs, and split out `coordinates` into its own module

* nit comment

Co-authored-by: Andreas Reich <[email protected]>

* Improve docstring

* Improve error message

* Add some spacing

* For instance -> For example

---------

Co-authored-by: Andreas Reich <[email protected]>
…o caching (#1187)

* Mark git directories as safe for our docker_ci container
* New cargo packages means a new cache key
* Add CACHE_KEY everywhere and Only update cache from 1 location
* log_image_file: require named arguments
* Allow logging the contents of an image file, not by path
* Add --dataset and --resize flags to colmap
* Make 'web' a default feature of the python sdk

* Add sanity-checking to crates/re_web_server/build.rs

* Allow crates/re_web_server/build.rs to be run from any CWD

* Run setup_web.sh on the Python CI

* Turn on the web feature on the CI

* Only enable the web feature when building pypi package

* Improve setup_web.sh

* Add winget package manager to setup_web.sh

* Print out what is happening

* Add shell: bash

* Try getting wasm-opt into the windows build

* Correct path to exe

* run setup_web.sh but allow it to fail

---------

Co-authored-by: Jeremy Leibs <[email protected]>
* Update arrow2, arrow2_convert and polars

* Patch arrow2-convert again

* Add instructions for how to patch crates to Cargo.toml

* Use trunk polars in patch
* Turn on python linting of examples

* Fix minor lints

* Mute lints about bad docstrings

* Use list() instead of trivial list comprehension

* ignore some lines, fix others

* don't use single-letter names

* ignore line

* `catch:` -> `catch Exception:`

* Dict comprehension

* format

* Docstring improvements

* More docstring fixes

* Docstring fixes

* docstrings done!

* Enable and fix more lints

* One more

* Clean up .flake8 file

* Final cleanup of .flake8

* Also lint python scripts under scripts/

* py-format

* better dicom explanation

Co-authored-by: Andreas Reich <[email protected]>

---------

Co-authored-by: Andreas Reich <[email protected]>
@teh-cmc
Copy link
Member

teh-cmc commented Feb 11, 2023

Testing checklist on a clean clone / Linux:

Python:

  • api_demo/
  • car/
  • clock/
  • colmap/
  • deep_sdf/
  • dicom/
  • minimal/
  • mp_pose/
  • multiprocessing/
  • multithreading/
  • nyud/
  • objectron/
  • plots/
  • raw_mesh/
  • stable_diffusion/
  • text_logging/
  • tracking_hf_opencv/

Rust:

  • api_demo/
  • minimal/
  • objectron/
  • raw_mesh/

The simplest example is [`minimal`](minimal/main.py). You may want to start there!

## Setup
First install the Rerun Python SDK with `pip install rerun-sdk` (coming soon!)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
First install the Rerun Python SDK with `pip install rerun-sdk` (coming soon!)
First install the Rerun Python SDK with `pip install rerun-sdk`.

Might as well pre-emptively get this right.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: if rerun-sdk is already published, why can't I find it on https://pypi.org/project/rerun-sdk/ ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only been published on testpypi, so pip install -i https://test.pypi.org/simple/ rerun-sdk

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if pip install rerun-sdk doesn't work yet, then let's not write it yet.

## Setup
First install the Rerun Python SDK with `pip install rerun-sdk` (coming soon!)

<!-- TODO(emilk): remove the coming soon -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- TODO(emilk): remove the coming soon -->

@jondo2010
Copy link
Contributor

Also need to update the links to the examples in rerun-docs/docs/getting-started/examples.md

@teh-cmc
Copy link
Member

teh-cmc commented Feb 11, 2023

$ cargo r -p raw_mesh -- --scene lantern
    Finished dev [optimized + debuginfo] target(s) in 0.18s
     Running `target/debug/raw_mesh --scene lantern`
Error: Could not load the scene, have you downloaded the dataset? Try running the python version first to download it automatically (`examples/python/raw_mesh/main.py --scene lantern`).

$ examples/python/raw_mesh/main.py --scene lantern
downloading https://github.com/KhronosGroup/glTF-Sample-Models/blob/master/2.0/Lantern/glTF-Binary/Lantern.glb?raw=true …
loading scene /home/cmc/dev/rerun-io/rerun/examples/python/raw_mesh/dataset/lantern/lantern.glb…

$ cargo r -p raw_mesh -- --scene lantern
    Finished dev [optimized + debuginfo] target(s) in 0.17s
     Running `target/debug/raw_mesh --scene lantern`
2023-02-11T17:39:12.908731Z  INFO raw_mesh: parsing glTF scene scene="scene_#0"
2023-02-11T17:39:12.908911Z  INFO raw_mesh: logging glTF scene scene="scene_#0"

@emilk emilk merged commit 4fb69ee into main Feb 11, 2023
@emilk emilk deleted the emilk/split-examples-by-language branch February 11, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants