Skip to content

Commit

Permalink
Remove partial month completely
Browse files Browse the repository at this point in the history
  • Loading branch information
djw8605 committed Feb 15, 2022
1 parent 8bfb017 commit 7719a74
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gracc_osg_reports/MonthlySitesViewReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def format_report(self):
table = self.generate_report_file()

# Figure out the percentage of the month we have completed
now = self.end_time
now = datetime.datetime.now()
days_in_month = calendar.monthrange(now.year, now.month)[1]

# Scale up the partial month to the full month
Expand All @@ -176,10 +176,11 @@ def date_to_yeardate(date):

# Multiply the partial month by the percentage
partial_month = table.columns.values.tolist()[-1]
multiplied_column = table[table.columns[-1]] * percentage
table.insert(len(table.columns), "{} * {:.2f}".format(partial_month, percentage), multiplied_column)
table[table.columns[-1]] = table[table.columns[-1]] * percentage
table = table.rename(columns= {partial_month:"{} * {:.2f}".format(partial_month, percentage)})
#table.insert(len(table.columns), "{} * {:.2f}".format(partial_month, percentage), multiplied_column)

print(table.reset_index().to_csv(index=False))
#print(table.reset_index().to_csv(index=False))
return table.reset_index()


Expand Down

0 comments on commit 7719a74

Please sign in to comment.