Skip to content

Commit

Permalink
remove a edge effect due to caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainp committed Nov 26, 2020
1 parent 0557ba9 commit 2fbbc6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smrt/core/snowpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def layer_densities(self):
DeprecationWarning)
return [lay.density for lay in self.layers] # TODO Ghi: caching

@functools.lru_cache()
#@functools.lru_cache() # this has side effect when layers are changed after calling this function
def profile(self, property_name):
"""return the property of each layer as a list
"""
Expand All @@ -114,7 +114,7 @@ def profile(self, property_name):
elif property_name == "mid_layer_depths":
return self.mid_layer_depths
else:
return [getattr(lay, property_name) for lay in self.layers] # TODO Ghi: caching
return [getattr(lay, property_name) for lay in self.layers]

def append(self, layer, interface=None):
"""append a new layer at the bottom of the stack of layers. The interface is that at the top of the appended layer.
Expand Down

0 comments on commit 2fbbc6f

Please sign in to comment.