Skip to content

Commit

Permalink
Set macro cache to off by default (#272)
Browse files Browse the repository at this point in the history
Fixes #271
  • Loading branch information
nikhilwoodruff authored Sep 9, 2024
1 parent 1bc4ec6 commit 87ffcc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
changed:
- Disable macro cache by default.
6 changes: 4 additions & 2 deletions policyengine_core/simulations/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class Simulation:
is_over_dataset: bool = False
"""Whether this simulation is built over a dataset."""

macro_cache_read: bool = True
macro_cache_read: bool = False
"""Whether to read from the macro cache."""

macro_cache_write: bool = True
macro_cache_write: bool = False
"""Whether to write to the macro cache."""

start_instant: str = None
Expand Down Expand Up @@ -1419,6 +1419,8 @@ def check_macro_cache(self, variable_name: str, period: str) -> bool:
"""
Check if the variable is able to have cached value
"""
if not self.macro_cache_read:
return False

# Dataset should always exist, but just in case
if not hasattr(self, "dataset"):
Expand Down

0 comments on commit 87ffcc7

Please sign in to comment.