QualityReports#
- class pypillometry.QualityReports(data=None, headers=None, tooltips=None, item='recording')[source]#
Bases:
dictQuality reports of several recordings (e.g., of a dataset).
A dict
key -> QualityReport, made byDataset.quality_report(key:(subject, task), or the subject if the dataset has no tasks). It is shown as a summary table, one row per recording, with the overall label and the worst label of each section; the individual reports are its values (reports["002"]).- Parameters:
data (dict, optional) – key -> QualityReport
headers (dict, optional) – key -> header shown above the report in
to_text()andto_html()(default: the name of the row)tooltips (dict, optional) – key -> text shown when hovering over the row in
to_html()item (
str) – what a row is, in the summary table (default"recording")
Methods
Remove all items from the dict.
Return a shallow copy of the dict.
Create a new dictionary with keys from iterable and values set to value.
Return the value for key if key is in the dictionary, else default.
Return a set-like object providing a view on the dict's items.
Return a set-like object providing a view on the dict's keys.
If the key is not found, return the default if given; otherwise, raise a KeyError.
Remove and return a (key, value) pair as a 2-tuple.
Insert key with a value of default if key is not in the dictionary.
Write the reports to an HTML page: the summary table, linked to the individual reports below it (as
pypilinfo --html).All measures as a
pandas.DataFrame.The summary table (for more than one report) and the reports as text.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
Return an object providing a view on the dict's values.
Details
- classmethod fromkeys(iterable, value=None, /)#
Create a new dictionary with keys from iterable and values set to value.
- clear(/)#
Remove all items from the dict.
- copy(/)#
Return a shallow copy of the dict.
- get(key, default=None, /)#
Return the value for key if key is in the dictionary, else default.
- items(/)#
Return a set-like object providing a view on the dict’s items.
- keys(/)#
Return a set-like object providing a view on the dict’s keys.
- pop(key, default=<unrepresentable>, /)#
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem(/)#
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)#
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- to_html(fname)[source]#
Write the reports to an HTML page: the summary table, linked to the individual reports below it (as
pypilinfo --html).- Return type:
- to_pandas(long=False)[source]#
All measures as a
pandas.DataFrame.- Parameters:
long (
bool) – If False (default), one row per recording, with columns as inQualityReport.to_dict()withflat=True(e.g.,"pupil.left.missing_pct"and its label). If True, one row per measure and recording, with columnssubject(andtask),section,group(the eye, or"all"),measure,value,unitandlabel; e.g.df.query("section == 'calibration'").- Return type:
- to_text(reports=True, color=None, descriptions=False)[source]#
The summary table (for more than one report) and the reports as text.
- Parameters:
reports (
bool) – also the individual reports, each below its header (default True); else only the summary tablecolor (
Optional[bool]) – seeQualityReport.to_text()descriptions (
bool) – seeQualityReport.to_text()
- Return type:
- update([E, ]**F) None. Update D from mapping/iterable E and F.#
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values(/)#
Return an object providing a view on the dict’s values.