Replies: 3 comments 2 replies
-
def load_definitions(self, ...):
# actual code
if not ureg._defining:
self._build_cache() |
Beta Was this translation helpful? Give feedback.
0 replies
-
@hgrecco The solution you proposed using |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, the idea is that |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As pointed out in #1773, when redefining a unit, certain caches needs to be invalidated. The easy way is to do it after each definition but this is expensive if it is used many times. One proposal would be to create a
defining
state to the registry to make this more performant.In pseudo code would look something like this:
and when multiple are done
The other proposal would be to detect if a redefinition has occur. But we have to be careful about all alias, prefixed units and stuff. I like this second option more, but we need to be sure to make it right.
Beta Was this translation helpful? Give feedback.
All reactions