google/temporian

Show first and last events instead of only first ones when displaying an EventSet

Closed this issue · 11 comments

Change the HTML display of an EventSet to display the first 3 and last 3 events on each index value, instead of showing the first 5. See how pandas displays DataFrames display for reference.

The main display function is display_html in temporian/implementation/numpy/data/display_utils.py.

I can take this one if available

Hey @jtaylor205 - all yours!

Let me know if any doubts arise or there's any design decisions you'd rather run by us before going ahead with the implementation.

Thanks!

Thanks Ian! I will get to work on it within the week. I have to complete a "good first issue" task for a class I am taking and ned to get this approved so I can get to it.

Hi Ian,
quick question on how to install my edited version to view changes. I am trying to run pip install -e . from the directory I have my forked repository in, but I keep getting the error ERROR: Could not build wheels for temporian, which is required to install pyproject.toml-based projects . Is there something I am doing wrong there or another way to run my modified version? I'm doing this through terminal on my M2 MacBook Pro

Could you provide more detailed logs of the error? pip install -e . works for me, though it's not what I use to develop and might just be because poetry build has already generated necessary intermediate assets.

Safer option is to try to build the wheel with poetry with poetry build, then install the wheel that is generated under dist/.

Note that you need to have bazel installed, see Environment setup.

Thanks so much for that help. It makes a lot more sense and it worked. I have got it into jupyter and will work on getting the task done!

No worries! Hope my college had "forced" me to contribute to OSS too :)

An EventSet with 8 events and no index should be enough for the very basic test (since up to 7 events should be shown, but with 8 we should already show the first 3, then a "..." row, and then the last 3). Note however that this number should be configurable through the print_max_events variable in temporian/utils/config.py as it is now.

You can generate an EventSet with a single feature, no index, and N events like this for example:

N = 8
values = list(range(N))
evset = tp.event_set(
    timestamps=values,
    features={"f": values},
)

Answered to the original non-edited comment 😉. Eager to review your work!

Also, feel free to join our Discord if you'd like quick help while implementing this.

Yeah I had edited it because I had found out how to make the values. In regards to what you just said though, why would up to 7 events be shown? If you only are looking for the top 3 and bottom 3, would you not want the top three, a "..." row, and then the bottom 3? As for the discord, if I really run into trouble, I will look for help there, but I hope to be able to work it out on my own.

Showing first 3, then ..., then last 3 takes up 7 rows, so if the EventSet has 7 events I'd propose showing all 7 (since it takes up the same space but shows an extra row), and only start showing the ... for 8 and above :)