Skip to content

Conversation

@camuthig
Copy link

This pull request attempts to update the PlainRegistry to set self._cache to the data retrieve from the cached data. Tests are passing, so I believe this change resolves the issue linked, but I'm not confident if it is the correct resolution or not.

When building a unit registry using a cache, the read cache data is not
getting leveraged. Instead a new cache is getting built, but without the
dimensional equivalents.

This creates a behavior where you create a new UnitRegistry from already
cached files and call `get_compatible_units` it will always fail with
a key error.
@hgrecco
Copy link
Owner

hgrecco commented Apr 25, 2023

I don't think this is a good idea without further thoughts. Basically, I am worried that we might be caching objects which are specific to this registry. Remember that certain objects (Quantity/Unit/Context/Measurement) are registry instance specific and should not be cached. That part of the code is not in use to investigate if this was a good idea or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dimensional equivalents missing when loading from cache

2 participants