Skip to content

Commit

Permalink
always include the last day
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca committed Oct 19, 2024
1 parent a601e7d commit fd81a73
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion count_by_instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import List
import pandas as pd
import seaborn as sns
from datetime import timedelta

import matplotlib.pyplot as plt
import argparse
Expand Down Expand Up @@ -35,7 +36,12 @@ def main(args):
keyword="test"
)

today = datetime.now().date().strftime("%Y-%m-%dT%H:%M:%SZ")
today = datetime.now().date()

today_plus_one = today + timedelta(days=1)

# Format the date
today_plus_one_str = today_plus_one.strftime("%Y-%m-%dT%H:%M:%SZ")

commit = app.get_commit_by_date(date=today, repository=args.repo)
repo_files = app.get_repository_by_commit(
Expand Down
Binary file added latest-groovy-detailed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added latest-groovy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def main(args):

plt.xlabel('Date', fontsize=14)
plt.ylabel('Count', fontsize=14)
plt.title('Test File Count in Instrumentation Directory', fontsize=16)
plt.title('Count of test files in Instrumentation directory', fontsize=16)
plt.xticks(rotation=45)

plt.legend()
Expand Down
Binary file modified media/example_pie_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ def get_dates_between(start_date_str, end_date, interval):
days_diff = (end_date - start_date).days

# Generate the list of dates
date_list = []
date_list = set()
for i in range(0, days_diff + 1, int(interval)):
date_item = start_date + timedelta(days=i)
start_date_str = date_item.strftime(output_format)
date_list.append(start_date_str)
date_list.add(start_date_str)

# always include today in the set
date_list.add(datetime.now().strftime(output_format))

return date_list

Expand Down

0 comments on commit fd81a73

Please sign in to comment.