diff --git a/src/bonsai/bonsai/bim/module/drawing/decoration.py b/src/bonsai/bonsai/bim/module/drawing/decoration.py index 418951f333..35aafd51ad 100644 --- a/src/bonsai/bonsai/bim/module/drawing/decoration.py +++ b/src/bonsai/bonsai/bim/module/drawing/decoration.py @@ -37,7 +37,7 @@ from bonsai.bim.module.drawing.data import DecoratorData, DrawingsData from bonsai.bim.module.drawing.shaders import add_verts_sequence, add_offsets from bonsai.bim.module.drawing.helper import format_distance from timeit import default_timer as timer -from functools import lru_cache +from functools import cache from typing import Optional, Iterator, Type, Union UNSPECIAL_ELEMENT_COLOR = (0.2, 0.2, 0.2, 1) # GREY @@ -495,7 +495,7 @@ class BaseDecorator: self.draw_label(context, text=text, line_no=line_number_start, multiline=True, **draw_label_kwargs) - @lru_cache(maxsize=None) + @cache def format_value(self, context, value, custom_unit=None): drawing_pset_data = DrawingsData.data["active_drawing_pset_data"] precision = drawing_pset_data.get("MetricPrecision", None) diff --git a/src/ifcopenshell-python/ifcopenshell/util/sequence.py b/src/ifcopenshell-python/ifcopenshell/util/sequence.py index 720bebfb22..46483824f1 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/sequence.py +++ b/src/ifcopenshell-python/ifcopenshell/util/sequence.py @@ -19,7 +19,7 @@ import datetime import ifcopenshell.util.date from math import floor -from functools import lru_cache +from functools import cache from typing import Union, Literal, Optional, Iterator @@ -170,7 +170,7 @@ def get_recent_working_day(start, duration_type: DURATION_TYPE, calendar: ifcope return start -@lru_cache(maxsize=None) +@cache def is_working_day(day, calendar: ifcopenshell.entity_instance) -> bool: is_working_day = False for work_time in calendar.WorkingTimes or []: @@ -186,7 +186,7 @@ def is_working_day(day, calendar: ifcopenshell.entity_instance) -> bool: return is_working_day -@lru_cache(maxsize=None) +@cache def is_calendar_applicable(day, calendar: ifcopenshell.entity_instance) -> bool: if not calendar or not calendar.WorkingTimes: return False