Conditions | 2 |
Total Lines | 29 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | """Creates a table figure that shows |
||
10 | 1 | def stats(photos: list, invalid: list) -> go.Figure(): |
|
11 | """Stats |
||
12 | |||
13 | Creates the table of photos showing ones with metadata and ones without |
||
14 | |||
15 | Arguments: |
||
16 | photos {list} -- List of photos with metadata. |
||
17 | invalid {list} -- List of photos without metadata. |
||
18 | |||
19 | Returns: |
||
20 | go.Figure() -- A plotly table |
||
21 | """ |
||
22 | 1 | log.info("Staring Stats") |
|
23 | 1 | log.debug( |
|
24 | "There are %s photos with metadata and %s without", len(photos), len(invalid) |
||
25 | ) |
||
26 | 1 | simple_photos = [] |
|
27 | 1 | for i, _ in enumerate(photos): |
|
28 | 1 | simple_photos.append(photos[i]["item"]) |
|
29 | 1 | fig = go.Figure( |
|
30 | data=[ |
||
31 | go.Table( |
||
32 | header=dict(values=["Photos with Metadata", "Photos without Metadata"]), |
||
33 | cells=dict(values=[simple_photos, invalid]), |
||
34 | ) |
||
35 | ] |
||
36 | ) |
||
37 | 1 | fig.update_layout(title="Photos With and Without Metadata.", title_x=0.5) |
|
38 | return fig |
||
39 |