-
Notifications
You must be signed in to change notification settings - Fork 44
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
Issue #356: Show first and last events instead of only first ones when displaying an EventSet #362
Conversation
…n displaying an EventSet
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jtaylor205! Great work so far :) A couple of comments:
- The elipsis row should be shown in the middle of the first 3 and last 3 rows, not at the end. See how pandas does it:
![image](https://private-user-images.githubusercontent.com/49082859/301295880-0c8ca3f9-9fe7-4741-8e9a-5a5cc679ea75.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NTgwNDcsIm5iZiI6MTczOTg1Nzc0NywicGF0aCI6Ii80OTA4Mjg1OS8zMDEyOTU4ODAtMGM4Y2EzZjktOWZlNy00NzQxLThlOWEtNWE1Y2M2NzllYTc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA1NDkwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEzOTEwNzFlNjUxZmJlYTE4ODQxNjUxNDNmMGI1OTIyNjhkMmIzMWYyZjEwMmQwOTcwMWQ4NmFiMWI4MTIxYWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._9EvD4xgc_nGEHYini9Eh9VRA2OaSWVO_Z8O5mNozVQ)
- You'll need to accept the Google CLA for the contribution to be merged, see the comment in this PR from the google-cla bot for instructions.
- There's tests checking the eventset is displayed as expected that you'll need to modify: see the
test_html_repr_no_limits
andtest_html_repr_limits
intemporian/implementation/numpy/data/test/event_set_test.py
- Please post a screenshot of the displayed eventset in the PRs description to see what it looks like.
Thanks in advance!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted files based on feedback from ian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screenshots looking perfect!
My comments above about removing [:num_timestamps]
and not reconstructing the list still hold.
Same for the tests: you can run them with bazel test --config=macos //temporian/implementation/numpy/data/test:event_set_test --test_output=errors
. You'll see that both test_html_repr_no_limits
and test_html_repr_limits
fail, because the display changed - you need to update the html in the files test_html_repr_no_limits_golden
and test_html_repr_limits_golden
- you can do this manually, or by copying the output of your new code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTML adjusted to represent changes made throughout pull request, removed [:max_timestamps] as it was unnecessary, and changed comment to reference 'max_timestamps' instead of '7'
Formatting check is failing - ensure you have black is correctly configured (should be running on save by default if no user VSCode setting is overriding the workspace's ones) |
Please merge main branch into your PR's branch so that tests are ran on it (fixed in #363) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted lines with further comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatted file to not fail check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have finished working golden files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed golden files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after my last comment is addressed. Great work @jtaylor205 and congrats on your first open source contribution! 🎉
Will wait for a review from @javiber before merging.
Edit: found some breaking behavior that needs to be addressed.
if num_timestamps > max_timestamps: | ||
# Timestamp + features + <... column if was added> | ||
row = [ELLIPSIS] * (1 + len(visible_feats) + int(has_hidden_feats)) | ||
# Create ellipsis row between first half and last half if more than man_timestamps entries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct typo, max_timestamps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing the display manually it seems to break when setting tp.config.display_max_events = None
(which should have the same behavior as setting it to 0
). Please write a test that does the same thing as test_html_repr_no_limits
but sets all variables to None
instead of 0
, and checks the result against the same golden file, and fix the code to make it work.
Thanks!
Hi @jtaylor205 thanks for the contribution! Testing this locally I found that setting ![]() |
Hi @javiber , I have fixed that problem. Below is what it now shows. I will upload my changes now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made change to error when max_event were set to 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made changes based on "None" conditions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes made due to requested implementation and bugs
Congrats on your first open-source contribution @jtaylor205! Good job 💪🏼 |
Adjusted displays_util.py to display 7 at a time until more than 7 timestamps are created, in which the ellipses row is implemented after the first three rows, with the last 3 rows following that row.