mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 20:22:09 +00:00
Fix #4224. Fix sequencing lint bugs.
This commit is contained in:
@@ -70,7 +70,7 @@ class Usecase:
|
|||||||
elif self.settings["relating_product"]:
|
elif self.settings["relating_product"]:
|
||||||
for reference in self.settings["relating_product"].ReferencedBy:
|
for reference in self.settings["relating_product"].ReferencedBy:
|
||||||
if reference.is_a("IfcRelAssignsToProduct"):
|
if reference.is_a("IfcRelAssignsToProduct"):
|
||||||
related_object = referenced_by.RelatedObjects[0]
|
related_object = reference.RelatedObjects[0]
|
||||||
if related_object:
|
if related_object:
|
||||||
assignments = self.settings["related_object"].HasAssignments
|
assignments = self.settings["related_object"].HasAssignments
|
||||||
for assignment in assignments:
|
for assignment in assignments:
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import ifcopenshell.util.date
|
import ifcopenshell.util.date
|
||||||
|
from math import floor
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
|
||||||
|
|
||||||
@@ -221,7 +222,7 @@ def is_work_time_applicable_to_day(work_time, day):
|
|||||||
return False # TODO
|
return False # TODO
|
||||||
elif recurrence.RecurrenceType == "MONTHLY_BY_POSITION":
|
elif recurrence.RecurrenceType == "MONTHLY_BY_POSITION":
|
||||||
if not recurrence.Interval and not recurrence.Occurrences:
|
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
|
day.day / 7
|
||||||
) + 1 == recurrence["Position"]
|
) + 1 == recurrence["Position"]
|
||||||
return False # TODO
|
return False # TODO
|
||||||
@@ -237,7 +238,7 @@ def is_work_time_applicable_to_day(work_time, day):
|
|||||||
return (
|
return (
|
||||||
day.month in recurrence.MonthComponent
|
day.month in recurrence.MonthComponent
|
||||||
and (day.weekday() + 1) in recurrence.WeekdayComponent
|
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
|
return False # TODO
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user