Fix #4224. Fix sequencing lint bugs.

This commit is contained in:
Dion Moult
2024-01-16 10:47:50 +11:00
parent 2ef2f923d0
commit 40b6b3bf17
2 changed files with 4 additions and 3 deletions
@@ -18,6 +18,7 @@
import datetime
import ifcopenshell.util.date
from math import floor
from functools import lru_cache
@@ -221,7 +222,7 @@ def is_work_time_applicable_to_day(work_time, day):
return False # TODO
elif recurrence.RecurrenceType == "MONTHLY_BY_POSITION":
if not recurrence.Interval and not recurrence.Occurrences:
return (day.weekday() + 1) in recurrence.WeekdayComponent and math.floor(
return (day.weekday() + 1) in recurrence.WeekdayComponent and floor(
day.day / 7
) + 1 == recurrence["Position"]
return False # TODO
@@ -237,7 +238,7 @@ def is_work_time_applicable_to_day(work_time, day):
return (
day.month in recurrence.MonthComponent
and (day.weekday() + 1) in recurrence.WeekdayComponent
and math.floor(day.day / 7) + 1 == recurrence.Position
and floor(day.day / 7) + 1 == recurrence.Position
)
return False # TODO