File size: 2,393 Bytes
b693c5c
c121aed
f3262d9
5e35297
0fa040d
363c4c6
bc55598
0fa040d
79e6cc7
b3ea78d
b693c5c
c121aed
 
70ca32b
6764300
82865c2
 
c166c26
 
 
c749392
4a989b6
7ef5095
 
 
be2b6f9
f9fe402
215416f
 
 
f9fe402
959888e
7ef5095
 
 
 
 
35dfb36
959888e
 
8acef28
959888e
 
0531bf9
70292e6
959888e
 
 
363c4c6
959888e
 
 
bc55598
cc9bf37
 
a00ced0
cc9bf37
 
 
8dde5f0
c5f37bf
cc9bf37
8dde5f0
b3ea78d
cc9bf37
0fa040d
cc9bf37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from github import Github
import os 
import streamlit as st
import datetime
import plotly.figure_factory as ff
import pandas as pd
import math

st.set_page_config(layout="wide")
name2repo = [("Inference", "bigcode-project/bigcode-inference-benchmark")]

g = Github(os.environ.get('github'))

inference_repo = g.get_repo("bigcode-project/bigcode-inference-benchmark")
df = list()

for milestone in inference_repo.get_milestones():
    desc = dict()
    for line in milestone.description.split('\n'):
        tmp = line.split(":")
        desc[tmp[0].lower()] = tmp[1].lower().strip()
    df.append(dict(Task=f"""<a href="https://www.github.com/bigcode-project/bigcode-inference-benchmark/milestone/{milestone.number}", target="_black">{milestone.title}</a>""", 
                   Start=desc['start date'], 
                   Finish=milestone.due_on.strftime('%Y-%m-%d'), 
                   Resource=desc['status'], 
                   Description=desc['leader']))

colors = {'not started': 'rgb(220, 0, 0)',
          'incomplete': (1, 0.9, 0.16),
          'complete': 'rgb(0, 255, 100)'}


fig = ff.create_gantt(df, colors=colors, 
                      index_col='Resource', 
                      show_colorbar=True, 
                      show_hover_fill=True, 
                      title="BigCode planning")

fig.update_xaxes(ticks= "outside",
                 ticklabelmode= "period", 
                 tickformat="%b",
                 tickcolor= "black", 
                 ticklen=10, 
                 range=[datetime.datetime(2022, 12, 30),
                        datetime.datetime(2023, 4, 2)],
                 minor=dict(
                     ticklen=4,  
                     dtick=7*24*60*60*1000,  
                     tick0="2023-01-01", 
                     griddash='dot', 
                     gridcolor='white')
                )

fig.update_yaxes(automargin=True) # fix margins
fig.layout.xaxis.rangeselector = None # remove range selector on top

fig.add_vline(x=datetime.datetime.now().strftime('%Y-%m-%d'), line_width=3, line_dash="dash", line_color="black")
fig.add_annotation({
            "x": datetime.datetime.now().strftime('%Y-%m-%d'),
            "y": fig.layout.yaxis['range'][1],
            "ay": 0.1,
            "text": "Today",
            "align": "left",
            "showarrow": False,
        })

st.plotly_chart(fig, use_container_width=True)