Total Complexity | 2 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | """Creates a table figure that shows |
||
2 | photos that did and did not have exif""" |
||
3 | 1 | import logging |
|
4 | 1 | import plotly.graph_objects as go |
|
5 | |||
6 | 1 | log = logging.getLogger("MetaStalk") |
|
7 | |||
8 | |||
9 | 1 | 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 | 1 | log.info("Staring Stats") |
|
22 | 1 | log.debug("There are %s photos with metadata and %s without", |
|
23 | len(photos), len(invalid)) |
||
24 | 1 | simple_photos = [] |
|
25 | 1 | for i, _ in enumerate(photos): |
|
26 | 1 | simple_photos.append(photos[i]["item"]) |
|
27 | 1 | 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 | 1 | fig.update_layout(title="Photos With and Without Metadata.", title_x=0.5) |
|
34 | return fig |
||
35 |