Fix bug where calendar caching meant invalid duration calculations if you edited your calendar after a date calculation.

This commit is contained in:
Dion Moult
2023-02-03 10:06:55 +11:00
parent be26a77ecb
commit f72d48aab5
5 changed files with 65 additions and 4 deletions
@@ -16,6 +16,9 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.util.sequence
class Usecase:
def __init__(self, file, recurrence_pattern=None, attributes=None):
@@ -56,3 +59,6 @@ class Usecase:
def execute(self):
for name, value in self.settings["attributes"].items():
setattr(self.settings["recurrence_pattern"], name, value)
ifcopenshell.util.sequence.is_working_day.cache_clear()
ifcopenshell.util.sequence.is_calendar_applicable.cache_clear()