Replies: 1 comment 1 reply
-
This may work, but you still can't get rid of With modelx, you can do space = mx.new_space()
@mx.defcells
def foo():
return bar()
@mx.defcells
def bar():
return 1
space.foo() # or just foo() works
# Returns 1
# Now updating bar
@mx.defcells
def bar():
return 2
space.foo() # or just foo() works
# Returns 2 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(Originally posted on https://modelx.io/blog/2022/10/29/why-you-should-use-modelx/)
There is a library called methodtools which includes an lru_cache decorator, someone has even opened an issue and proposed a solution for clearing the cache when an attribute is changed - https://github.com/youknowo.... This might solve the issue brought up under the section "Using Python class instead of modelx"?
Beta Was this translation helpful? Give feedback.
All reactions