Skip to content

Commit

Permalink
Fix completion plot for early finishes
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Feb 21, 2024
1 parent c5d5cce commit ea0f515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions estimage/visualize/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, period_bounds, dom, cdf, ppf_cb):
self.period_start = period_bounds[0]
self.period_end = period_bounds[1]
self.chart_days_before_dday = - min(int(self.dom[0]), (self.period_end - self.get_date_of_dday()).days)
self.chart_days_after_completion = min(0, (self.get_date_of_dday() + utils.ONE_DAY * self.dom[-1] - self.period_end).days)
self.chart_days_after_completion = - min(0, (self.get_date_of_dday() + utils.ONE_DAY * self.dom[-1] - self.period_end).days)
self.ppf = ppf_cb
self._pad_dom_and_cdf()

Expand All @@ -30,7 +30,7 @@ def _pad_dom_and_cdf(self):
self.cdf = np.concatenate((
np.zeros(self.chart_days_before_dday),
self.cdf,
np.ones(self.chart_days_after_completion) * 100))
np.ones(self.chart_days_after_completion) * self.cdf[-1]))

def _dom_to_days(self, dom_numbers):
return dom_numbers - self.dom[0]
Expand Down

0 comments on commit ea0f515

Please sign in to comment.