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

rr.log_file(rec=custom_rec) still forwards to the global one #8185

Closed
teh-cmc opened this issue Nov 20, 2024 · 2 comments
Closed

rr.log_file(rec=custom_rec) still forwards to the global one #8185

teh-cmc opened this issue Nov 20, 2024 · 2 comments
Labels
🪳 bug Something isn't working 🐍 Python API Python logging API

Comments

@teh-cmc
Copy link
Member

teh-cmc commented Nov 20, 2024

@qianyizhang wrote:

to me more specific:

  1. rerun --serve in cli
  2. make some local rrds
    import rerun as rr
    NUM_CASE = 3
    path_list = []
    for index in range(1, 1+NUM_CASE):
        case_id = f"case{index}"
        rr.init("demo", recording_id=case_id)
        local_path = f"./{case_id}.rrd"
        rr.save(local_path)
        path_list.append(local_path)
        rr.log(
            "triangle{case_id}",
            rr.Mesh3D(
                vertex_positions=[[0.0, index, 0.0], [index, 0.0, 0.0], [0.0, 0.0, 0.0]],
                vertex_normals=[0.0, 0.0, 1.0],
                vertex_colors=[[0, 0, 255], [0, 255, 0], [255, 0, 0]],
                triangle_indices=[2, 1, 0],
            ),
        )
    
  3. natively log_file_from_path works as expected
    import rerun as rr
    rr.init("demo", recording_id="does not matter")
    rr.connect()
    for path in path_list:
        rr.log_file_from_path(path) # log to pre-saved recordings, eg. case1-3
    
  4. log_file_from_path with specified recording doesn't work
    import rerun as rr
    rr.init("demo", recording_id="new_record")
    rr.connect()
    new_recording = rr.get_global_data_recording()
    print(new_recording .get_recording_id()) # new_record
    for path in path_list:
        rr.log_file_from_path(path, recording=new_recording.to_native()) # expect to add this to current recording, but still ends up in pre-saved recordings, eg. case1-3
    
@teh-cmc teh-cmc added 🪳 bug Something isn't working 🐍 Python API Python logging API labels Nov 20, 2024
@teh-cmc teh-cmc added this to the Next patch release milestone Nov 20, 2024
@teh-cmc
Copy link
Member Author

teh-cmc commented Nov 20, 2024

All of this steps are working as expected: RRD files do not have import semantics, they always use open semantics (i.e. they will always log their data to their original recording, rather than importing it in another one).

That's because RRD files embed their own recording metadata, which takes precedence over everything else.
You will see the same behavior when you try to drag-n-drop RRD files in the viewer.

We should offer a way to explicitly ask for importing semantics when opening/logging RRD files, but that's definitely not in the scope of 0.20.1.
I'll open a new issue for that.

@teh-cmc teh-cmc closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2024
@teh-cmc
Copy link
Member Author

teh-cmc commented Nov 20, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 🐍 Python API Python logging API
Projects
None yet
Development

No branches or pull requests

1 participant