Skip to content

Commit

Permalink
Use datetime for ramp-up calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
1kastner committed May 23, 2024
1 parent 30760e5 commit 25c1427
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ def _update_generation_properties_and_distributions(self):

ramp_up_period = container_flow_generation_properties.ramp_up_period
ramp_down_period = container_flow_generation_properties.ramp_down_period
self.ramp_up_period_end = self.container_flow_start_date + datetime.timedelta(days=ramp_up_period)
self.ramp_down_period_start = self.container_flow_end_date - datetime.timedelta(days=ramp_down_period)
self.ramp_up_period_end = datetime.datetime.combine(
self.container_flow_start_date, datetime.time(hour=0, minute=0, second=0)
) + datetime.timedelta(days=ramp_up_period)
self.ramp_down_period_start = datetime.datetime.combine(
self.container_flow_end_date, datetime.time(hour=0, minute=0, second=0)
) - datetime.timedelta(days=ramp_down_period)
assert self.ramp_up_period_end <= self.ramp_down_period_start

self.transportation_buffer: float = container_flow_generation_properties.transportation_buffer
Expand Down

0 comments on commit 25c1427

Please sign in to comment.