Skip to content

Commit

Permalink
add repo label to org libyear graph
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Milarsky <[email protected]>
  • Loading branch information
IsaacMilarky committed Nov 15, 2024
1 parent ad9ce01 commit 3d3e8c2
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions scripts/gen_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,20 @@ def parse_libyear_list(dependency_list):
#print(dep)
if dep[-2] >= 0:
date = datetime.datetime.strptime(dep[-1], '%Y-%m-%dT%H:%M:%S.%f')

dep_dict = {
"dep_name": dep[-3],
"libyear_value": dep[-2],
"libyear_date_last_updated": date
}

if len(dep) > 3:
dep_dict['repo_name'] = dep[0]
else:
dep_dict['repo_name'] = ''

to_return.append(
{
"dep_name": dep[-3],
"libyear_value": dep[-2],
"libyear_date_last_updated": date
}
dep_dict
)

#return list sorted by date
Expand Down Expand Up @@ -362,7 +370,10 @@ def generate_libyears_graph(oss_entity):
#We are going to treat the y-axis as having one dep per level in the graph
elevation = 0
for dep in dep_list:
dateline.add(dep["dep_name"], [

label = f"{dep["dep_name"]}/{dep["repo_name"]}"

dateline.add(label, [
(timedelta(), elevation),
(timedelta(days=dep["libyear_value"] * 365), elevation),
])
Expand Down

0 comments on commit 3d3e8c2

Please sign in to comment.