Phil 1.23.19

ASRC NASA 9:00 – 4:30

  • New schema, as of yesterday: diagram
  • Next steps for financial analytics
  • Found a subtle error with creating the actual date from the fiscal date:
    def override_dates(self, year: int, fmonth: int):
        # handle fiscal math converting months that are greater than 12 to the correct fiscal year and month
        self.fiscal_year = year
        if fmonth > 12:
            fmonth = (fmonth % 12) + 1
            self.fiscal_year += 1
        self.fiscal_month = fmonth
    
        # convert the fiscal month and year to actual
        month = fmonth + 2 # convert from US Gov Fiscal to Actual
        self.actual_year = year
        if month > 12:
            month = (month % 12)
            self.actual_year += 1
        self.actual_month = month

    The issue is how the months are handled. The fiscal month is taking an unbounded number and modding it by 12. That produces a range from 0 – 11, so I add one to the result. The actual month is offset by 2 months (The end of the fiscal year is two months before the end of the actual year). So in this case I mod by 12, but don’t have to add the one because it’s working on a range of 1 – 12, not 0 – 11. Anyway, I think it’s fixed now.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.