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
Revamp HTML reprs of Raw
, Epochs
, Evoked
, and Info
#12583
base: main
Are you sure you want to change the base?
Conversation
… in design and in content
…ne-python into evoked-html-repr
you're aligning to the minimum info by dropping number of channels and time points. I find it useful to know the duration and how many channels are available. |
@agramfort Are you suggesting to add number of samples and channels to the Epochs repr instead, then? I could do that, no problem |
yes I would have done that if you push for consistency.
… Message ID: ***@***.***>
|
Ok i'll take a look! |
Evoked
HTML repr to closer match the one from Epochs
, both in design and in contentRaw
, Epochs
, Evoked
to be more consistent
I'm generally quite happy with the improved consistency. Thanks! Nitpicks:
|
I was worried this could be confused with "sampling points" on the time axis … I had first thought of labeling it "digitized had shape and sensor positions", but it's too long. I'm okay with changing it back to "digitized points", but it's not my favorite – maybe if we brainstorm a little, we can come up with a better idea?
Yes, it was there before and I'm actually not sure if it's really needed?
Good idea, I can do that! |
@drammock Another thing we may need to address – these tables are quite long now, and I haven't added collapsible sections like we have for |
Raw
, Epochs
, Evoked
to be more consistentRaw
, Epochs
, Evoked
to be more consistent
+1 for |
It's actually a bit better 😆 |
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.
it looks beautiful @hoechenberger 😍 And the refactoring of the Jinja templates resolves a big pain point --- it will be much easier to make other object types have consistent HTML reprs now too.
I left a couple minor inline comments/suggestions, here are three other tiny suggestions/ideas from looking at the rendered output:
- In the "general" section, "Data type" feels like not quite the right name (to me "data type" means float, int, complex, etc). Maybe "object type"?
- I'm very slightly bothered by the title of the "Data" section (seems too generic of a title). At first I thought "Times" (to parallel the "channels" section) would work instead --- for raw and epochs, the "data" section is all about time-domain things (duration, sfreq, events; events is not strictly about time, but if you squint it could make sense under a "times" heading). Sadly this doesn't work for evokeds, because there we also get "aggregation" and "condition" entries. I think it's OK to leave as "data" for now unless someone has a quick idea about a better alternative.
- I think it's confusing for "good channels" to say "59 EEG" (a count) and "bad channels" to say "EEG 053" (a channel name that looks a lot like a count of channels of a particular type). A couple possible repairs:
a. channel names are always enquoted
b. when there are few enough channels to be worth writing them individually, write a count followed by names in parentheses (e.g.,bad channels: 1 (EEG 053)
).
All of these are small enough that they can be done later / are not blockers for me
mne/html_templates/_templates.py
Outdated
|
||
def _dt_to_str(dt: datetime.datetime) -> str: | ||
"""Convert a datetime object to a human-reaable string representation.""" | ||
return dt.strftime("%B %d, %Y %H:%M:%S") + " UTC" |
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.
does %Z
not work here?
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
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.
This could work, yes
I can try it out
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.
This seems to work!
While we're at it: WDYT about a date representation like this:
2002-12-03 at 19:01:10 UTC
(YYYY-MM-DD)
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.
YYYY-MM-DD
That is my personal preferred date format, so I'm fine with it :)
It's also what ISO 8601 stipulates, so it's as good a choice as any
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.
@drammock I agree with all of these, including the naming of the "Data" section and the inconsistencies re the good / bad channels. However this is already present in (Re Data: I actually spent a while thinking about it and exploring different names, but couldn't come up with anything better… happy to keep on brainstorming though!) |
Co-authored-by: Daniel McCloy <dan@mccloy.info>
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.
thanks @hoechenberger !
@drammock FYI when I started with this work, I named the That said, one could argue that a Data section is just as inappropriate there. So what do you say, shall we rename Data -> Recording? I can push a commit so you can take a look at the rendered reprs to get a better idea of what it "feels" like |
I have addressed this in aacb2c4 and renamed it to "MNE object time", WDYT? |
…in the Channels section
I'll look into this. Thanks to the refactoring I've done here, I believe now I only have to touch the |
I renamed Data to Acquisition |
that's an improvement I think. The number averaged in an Evoked isn't really "acquisition" but I think it's OK. |
…voked-html-repr
Raw
, Epochs
, Evoked
to be more consistentRaw
, Epochs
, Evoked
, and Info
For example, the
Evoked
repr contained the number of channels, but failed to subtract or report any bads.Also I believe reporting the number of sampling points is quite pointless , so I removed that as well.
The table layout wasn't up-to-date either.
main
(striped layout only added by VS Code, actually not present in the tables we produce!)This PR:
For comparison,
Epochs
:MWE: