Total Complexity | 2 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """Creates a table figure that shows |
||
2 | photos that did and did not have exif""" |
||
3 | import logging |
||
4 | import plotly.graph_objects as go |
||
5 | |||
6 | log = logging.getLogger("MetaStalk") |
||
7 | |||
8 | |||
9 | def Stats(photos: list, invalid: list) -> go.Figure(): |
||
10 | """Stats |
||
11 | |||
12 | Creates the table of photos showing ones with metadata and ones without |
||
13 | |||
14 | Arguments: |
||
15 | photos {list} -- List of photos with metadata. |
||
16 | invalid {list} -- List of photos without metadata. |
||
17 | |||
18 | Returns: |
||
19 | go.Figure() -- A plotly table |
||
20 | """ |
||
21 | log.info("Staring Stats") |
||
22 | log.debug("There are %s photos with metadata and %s without", |
||
23 | len(photos), len(invalid)) |
||
24 | simple_photos = [] |
||
25 | for i, _ in enumerate(photos): |
||
26 | simple_photos.append(photos[i]["item"]) |
||
27 | fig = go.Figure( |
||
28 | data=[go.Table( |
||
29 | header=dict(values=[ |
||
30 | "Photos with Metadata", |
||
31 | "Photos without Metadata"]), |
||
32 | cells=dict(values=[simple_photos, invalid]))]) |
||
33 | return fig |
||
34 |