temporian icon indicating copy to clipboard operation
temporian copied to clipboard

Extra elipsis when displaying a single-event EventSet

Open javiber opened this issue 11 months ago • 4 comments

In this case the ellipsis (...) should not be displayed

Screenshot 2024-03-26 at 2 55 10 PM

javiber avatar Mar 26 '24 17:03 javiber

I think this is happening due to :


            # Create ellipsis row between first half and last half if more than max_timestamps entries
            table.appendChild(html_table_row(dom, row))
            if (
                timestamp_idx == ((max_timestamps // 2) - 1)
                and num_timestamps > max_timestamps
            ) or (max_timestamps == 1):                                     # THIS IS CREATING THE ELLIPSE
                ellipsis_row = [ELLIPSIS] * (
                    1 + len(visible_feats) + int(has_hidden_feats)
                )
                table.appendChild(html_table_row(dom, ellipsis_row))

at here: def display_html.

Maybe we can do max_timestamps == 1 and num_timestamps > 1 instead of just or (max_timestamps == 1):

akshatvishu avatar Mar 28 '24 14:03 akshatvishu

Yes, the max_timestamps is the min(config.display_max_events, num_timestamps) so when we fixed the ellipsis for display_max_events == 1 we broke it when num_timestamps == 1 Adding that check would fix it, although I think we can factor-out the num_timestamps > max_timestamps and do something like:

(num_timestamps > max_timestamps) and ( (timestamp_idx == ((max_timestamps // 2) - 1)) or (max_timestamps == 1) )

and I feel that the last 2 conditions linked by the or could be simplified into a single one 🤔

javiber avatar Apr 02 '24 15:04 javiber

Yes, the max_timestamps is the min(config.display_max_events, num_timestamps) so when we fixed the ellipsis for display_max_events == 1 we broke it when num_timestamps == 1 Adding that check would fix it, although I think we can factor-out the num_timestamps > max_timestamps and do something like:

(num_timestamps > max_timestamps) and ( (timestamp_idx == ((max_timestamps // 2) - 1)) or (max_timestamps == 1) )

and I feel that the last 2 conditions linked by the or could be simplified into a single one 🤔

Can you tell me how to run jupyter notebooks in our venv so, that I can test it because if I just download the jupyter extension from vscode and try to run something; the kernel just don't detect the poetry venv

akshatvishu avatar Apr 02 '24 15:04 akshatvishu

you can install jupyter bypassing the pyproject.toml with poetry run pip install jupyter and then poetry run jupyter notebook. For vscode, I always set poetry config virtualenvs.path .venv and poetry config virtualenvs.in-project true so that poetry creates a folder .venv inside my project which vscode is able to find

javiber avatar Apr 03 '24 15:04 javiber