Skip to content

Commit

Permalink
Bug in macro cache read when read/write are disabled (#207)
Browse files Browse the repository at this point in the history
Fixes #206
  • Loading branch information
nikhilwoodruff authored May 8, 2024
1 parent 54c6b44 commit 572507d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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:
fixed:
- Bug in macro cache logic.
4 changes: 3 additions & 1 deletion policyengine_core/simulations/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ def _calculate(

cache_path = self._get_macro_cache(variable_name, str(period))
if cache_path and cache_path.exists():
return self._get_macro_cache_value(cache_path)
value = self._get_macro_cache_value(cache_path)
if value is not None:
return self._get_macro_cache_value(cache_path)

if variable.requires_computation_after is not None:
if variable.requires_computation_after not in [
Expand Down

0 comments on commit 572507d

Please sign in to comment.